Example #1
0
 def test_classyfire_output(self):
     classified = get_classyfire_taxonomy(self.smiles)
     classified_mols = classified[classified['kingdom'] != 'unclassified']
     self.assertTrue(pd.isna(classified_mols).shape, 0)
     self.assertTrue(classified_mols.loc['b',
                                         'kingdom'] == 'Organic compounds')
     self.assertTrue((self.levels.issubset(set(classified.columns))))
Example #2
0
 def test_nan_smiles(self):
     msg = ("The feature data table should have at least one structural "
            "annotation to run Classyfire")
     with self.assertRaisesRegex(ValueError, msg):
         get_classyfire_taxonomy(self.nan_smiles)
Example #3
0
 def test_malformed_smiles(self):
     msg = "The following structures"
     with self.assertWarnsRegex(UserWarning, msg):
         get_classyfire_taxonomy(self.mal_smiles)
Example #4
0
 def test_no_smiles(self):
     msg = ('Feature data table must contain the columns `csi_smiles` '
            'and `ms2_smiles` to run Classyfire')
     with self.assertRaisesRegex(ValueError, msg):
         get_classyfire_taxonomy(self.no_smiles)