def test_cigarOpCtors(self): c1 = PacBioBam.CigarOperation('S', 10) c2 = PacBioBam.CigarOperation(PacBioBam.SOFT_CLIP, 10) self.assertEqual('S', c1.Char()) self.assertEqual('S', c2.Char()) self.assertEqual(PacBioBam.SOFT_CLIP, c1.Type()) self.assertEqual(PacBioBam.SOFT_CLIP, c2.Type()) self.assertEqual(10, c1.Length()) self.assertEqual(10, c2.Length())
def test_setChar(self): m = PacBioBam.CigarOperation() i = PacBioBam.CigarOperation() d = PacBioBam.CigarOperation() n = PacBioBam.CigarOperation() s = PacBioBam.CigarOperation() h = PacBioBam.CigarOperation() p = PacBioBam.CigarOperation() e = PacBioBam.CigarOperation() x = PacBioBam.CigarOperation() m.Char('M') i.Char('I') d.Char('D') n.Char('N') s.Char('S') h.Char('H') p.Char('P') e.Char('=') x.Char('X') self.assertEqual(PacBioBam.ALIGNMENT_MATCH, m.Type()) self.assertEqual(PacBioBam.INSERTION, i.Type()) self.assertEqual(PacBioBam.DELETION, d.Type()) self.assertEqual(PacBioBam.REFERENCE_SKIP, n.Type()) self.assertEqual(PacBioBam.SOFT_CLIP, s.Type()) self.assertEqual(PacBioBam.HARD_CLIP, h.Type()) self.assertEqual(PacBioBam.PADDING, p.Type()) self.assertEqual(PacBioBam.SEQUENCE_MATCH, e.Type()) self.assertEqual(PacBioBam.SEQUENCE_MISMATCH, x.Type())
def test_setType(self): m = PacBioBam.CigarOperation() i = PacBioBam.CigarOperation() d = PacBioBam.CigarOperation() n = PacBioBam.CigarOperation() s = PacBioBam.CigarOperation() h = PacBioBam.CigarOperation() p = PacBioBam.CigarOperation() e = PacBioBam.CigarOperation() x = PacBioBam.CigarOperation() m.Type(PacBioBam.ALIGNMENT_MATCH) i.Type(PacBioBam.INSERTION) d.Type(PacBioBam.DELETION) n.Type(PacBioBam.REFERENCE_SKIP) s.Type(PacBioBam.SOFT_CLIP) h.Type(PacBioBam.HARD_CLIP) p.Type(PacBioBam.PADDING) e.Type(PacBioBam.SEQUENCE_MATCH) x.Type(PacBioBam.SEQUENCE_MISMATCH) self.assertEqual('M', m.Char()) self.assertEqual('I', i.Char()) self.assertEqual('D', d.Char()) self.assertEqual('N', n.Char()) self.assertEqual('S', s.Char()) self.assertEqual('H', h.Char()) self.assertEqual('P', p.Char()) self.assertEqual('=', e.Char()) self.assertEqual('X', x.Char())
def test_toString(self): singleCigarString = "100=" multiCigarString = "100=2D34I6=6X6=" singleCigar = PacBioBam.Cigar() singleCigar.append( PacBioBam.CigarOperation(PacBioBam.SEQUENCE_MATCH, 100)) multiCigar = PacBioBam.Cigar() multiCigar.append( PacBioBam.CigarOperation(PacBioBam.SEQUENCE_MATCH, 100)) multiCigar.append(PacBioBam.CigarOperation(PacBioBam.DELETION, 2)) multiCigar.append(PacBioBam.CigarOperation(PacBioBam.INSERTION, 34)) multiCigar.append(PacBioBam.CigarOperation(PacBioBam.SEQUENCE_MATCH, 6)) multiCigar.append( PacBioBam.CigarOperation(PacBioBam.SEQUENCE_MISMATCH, 6)) multiCigar.append(PacBioBam.CigarOperation(PacBioBam.SEQUENCE_MATCH, 6)) self.assertEqual(singleCigarString, singleCigar.ToStdString()) self.assertEqual(multiCigarString, multiCigar.ToStdString())