def test_left_span_4(): print("Tests a single read with a single junction N") print("Region: chr10:122666367-122668067:+") print("Read: D80KHJN1:241:C5HF7ACXX:6:2113:6890:67612") print("Should support skipping (read spans this region(intron)") bam = single_jxn_skip_4() jxc_coord = 'chr10:122666367-122668067:+' min_overlap = 8 aligned_file = pysam.AlignmentFile(bam, "rb") chrom, five, three, strand = j.parse_jxn_string(jxc_coord) for read in aligned_file.fetch(chrom, five - min_overlap, five): skip, incl = j.left_span(read, three, min_overlap) assert skip == False assert incl == False
def test_left_span_1(): print("Tests a single read with a single junction N") print("Region: chr10:135209281-135209666:+") print("Read: D80KHJN1:241:C5HF7ACXX:6:1307:9279:87799") print("Should support skipping (read spans this region(intron)") bam = single_jxn_skip_1() jxc_coord = 'chr10:135209281-135209666:+' min_overlap = 1 aligned_file = pysam.AlignmentFile(bam, "rb") chrom, five, three, strand = j.parse_jxn_string(jxc_coord) for read in aligned_file.fetch(chrom, five - min_overlap, five): skip, incl = j.left_span(read, three, min_overlap) assert skip == True assert incl == False
def test_right_span_inclusion_7(): print("Tests a inclusion read that doesn't quite overlap over " "the min_overlap reqs") print("Region: chr10:122666367-122668067:+") print("Read: D80KHJN1:241:C5HF7ACXX:6:2113:2908:58516") print("Should support nothing (would support inclusion " "if min overhang wasn't 34") bam = inclusion_7() min_overlap = 34 jxc_coord = 'chr10:122666367-122668067:+' aligned_file = pysam.AlignmentFile(bam, "rb") chrom, five, three, strand = j.parse_jxn_string(jxc_coord) for read in aligned_file.fetch(chrom, five - min_overlap, five): skip, incl = j.right_span(read, five, min_overlap) assert skip == False assert incl == False