Exemple #1
0
    def test_read_mast_output_oldstyle(self):
        """tests the read_mast_output function"""
        with open('testdata/mast.out') as inputfile:
            pevalues, annotations = meme.read_mast_output_oldstyle(
                inputfile.read(), ['VNG6198H', 'VNG0117H'])
        self.assertEquals('VNG6198H', pevalues[0][0])
        self.assertEquals('VNG0117H', pevalues[1][0])

        self.assertAlmostEquals(1.98e-14, pevalues[0][1])
        self.assertAlmostEquals(3.39e-12, pevalues[1][1])
        self.assertAlmostEquals(8.0e-12, pevalues[0][2])
        self.assertAlmostEquals(1.4e-09, pevalues[1][2])

        annot1 = list(annotations['VNG6198H'])
        self.assertAlmostEquals(6.6e-01, annot1[0][0])
        self.assertEquals(16, annot1[0][1])
        self.assertEquals(1, annot1[0][2])

        annot2 = list(annotations['VNG0117H'])
        self.assertAlmostEquals(2.0e-01, annot2[0][0])
        self.assertAlmostEquals(24, annot2[0][1])
        self.assertAlmostEquals(-1, annot2[0][2])
        self.assertAlmostEquals(4.9e-01, annot2[5][0])
        self.assertAlmostEquals(223, annot2[5][1])
        self.assertAlmostEquals(-2, annot2[5][2])
Exemple #2
0
 def test_read_mast_output_oldstyle2(self):
     """tests the read_mast_output function, this one has some
     more silly blank line placements"""
     with open("testdata/mast2.out") as inputfile:
         pevalues, annotations = meme.read_mast_output_oldstyle(inputfile.read(), ["NP_279634.1", "NP_279286.1"])
     self.assertTrue("NP_279634.1" in annotations)
     self.assertTrue("NP_279286.1" in annotations)
Exemple #3
0
 def test_read_mast_output_oldstyle2(self):
     """tests the read_mast_output function, this one has some
     more silly blank line placements"""
     with open('testdata/mast2.out') as inputfile:
         pevalues, annotations = meme.read_mast_output_oldstyle(
             inputfile.read(), ['NP_279634.1', 'NP_279286.1'])
     self.assertTrue('NP_279634.1' in annotations)
     self.assertTrue('NP_279286.1' in annotations)
Exemple #4
0
 def test_read_mast_output_oldstyle4(self):
     """tests the read_mast_output function, this has on sequence/annotation block"""
     with open("testdata/mast4.out") as inputfile:
         pevalues, annotations = meme.read_mast_output_oldstyle(inputfile.read(), ["NP_280363.1", "NP_280692.1"])
     pev = [pevalue for pevalue in pevalues if pevalue[0] == "NP_280363.1"]
     self.assertAlmostEquals(1.0, pev[0][1])
     self.assertAlmostEquals(4.0e02, pev[0][2])
     self.assertTrue("NP_280363.1" not in annotations)
Exemple #5
0
 def test_read_mast_output_oldstyle3(self):
     """tests the read_mast_output function, this one has an incomplete block"""
     with open("testdata/mast3.out") as inputfile:
         pevalues, annotations = meme.read_mast_output_oldstyle(inputfile.read(), ["NP_279608.1"])
     pev = [pevalue for pevalue in pevalues if pevalue[0] == "NP_279608.1"]
     self.assertAlmostEquals(3.9e-08, pev[0][1])
     self.assertAlmostEquals(9.61e-11, pev[0][2])
     self.assertTrue("NP_279608.1" in annotations)
Exemple #6
0
 def test_read_mast_output_oldstyle4(self):
     """tests the read_mast_output function, this has on sequence/annotation block"""
     with open('testdata/mast4.out') as inputfile:
         pevalues, annotations = meme.read_mast_output_oldstyle(
             inputfile.read(), ['NP_280363.1', 'NP_280692.1'])
     pev = [pevalue for pevalue in pevalues if pevalue[0] == 'NP_280363.1']
     self.assertAlmostEquals(1.0, pev[0][1])
     self.assertAlmostEquals(4.0e02, pev[0][2])
     self.assertTrue('NP_280363.1' not in annotations)
Exemple #7
0
 def test_read_mast_output_oldstyle3(self):
     """tests the read_mast_output function, this one has an incomplete block"""
     with open('testdata/mast3.out') as inputfile:
         pevalues, annotations = meme.read_mast_output_oldstyle(
             inputfile.read(), ['NP_279608.1'])
     pev = [pevalue for pevalue in pevalues if pevalue[0] == 'NP_279608.1']
     self.assertAlmostEquals(3.9e-08, pev[0][1])
     self.assertAlmostEquals(9.61e-11, pev[0][2])
     self.assertTrue('NP_279608.1' in annotations)
Exemple #8
0
    def test_read_mast_output_oldstyle(self):
        """tests the read_mast_output function"""
        with open("testdata/mast.out") as inputfile:
            pevalues, annotations = meme.read_mast_output_oldstyle(inputfile.read(), ["VNG6198H", "VNG0117H"])
        self.assertEquals("VNG6198H", pevalues[0][0])
        self.assertEquals("VNG0117H", pevalues[1][0])

        self.assertAlmostEquals(1.98e-14, pevalues[0][1])
        self.assertAlmostEquals(3.39e-12, pevalues[1][1])
        self.assertAlmostEquals(8.0e-12, pevalues[0][2])
        self.assertAlmostEquals(1.4e-09, pevalues[1][2])

        annot1 = list(annotations["VNG6198H"])
        self.assertAlmostEquals(6.6e-01, annot1[0][0])
        self.assertEquals(16, annot1[0][1])
        self.assertEquals(1, annot1[0][2])

        annot2 = list(annotations["VNG0117H"])
        self.assertAlmostEquals(2.0e-01, annot2[0][0])
        self.assertAlmostEquals(24, annot2[0][1])
        self.assertAlmostEquals(-1, annot2[0][2])
        self.assertAlmostEquals(4.9e-01, annot2[5][0])
        self.assertAlmostEquals(223, annot2[5][1])
        self.assertAlmostEquals(-2, annot2[5][2])