示例#1
0
 def test_parsing(self):
     """make sure that the bowtie output file is parsed properly"""
     parser = BowtieOutputParser(fname)
     header = next(parser)
     index = 0
     for row in parser:
         self.assertEqual(row, expected[index])
         index += 1
示例#2
0
    def test_no_row_converter(self):
        """setting row_converter=None returns strings"""
        # straight parser
        parser = BowtieOutputParser(fname, row_converter=None)
        header = next(parser)
        for index, row in enumerate(parser):
            query_offset = row[3]
            other_matches = row[6]
            self.assertEqual(query_offset, str(expected[index][3]))
            self.assertEqual(other_matches, str(expected[index][6]))

        # table
        table = BowtieToTable(fname, row_converter=None)
        for index, row in enumerate(table):
            query_offset = row['Offset']
            other_matches = row['Other Matches']
            self.assertEqual(query_offset, str(expected[index][3]))
            self.assertEqual(other_matches, str(expected[index][6]))