Exemplo n.º 1
0
 def test_modify_insertions(self):
     x = assembly.MutableSequence('chr', 5, 8, 'ATCG')
     x.modify(6, 'insert')
     self.assertEqual(x.emit(), ('chr', 'AinsertCG'))
     x.modify(8, 'tail')
     self.assertEqual(x.emit(), ('chr', 'AinsertCtail'))
     x.modify(5, 'headA')
     self.assertEqual(x.emit(), ('chr', 'headAinsertCtail'))
Exemplo n.º 2
0
 def test_modify_deletions_remember(self):
     x = assembly.MutableSequence('chr', 5, 8, 'ATCG')
     x.replace(6, 7, 'T')
     self.assertEqual(x.emit(), ('chr', 'ATG'))
     x.modify(7, 'x')
     self.assertEqual(x.emit(), ('chr', 'ATxG'))
     x.replay_deletions()
     self.assertEqual(x.emit(), ('chr', 'ATG'))
Exemplo n.º 3
0
 def test_good_coords(self):
     x = assembly.MutableSequence('chr', 1, 5)
     x = assembly.MutableSequence('chr', 5, 5)
     x = assembly.MutableSequence('chr', 100, 2000)
     x = assembly.MutableSequence('chr name with spaces 5 @#$ --', 1, 5)
     x = assembly.MutableSequence('chr', 5, 5, 'A')
     x = assembly.MutableSequence('chr', 5, 6, 'AT')
Exemplo n.º 4
0
 def test_modify_deletions(self):
     x = assembly.MutableSequence('chr', 5, 8, 'ATCG')
     self.assertRaises(Exception, x.replace, 6, 9, 'AT')
     x.replace(6, 7, 'CT')
     self.assertEqual(x.emit(), ('chr', 'ACTG'))
     x.replace(6, 7, '')
     self.assertEqual(x.emit(), ('chr', 'AG'))
     x.modify(7, 'x')
     self.assertEqual(x.emit(), ('chr', 'AxG'))
     x.modify(6, 'y')
     self.assertEqual(x.emit(), ('chr', 'AyxG'))
     x.replace(7, 7, '123')
     self.assertEqual(x.emit(), ('chr', 'Ay123G'))
     x.modify(7, 'z')
     self.assertEqual(x.emit(), ('chr', 'AyzG'))
Exemplo n.º 5
0
 def test_modify_one(self):
     x = assembly.MutableSequence('chr', 5, 8, 'ATCG')
     self.assertRaises(Exception, x.modify, 4, 'G')
     self.assertRaises(Exception, x.modify, 9, 'G')
     self.assertEqual(x.emit(), ('chr', 'ATCG'))
     x.modify(5, 'G')
     self.assertEqual(x.emit(), ('chr', 'GTCG'))
     x.modify(6, 'G')
     self.assertEqual(x.emit(), ('chr', 'GGCG'))
     x.modify(7, 'G')
     self.assertEqual(x.emit(), ('chr', 'GGGG'))
     x.modify(8, 'G')
     self.assertEqual(x.emit(), ('chr', 'GGGG'))
     x.modify(6, 'j')
     self.assertEqual(x.emit(), ('chr', 'GjGG'))
     x.modify(8, 'Y')
     self.assertEqual(x.emit(), ('chr', 'GjGY'))
Exemplo n.º 6
0
 def test_modify_deletions_simple(self):
     x = assembly.MutableSequence('chr', 5, 8, 'ATCG')
     x.replace(6, 7, 'T')
     self.assertEqual(x.emit(), ('chr', 'ATG'))
Exemplo n.º 7
0
 def test_modify_blank(self):
     x = assembly.MutableSequence('chr', 5, 8)
     self.assertEqual(x.emit(), ('chr', 'NNNN'))
     x.modify(6, 'G')
     self.assertEqual(x.emit(), ('chr', 'NGNN'))