Пример #1
0
 def test_reframe(self):
     '''Move bases around gaps to improve translation'''
     read1 = 'GAAGCG---ACTACT'  # Already in frame
     assert LS.reframe(read1, 3) == read1
     read2 = 'GAAGC---GACTACT'  # Move one base <--
     assert LS.reframe(read2, 3) == read1
     read3 = 'GAAGCGA---CTACT'  # Move one base -->
     assert LS.reframe(read3, 3) == read1, LS.reframe(read3, 3)
Пример #2
0
 def test_find_frame(self):
     '''As in the name. Frame is 1 based'''
     read = 'GTCGTCGTCCCATGTGTAAAATTAACCCCACTCTGTGTTAGTTTAAAGTGCACTGATTT'
     assert LS.find_frame(read) == 1, read
     read = 'AGTCGTCGTCCCATGTGTAAAATTAACCCCACTCTGTGTTAGTTTAAAGTGCACTGATTT'
     assert LS.find_frame(read) == 2, read
     read = 'TCGTCGTCCCATGTGTAAAATTAACCCCACTCTGTGTTAGTTTAAAGTGCACTGATTT'
     assert LS.find_frame(read) == 3, read
Пример #3
0
 def test_gap_translation(self):
     '''Translation with gaps, frame dependent'''
     assert LS.gap_translation('AAG') == 'K'
     assert LS.gap_translation('AAG---') == 'K-'
     assert LS.gap_translation('AAGAA') == 'K'
     assert LS.gap_translation('CAAGA', frame=2) == 'K'