def test_minor_variant_table_builder(self):
        """
        Test the length and values of a table produced by the minor variant table builder
        """
        tb = MinorVariantTableBuilder()

        self.assertEqual('top_minor_variants_table', tb.table.id)

        columns = tb.table.columns
        self.assertEqual(7, len(columns))

        ref = self.REFERENCE
        gff = self.RARE_VARIANTS_GFF
        vf = VariantFinder(gff, ref, 100, 10000)
        v = vf.find_top()[0]

        tb.add_variant(v)
        columns = tb.table.columns
        self.assertEqual(self.CONTIG_ID, columns[0].values[0])
        self.assertEqual(35782L, columns[1].values[0])
        self.assertEqual('35782G>T', columns[2].values[0])
        self.assertEqual('SUB', columns[3].values[0])
        self.assertEqual(742, columns[4].values[0])
        self.assertEqual(7, columns[5].values[0])
        self.assertEqual(9, columns[6].values[0])
    def test_variant_table_builder(self):
        """
        Test the length and values of a table produced by the standard variant table builder
        """
        tb = VariantTableBuilder()
        columns = tb.table.columns

        self.assertEqual('top_variants_table', tb.table.id)

        self.assertEqual(7, len(columns))

        ref = self.REFERENCE
        gff = self.VARIANTS_GFF
        vf = VariantFinder(gff, ref, 100, 10000)
        top = vf.find_top()

        for v in top:
            tb.add_variant(v)

        columns = tb.table.columns

        # This tests the first row
        for i in range(7):
            self.assertEqual(self.TABLE_ROW_FIRST[i], columns[i].values[0])

        for i in range(7):
            self.assertEqual(self.TABLE_ROW_LAST[i], columns[i].values[-1])
    def test_variant_table_builder(self):
        """
        Test the length and values of a table produced by the standard variant table builder
        """
        tb = VariantTableBuilder()
        columns = tb.table.columns

        self.assertEqual('top_variants_table', tb.table.id)

        self.assertEqual(7, len(columns))

        ref = self.REFERENCE
        gff = self.VARIANTS_GFF
        vf = VariantFinder(gff, ref, 100, 10000)
        top = vf.find_top()

        for v in top:
            tb.add_variant(v)

        columns = tb.table.columns

        # This tests the first row
        for i in range(7):
            self.assertEqual(self.TABLE_ROW_FIRST[i], columns[i].values[0])

        for i in range(7):
            self.assertEqual(self.TABLE_ROW_LAST[i], columns[i].values[-1])
    def test_variant_table_builder(self):
        """
        Test the length and values of a table produced by the standard variant table builder
        """
        tb = VariantTableBuilder()
        columns = tb.table.columns

        self.assertEqual('top_variants_table', tb.table.id)

        self.assertEqual(7, len(columns))
        self.assertEqual('Sequence', columns[0].header)
        self.assertEqual('Position', columns[1].header)
        self.assertEqual('Variant', columns[2].header)
        self.assertEqual('Type', columns[3].header)
        self.assertEqual('Coverage', columns[4].header)
        self.assertEqual('Confidence', columns[5].header)
        self.assertEqual('Genotype', columns[6].header)

        ref = self.REFERENCE
        gff = self.VARIANTS_GFF
        vf = VariantFinder(gff, ref, 100, 10000)
        top = vf.find_top()

        for v in top:
            tb.add_variant(v)

        columns = tb.table.columns

        # This tests the first row
        for i in range(7):
            self.assertEqual(self.TABLE_ROW_FIRST[i], columns[i].values[0])

        for i in range(7):
            self.assertEqual(self.TABLE_ROW_LAST[i], columns[i].values[-1])
Example #5
0
    def test_minor_variant_table_builder(self):
        """
        Test the length and values of a table produced by the minor variant table builder
        """
        tb = MinorVariantTableBuilder()

        self.assertEqual('top_minor_variants_table', tb.table.id)

        columns = tb.table.columns
        self.assertEqual(7, len(columns))

        ref = self.REFERENCE
        gff = self.RARE_VARIANTS_GFF
        vf = VariantFinder(gff, ref, 100, 10000)
        v = vf.find_top()[0]

        tb.add_variant(v)
        columns = tb.table.columns
        self.assertEqual(self.CONTIG_ID, columns[0].values[0])
        self.assertEqual(35782L, columns[1].values[0])
        self.assertEqual('35782G>T', columns[2].values[0])
        self.assertEqual('SUB', columns[3].values[0])
        self.assertEqual(742, columns[4].values[0])
        self.assertEqual(7, columns[5].values[0])
        self.assertEqual(9, columns[6].values[0])
 def test_variant_finder(self):
     ref = self.REFERENCE
     gff = self.VARIANTS_GFF
     vf = VariantFinder(gff, ref, 100, 10000)
     top = vf.find_top()
     self.assertEqual(self.N_TOP_VARIANTS, len(top))
 def test_variant_finder(self):
     ref = self.REFERENCE
     gff = self.VARIANTS_GFF
     vf = VariantFinder(gff, ref, 100, 10000)
     top = vf.find_top()
     self.assertEqual(self.N_TOP_VARIANTS, len(top))