def test_bwa_mem(self): # SamRead(1:224646710-224646924, 183=12D19=, TCAGCTCTCT...) TCAGCTCTCTTAGGGCACACCCTCCAAGGTGCCTAAATGCCATCCCAGGATTGGTTCCAGTGTCTATTATCTGTTTGACTCCAAATGGCCAAACACCTGACTTCCTCTCTGGTAGCCTGGCTTTTATCTTCTAGGACATCCAGGGCCCCTCTCTTTGCCTTCCCCTCTTTCTTCCTTCTACTGCTTCAGCAGACATCATGTG # std SamRead(1:224646710-224646924, 183=12D19=, TCAGCTCTCT...) TCAGCTCTCTTAGGGCACACCCTCCAAGGTGCCTAAATGCCATCCCAGGATTGGTTCCAGTGTCTATTATCTGTTTGACTCCAAATGGCCAAACACCTGACTTCCTCTCTGGTAGCCTGGCTTTTATCTTCTAGGACATCCAGGGCCCCTCTCTTTGCCTTCCCCTCTTTCTTCCTTCTACTGCTTCAGCAGACATCATGTG # > BPP(Breakpoint(1:224646893L-), Breakpoint(1:224646906R-), opposing=False, seq='') read = SamRead(reference_name='1') read.query_sequence = 'TCAGCTCTCTTAGGGCACACCCTCCAAGGTGCCTAAATGCCATCCCAGGATTGGTTCCAGTGTCTATTATCTGTTTGACTCCAAATGGCCAAACACCTGACTTCCTCTCTGGTAGCCTGGCTTTTATCTTCTAGGACATCCAGGGCCCCTCTCTTTGCCTTCCCCTCTTTCTTCCTTCTACTGCTTCAGCAGACATCATGTG' read.reference_start = 224646710 read.reference_id = 0 print(_cigar.convert_string_to_cigar('183=12D19=')) read.cigar = _cigar.join(_cigar.convert_string_to_cigar('183=12D19=')) read.query_name = 'name' read.mapping_quality = NA_MAPPING_QUALITY std_read = Evidence.standardize_read(self.mock_evidence, read) print(SamRead.__repr__(read)) print(SamRead.__repr__(std_read)) self.assertEqual(_cigar.convert_string_to_cigar('186=12D16='), std_read.cigar) self.assertEqual(read.reference_start, std_read.reference_start)
def test_bwa_mem(self): mock_evidence = MockObject( reference_genome={ '1': MockObject( seq=MockLongString( 'TGGGTATCAGACACACTGGGTAGCTGAGTGCTCAGAGGAAGATGCGAGGTATTCAGGGAAAGTGTCAGTGGGGTCTCCCAGTGCCTGTTTGGTCCACAGTTAGGAGA' 'GGCCCTGCTTGCACTTCTAATACAGTCCCGGAAAGACGGGGCCAGAACTTAGGAGGGGAGCGCTTTGCAGCAACTTTTCAAGAAAAGGGGAAAATTTAAGCACCATA' 'CTGTTATGTGGTCCTTGTACCCAGAGGCCCTGTTCAGCTCCAGTGATCAGCTCTCTTAGGGCACACCCTCCAAGGTGCCTAAATGCCATCCCAGGATTGGTTCCAGT' 'GTCTATTATCTGTTTGACTCCAAATGGCCAAACACCTGACTTCCTCTCTGGTAGCCTGGCTTTTATCTTCTAGGACATCCAGGGCCCCTCTCTTTGCCTTCCCCTCT' 'TTCTTCCTTCTACTGCTTAGATCAAGTCTTCAGCAGACATCATGTGACCTTGAGGATGGATGTCACATGCTGGAGGAAACAGAAGGCCGAAACCCTGATGACTTCAC' 'AGAGCTGCCAAAACAGTTCCTGACTGTTTATTCCGGGTCTTTAACAAAGTGATGAAAAGAAATCCTTGCAGTATGAAAACAACTTTTCTATTCCATGGAGCCAAACC' 'TCATTATAACAGATAACGTGACCCTCAGCGATATCCCAAGTATTTTCCTGTTCTCATCTATACTATGGCAAAGGGGCAAATACCTCTCAGTAAAGAAAGAAATAACA' 'ACTTCTATCTTGGGCGAGGCATTTCTTCTGTTAGAACTTTGTACACGGAATAAAATAGATCTGTTTGTGCTTATCTTTCTCCTTAGAATTATTGAATTTGAAGTCTT' 'TCCCAGGGTGGGGGTGGAGTGAAGCTGGGGTTTCATAAGCACATAGATAGTAGTG', offset=224646450, ) ) }, bam_cache=MockObject(get_read_reference_name=lambda x: x.reference_name), config={ 'validate.contig_aln_merge_inner_anchor': 10, 'validate.contig_aln_merge_outer_anchor': 20, **DEFAULTS, }, ) # SamRead(1:224646710-224646924, 183=12D19=, TCAGCTCTCT...) TCAGCTCTCTTAGGGCACACCCTCCAAGGTGCCTAAATGCCATCCCAGGATTGGTTCCAGTGTCTATTATCTGTTTGACTCCAAATGGCCAAACACCTGACTTCCTCTCTGGTAGCCTGGCTTTTATCTTCTAGGACATCCAGGGCCCCTCTCTTTGCCTTCCCCTCTTTCTTCCTTCTACTGCTTCAGCAGACATCATGTG # std SamRead(1:224646710-224646924, 183=12D19=, TCAGCTCTCT...) TCAGCTCTCTTAGGGCACACCCTCCAAGGTGCCTAAATGCCATCCCAGGATTGGTTCCAGTGTCTATTATCTGTTTGACTCCAAATGGCCAAACACCTGACTTCCTCTCTGGTAGCCTGGCTTTTATCTTCTAGGACATCCAGGGCCCCTCTCTTTGCCTTCCCCTCTTTCTTCCTTCTACTGCTTCAGCAGACATCATGTG # > BPP(Breakpoint(1:224646893L-), Breakpoint(1:224646906R-), opposing=False, seq='') read = SamRead(reference_name='1') read.query_sequence = 'TCAGCTCTCTTAGGGCACACCCTCCAAGGTGCCTAAATGCCATCCCAGGATTGGTTCCAGTGTCTATTATCTGTTTGACTCCAAATGGCCAAACACCTGACTTCCTCTCTGGTAGCCTGGCTTTTATCTTCTAGGACATCCAGGGCCCCTCTCTTTGCCTTCCCCTCTTTCTTCCTTCTACTGCTTCAGCAGACATCATGTG' read.reference_start = 224646710 read.reference_id = 0 print(_cigar.convert_string_to_cigar('183=12D19=')) read.cigar = _cigar.join(_cigar.convert_string_to_cigar('183=12D19=')) read.query_name = 'name' read.mapping_quality = NA_MAPPING_QUALITY std_read = Evidence.standardize_read(mock_evidence, read) assert std_read.cigar == _cigar.convert_string_to_cigar('186=12D16=') assert std_read.reference_start == read.reference_start
def test_left_after_transcript(self, traverse_setup): exp_pos = Evidence.traverse(2200, 100, ORIENT.LEFT) assert traverse_setup.trans_evidence.traverse(2200, 100, ORIENT.LEFT) == exp_pos
def test_left_before_transcript(self, traverse_setup): exp_pos = Evidence.traverse(900, 500 - 1, ORIENT.LEFT) assert traverse_setup.trans_evidence.traverse(900, 500 - 1, ORIENT.LEFT) == exp_pos
def test_traverse_left(self): assert Evidence.traverse(20, 10, ORIENT.LEFT) == Interval(10)
def test_traverse_right(self): assert Evidence.traverse(1, 10, ORIENT.RIGHT) == Interval(11)
def test_distance(self): assert Evidence.distance(1, 11) == Interval(10)
def test_left_after_transcript(self): exp_pos = Evidence.traverse(2200, 100, ORIENT.LEFT) self.assertEqual(exp_pos, self.trans_evidence.traverse(2200, 100, ORIENT.LEFT))
def test_left_before_transcript(self): exp_pos = Evidence.traverse(900, 500 - 1, ORIENT.LEFT) self.assertEqual( exp_pos, self.trans_evidence.traverse(900, 500 - 1, ORIENT.LEFT))
def test_traverse_left(self): self.assertEqual(Interval(10), Evidence.traverse(20, 10, ORIENT.LEFT))
def test_traverse_right(self): self.assertEqual(Interval(11), Evidence.traverse(1, 10, ORIENT.RIGHT))
def test_distance(self): self.assertEqual(Interval(10), Evidence.distance(1, 11))