Example #1
0
 def test_insert(self):
     self.assertEqual(
         ([(CIGAR.S, 17), (CIGAR.M, 10), (CIGAR.S, 5)], 2),
         _cigar.extend_softclipping([(CIGAR.S, 10), (CIGAR.M, 2),
                                     (CIGAR.I, 5), (CIGAR.M, 10),
                                     (CIGAR.I, 5)], 5),
     )
Example #2
0
 def test_hardclipping_right(self):
     c = [(CIGAR.EQ, 30), (CIGAR.H, 120)]
     cnew, prefix = _cigar.extend_softclipping(c, 6)
     self.assertEqual(0, prefix)
     self.assertEqual(c, cnew)
Example #3
0
 def test_mismatch(self):
     with self.assertRaises(AttributeError):
         _cigar.extend_softclipping([(CIGAR.X, 10), (CIGAR.M, 20),
                                     (CIGAR.X, 10)], 30)
Example #4
0
 def test_deletions(self):
     self.assertEqual(
         ([(CIGAR.S, 10), (CIGAR.M, 10)], 1),
         _cigar.extend_softclipping([(CIGAR.I, 10), (CIGAR.D, 1),
                                     (CIGAR.M, 10)], 1))
Example #5
0
 def test_simple(self):
     self.assertEqual(([(CIGAR.S, 10), (CIGAR.M, 10)], 0),
                      _cigar.extend_softclipping([(CIGAR.S, 10),
                                                  (CIGAR.M, 10)], 1))
Example #6
0
 def test_softclipped_right(self):
     c = convert_string_to_cigar(
         '70=2X1=8X4=1X1=4X1=6X1=4X1=4X2=5X3=3X1=4X1=3X1=14X1=1X2=1S')
     cnew, prefix = extend_softclipping(c, 6)
     self.assertEqual(0, prefix)
     self.assertEqual(convert_string_to_cigar('70=80S'), cnew)
Example #7
0
 def test_hardclipping_right(self):
     c = [(CIGAR.EQ, 30), (CIGAR.H, 120)]
     cnew, prefix = _cigar.extend_softclipping(c, 6)
     assert prefix == 0
     assert cnew == c
Example #8
0
 def test_hardclipping(self):
     c = [(CIGAR.H, 10), (CIGAR.EQ, 10)]
     cnew, prefix = _cigar.extend_softclipping(c, 1)
     assert prefix == 0
     assert cnew == c
Example #9
0
 def test_insert(self):
     assert _cigar.extend_softclipping(
         [(CIGAR.S, 10), (CIGAR.M, 2), (CIGAR.I, 5), (CIGAR.M, 10), (CIGAR.I, 5)], 5
     ) == ([(CIGAR.S, 17), (CIGAR.M, 10), (CIGAR.S, 5)], 2)
Example #10
0
 def test_deletions(self):
     assert _cigar.extend_softclipping([(CIGAR.I, 10), (CIGAR.D, 1), (CIGAR.M, 10)], 1) == (
         [(CIGAR.S, 10), (CIGAR.M, 10)],
         1,
     )
Example #11
0
 def test_simple(self):
     assert _cigar.extend_softclipping([(CIGAR.S, 10), (CIGAR.M, 10)], 1) == (
         [(CIGAR.S, 10), (CIGAR.M, 10)],
         0,
     )
Example #12
0
 def test_softclipped_right(self):
     c = convert_string_to_cigar(
         '70=2X1=8X4=1X1=4X1=6X1=4X1=4X2=5X3=3X1=4X1=3X1=14X1=1X2=1S')
     cnew, prefix = extend_softclipping(c, 6)
     assert prefix == 0
     assert cnew == convert_string_to_cigar('70=80S')