Ejemplo n.º 1
0
 def test_get_variantkey_ref_length_not_found(self):
     osizeref = bs.get_variantkey_ref_length(mc, 0xffffffffffffffff)
     self.assertEqual(osizeref, 0)
Ejemplo n.º 2
0
 def test_get_variantkey_ref_length_reversible(self):
     osizeref = bs.get_variantkey_ref_length(mc, 0x1800925199160000)
     self.assertEqual(osizeref, 3)
Ejemplo n.º 3
0
# The VCF file can be normalized using the `resources/tools/vcfnorm.sh` script.
# This example uses the "c/test/data/nrvk.10.bin".
mf, mc, nrows = vk.mmap_nrvk_file('nrvk.10.bin')
if nrows <= 0:
    assert False, "Unable to open the nrvk.10.bin file"

vk.find_ref_alt_by_variantkey(mc, vk=0x2000c3521f1c15ab)
# (b'ACGTACGT', b'ACGT', 8, 4, 12)
# Return values are: REF, ALT, REF length, ALT length, REF+ALT length

# Reverse all VariantKeys, including the ones that are not directly reversible by using a lookup table.
vk.reverse_variantkey(mc, vk=0x2000c3521f1c15ab)
# (b'4', 100004, b'ACGTACGT', b'ACGT', 8, 4, 12)
# Return values are: CHROM, POS, REF, ALT, REF length, ALT length, REF+ALT length

vk.get_variantkey_ref_length(mc, vk=0x2000c3521f1c15ab)
# 8

vk.get_variantkey_endpos(mc, vk=0x2000c3521f1c15ab)
# 100012

vk.get_variantkey_chrom_startpos(vk=0x2000c3521f1c15ab)
# 1073841828

vk.get_variantkey_chrom_endpos(mc, vk=0x2000c3521f1c15ab)
# 1073841836

vk.munmap_binfile(mf)


# /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Ejemplo n.º 4
0
 def test_get_variantkey_ref_length(self):
     for vkey, chrom, pos, ralen, sizeref, sizealt, csp, cep, ref, alt in testData:
         osizeref = bs.get_variantkey_ref_length(mc, vkey)
         self.assertEqual(osizeref, sizeref)
Ejemplo n.º 5
0
# The VCF file can be normalized using the `resources/tools/vcfnorm.sh` script.
# This example uses the "c/test/data/vknr.10.bin".
mfsrc, mffd, mfsize, mflast = vk.mmap_binfile('vknr.10.bin')
if mffd < 0:
    assert False, "Unable to open the vknr.10.bin file"

print(vk.find_ref_alt_by_variantkey(mfsrc, mflast, vk=0x2000c3521f1c15ab))
# (b'ACGTACGT', b'ACGT', 8, 4, 12)
# Return values are: REF, ALT, REF length, ALT length, REF+ALT length

# Reverse all VariantKeys, including the ones that are not directly reversible by using a lookup table.
print(vk.reverse_variantkey(mfsrc, mflast, vk=0x2000c3521f1c15ab))
# (b'4', 100004, b'ACGTACGT', b'ACGT', 8, 4, 12)
# Return values are: CHROM, POS, REF, ALT, REF length, ALT length, REF+ALT length

print(vk.get_variantkey_ref_length(mfsrc, mflast, vk=0x2000c3521f1c15ab))
# 8

print(vk.get_variantkey_endpos(mfsrc, mflast, vk=0x2000c3521f1c15ab))
# 100012

print(vk.get_variantkey_chrom_startpos(vk=0x2000c3521f1c15ab))
# 1073841828

print(vk.get_variantkey_chrom_endpos(mfsrc, mflast, vk=0x2000c3521f1c15ab))
# 1073841836

vk.munmap_binfile(mfsrc, mffd, mfsize)

# /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\