Exemple #1
0
 def testPrintDescription(self):
     """
     Check that the print_ method of a scanned read produces the
     expected result when given a description.
     """
     read = ScannedRead(AARead('id', 'AAAAA'))
     landmark1 = Landmark('name', 'L1', 0, 2)
     landmark2 = Landmark('name', 'L2', 1, 2)
     read.landmarks.extend([landmark1, landmark2])
     trigPoint1 = TrigPoint('name', 'T1', 3)
     trigPoint2 = TrigPoint('name', 'T2', 5)
     read.trigPoints.extend([trigPoint1, trigPoint2])
     expected = ('Query: id\n'
                 '  Length: 5\n'
                 '  Covered indices: 5 (100.00%)\n'
                 '  Landmark count 2, trig point count 2')
     self.assertEqual(expected, read.print_(description='Query'))
Exemple #2
0
 def testPrintSequence(self):
     """
     Check that the print_ method of a scanned read produces the
     expected result when requested to print the sequence.
     """
     read = ScannedRead(AARead('id', 'AAAAA'))
     landmark1 = Landmark('name', 'L1', 0, 2)
     landmark2 = Landmark('name', 'L2', 1, 2)
     read.landmarks.extend([landmark1, landmark2])
     trigPoint1 = TrigPoint('name', 'T1', 3)
     trigPoint2 = TrigPoint('name', 'T2', 5)
     read.trigPoints.extend([trigPoint1, trigPoint2])
     expected = ('Read: id\n'
                 '  Sequence: AAAAA\n'
                 '  Length: 5\n'
                 '  Covered indices: 5 (100.00%)\n'
                 '  Landmark count 2, trig point count 2')
     self.assertEqual(expected, read.print_(printSequence=True))
Exemple #3
0
 def testPrintFeatures(self):
     """
     Check that the print_ method of a scanned read produces the
     expected result when asked to print the read's features.
     """
     read = ScannedRead(AARead('id', 'AAAAA'))
     landmark1 = Landmark('name', 'L1', 0, 2)
     landmark2 = Landmark('name', 'L2', 1, 2)
     read.landmarks.extend([landmark1, landmark2])
     trigPoint1 = TrigPoint('name', 'T1', 3)
     trigPoint2 = TrigPoint('name', 'T2', 5)
     read.trigPoints.extend([trigPoint1, trigPoint2])
     expected = ('Read: id\n'
                 '  Length: 5\n'
                 '  Covered indices: 5 (100.00%)\n'
                 '  Landmark count 2, trig point count 2\n'
                 "    name symbol=L1 offset=0 len=2 detail=''\n"
                 "    name symbol=L2 offset=1 len=2 detail=''\n"
                 '    name symbol=T1 offset=3\n'
                 '    name symbol=T2 offset=5')
     self.assertEqual(expected, read.print_(printFeatures=True))