def test_insert_long(): ref = "CCCCCTCATCACCTCCCCAGCCACGGTGAGGACCCACCCTGGCATGATCT" alt = ("CCCCCTCATCACCTCCCCAGCCACGGTGAGGACCCACCCTGGCATGATCT" "CCCCTCATCACCTCCCCAGCCACGGTGAGGACCCACCCTGGCATGATCT") vd = vcf2cshl(1, ref, alt, trimmer=trim_str_back) assert vd.position == 2 # FIXME
def test_vcf2cshl_variant_format(ref, alt, vt, pos, length): vd = vcf2cshl(1, ref, alt, trimmer=trim_str_back) assert vd.position == pos assert str(vd) == vt assert vd.length == length
def test_spark_v3_problems_check(): # chrom = '1' position = 865461 ref = "AGCCCCACCTTCCTCTCCTCCT" alt = "AGCCCCACCTTCCTCTCCTCCT" "GCCCCACCTTCCTCTCCTCCT" vd = vcf2cshl(position, ref, alt, trimmer=trim_str_back) assert str(vd) == "ins(GCCCCACCTTCCTCTCCTCCT)" assert vd.position == position + 1
def test_tandem_repeat_unit(chrom, position, ref, alt, unit, ref_repeats, alt_repeats): tr_unit, tr_ref, tr_alt = tandem_repeat(ref, alt) assert tr_unit is not None assert tr_ref is not None assert tr_alt is not None assert tr_unit == unit assert tr_ref == ref_repeats assert tr_alt == alt_repeats vd = vcf2cshl(position, ref, alt) assert vd.variant_type & VariantType.tandem_repeat if ref_repeats < alt_repeats: assert vd.variant_type & VariantType.insertion elif ref_repeats > alt_repeats: assert vd.variant_type & VariantType.deletion
def test_cshl_to_vcf_problem(genome_2013): chrom = "2" position = 242815433 variant = "sub(G->A)" position1, reference, alternative = dae2vcf_variant( chrom, position, variant, genome_2013) print(chrom, position, reference, alternative) assert chrom == "2" assert position == position1 assert reference == "G" assert alternative == "A" vd = vcf2cshl(position, reference, alternative, trimmer=trim_str_back) assert vd.position == position assert str(vd) == variant assert vd.length == 1
def from_vcf(chrom, position, reference, alternative): return VariantDetails(chrom, vcf2cshl(position, reference, alternative))