Example #1
0
    def test_read_mast_output_430_1(self):
        """tests the read_mast_output_oldstyle function"""
        with open('testdata/mast430-1.out') as inputfile:
            pevalues, annotations = mast.from_430_text(
                inputfile.read(), ['VNG6198H', 'VNG0117H'])
        self.assertEqual('VNG6198H', pevalues[0][0])
        self.assertEqual('VNG0117H', pevalues[1][0])

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

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

        annot2 = list(annotations['VNG0117H'])
        self.assertAlmostEqual(2.0e-01, annot2[0][0])
        self.assertAlmostEqual(24, annot2[0][1])
        self.assertAlmostEqual(-1, annot2[0][2])
        self.assertAlmostEqual(4.9e-01, annot2[5][0])
        self.assertAlmostEqual(223, annot2[5][1])
        self.assertAlmostEqual(-2, annot2[5][2])
Example #2
0
    def test_read_mast_output_430_1(self):
        """tests the read_mast_output_oldstyle function"""
        with open('testdata/mast430-1.out') as inputfile:
            pevalues, annotations = mast.from_430_text(
                inputfile.read(), ['VNG6198H', 'VNG0117H'])
        self.assertEqual('VNG6198H', pevalues[0][0])
        self.assertEqual('VNG0117H', pevalues[1][0])

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

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

        annot2 = list(annotations['VNG0117H'])
        self.assertAlmostEqual(2.0e-01, annot2[0][0])
        self.assertAlmostEqual(24, annot2[0][1])
        self.assertAlmostEqual(-1, annot2[0][2])
        self.assertAlmostEqual(4.9e-01, annot2[5][0])
        self.assertAlmostEqual(223, annot2[5][1])
        self.assertAlmostEqual(-2, annot2[5][2])
Example #3
0
 def test_read_mast_output_430_2(self):
     """tests the read_mast_output function, this one has some
     more silly blank line placements"""
     with open('testdata/mast430-2.out') as inputfile:
         pevalues, annotations = mast.from_430_text(
             inputfile.read(), ['NP_279634.1', 'NP_279286.1'])
     self.assertTrue('NP_279634.1' in annotations)
     self.assertTrue('NP_279286.1' in annotations)
Example #4
0
 def test_read_mast_output_430_2(self):
     """tests the read_mast_output function, this one has some
     more silly blank line placements"""
     with open('testdata/mast430-2.out') as inputfile:
         pevalues, annotations = mast.from_430_text(
             inputfile.read(), ['NP_279634.1', 'NP_279286.1'])
     self.assertTrue('NP_279634.1' in annotations)
     self.assertTrue('NP_279286.1' in annotations)
Example #5
0
 def test_read_mast_output_430_4(self):
     """tests the read_mast_output function, this has on sequence/annotation block"""
     with open('testdata/mast430-4.out') as inputfile:
         pevalues, annotations = mast.from_430_text(
             inputfile.read(), ['NP_280363.1', 'NP_280692.1'])
     pev = [pevalue for pevalue in pevalues if pevalue[0] == 'NP_280363.1']
     self.assertAlmostEqual(1.0, pev[0][1])
     self.assertAlmostEqual(4.0e02, pev[0][2])
     self.assertTrue('NP_280363.1' not in annotations)
Example #6
0
 def test_read_mast_output_430_3(self):
     """tests the read_mast_output function, this one has an incomplete block"""
     with open('testdata/mast430-3.out') as inputfile:
         pevalues, annotations = mast.from_430_text(inputfile.read(),
                                                    ['NP_279608.1'])
     pev = [pevalue for pevalue in pevalues if pevalue[0] == 'NP_279608.1']
     self.assertAlmostEqual(3.9e-08, pev[0][1])
     self.assertAlmostEqual(9.61e-11, pev[0][2])
     self.assertTrue('NP_279608.1' in annotations)
Example #7
0
 def test_read_mast_output_430_4(self):
     """tests the read_mast_output function, this has on sequence/annotation block"""
     with open('testdata/mast430-4.out') as inputfile:
         pevalues, annotations = mast.from_430_text(
             inputfile.read(), ['NP_280363.1', 'NP_280692.1'])
     pev = [pevalue for pevalue in pevalues if pevalue[0] == 'NP_280363.1']
     self.assertAlmostEqual(1.0, pev[0][1])
     self.assertAlmostEqual(4.0e02, pev[0][2])
     self.assertTrue('NP_280363.1' not in annotations)
Example #8
0
 def test_read_mast_output_430_3(self):
     """tests the read_mast_output function, this one has an incomplete block"""
     with open('testdata/mast430-3.out') as inputfile:
         pevalues, annotations = mast.from_430_text(
             inputfile.read(), ['NP_279608.1'])
     pev = [pevalue for pevalue in pevalues if pevalue[0] == 'NP_279608.1']
     self.assertAlmostEqual(3.9e-08, pev[0][1])
     self.assertAlmostEqual(9.61e-11, pev[0][2])
     self.assertTrue('NP_279608.1' in annotations)
Example #9
0
 def read_mast_output(self, mast_output, genes):
     """old-style MAST output"""
     return mast_formats.from_430_text(mast_output, genes)
Example #10
0
 def read_mast_output(self, mast_output, genes):
     """old-style MAST output"""
     return mast_formats.from_430_text(mast_output, genes)