def test_mixed(self): c = [(CIGAR.EQ, 1), (CIGAR.I, 2), (CIGAR.D, 1), (CIGAR.I, 2), (CIGAR.D, 1), (CIGAR.EQ, 2)] exp = [(CIGAR.EQ, 1), (CIGAR.I, 4), (CIGAR.D, 2), (CIGAR.EQ, 2)] self.assertEqual(exp, _cigar.merge_indels(c))
def test_del_before_ins(self): c = [(CIGAR.EQ, 1), (CIGAR.D, 1), (CIGAR.I, 2), (CIGAR.EQ, 2)] exp = [(CIGAR.EQ, 1), (CIGAR.I, 2), (CIGAR.D, 1), (CIGAR.EQ, 2)] self.assertEqual(exp, _cigar.merge_indels(c))
def test_ins_before_del(self): exp = [(CIGAR.EQ, 1), (CIGAR.I, 2), (CIGAR.D, 1), (CIGAR.EQ, 2)] self.assertEqual(exp, _cigar.merge_indels(exp))
def test_no_events(self): c = [(CIGAR.EQ, 1)] self.assertEqual(c, _cigar.merge_indels(c)) c = [(CIGAR.EQ, 1), (CIGAR.X, 3), (CIGAR.EQ, 10)] self.assertEqual(c, _cigar.merge_indels(c))
def test_mixed(self): c = [(CIGAR.EQ, 1), (CIGAR.I, 2), (CIGAR.D, 1), (CIGAR.I, 2), (CIGAR.D, 1), (CIGAR.EQ, 2)] exp = [(CIGAR.EQ, 1), (CIGAR.I, 4), (CIGAR.D, 2), (CIGAR.EQ, 2)] assert _cigar.merge_indels(c) == exp
def test_ins_before_del(self): exp = [(CIGAR.EQ, 1), (CIGAR.I, 2), (CIGAR.D, 1), (CIGAR.EQ, 2)] assert _cigar.merge_indels(exp) == exp
def test_del_before_ins(self): c = [(CIGAR.EQ, 1), (CIGAR.D, 1), (CIGAR.I, 2), (CIGAR.EQ, 2)] exp = [(CIGAR.EQ, 1), (CIGAR.I, 2), (CIGAR.D, 1), (CIGAR.EQ, 2)] assert _cigar.merge_indels(c) == exp
def test_no_events(self): c = [(CIGAR.EQ, 1)] assert _cigar.merge_indels(c) == c c = [(CIGAR.EQ, 1), (CIGAR.X, 3), (CIGAR.EQ, 10)] assert _cigar.merge_indels(c) == c