Ejemplo n.º 1
0
 def test_matchFdata(self):
     relabeled_fps, matched_ft, matched_fdata = get_matched_tables(
         self.tablefp, self.smiles, self.features)
     fdata_featrs = sorted(list(matched_fdata.index))
     fdata_cols = sorted(list(matched_fdata.columns))
     featrs = sorted(list(matched_ft.ids(axis='observation')))
     self.assertEqual(fdata_featrs, featrs)
     self.assertEqual(fdata_cols, sorted(['#featureID', 'csi_smiles',
                                          'ms2_smiles', 'ms2_library_match',
                                          'ms2_adduct']))
Ejemplo n.º 2
0
 def test_matchFps(self):
     relabeled_fps, matched_ft, matched_fdata = get_matched_tables(
         self.tablefp, self.smiles, self.features)
     featrs = sorted(list(matched_ft.ids(axis='observation')))
     fps = sorted(list(relabeled_fps.index))
     self.assertEqual(fps, featrs)
Ejemplo n.º 3
0
 def test_tipMismatch(self):
     msg = "^The following fingerprints were not found"
     with self.assertWarnsRegex(UserWarning, msg):
         get_matched_tables(self.wrongtips, self.smiles, self.features)
Ejemplo n.º 4
0
 def test_emptyTable(self):
     msg = "Cannot have empty fingerprint table"
     with self.assertRaisesRegex(ValueError, msg):
         get_matched_tables(self.emptyfps, self.smiles, self.features)
Ejemplo n.º 5
0
 def test_tipMismatch(self):
     msg = "^The following tips were not found in the feature table:"
     with self.assertRaisesRegex(ValueError, msg):
         get_matched_tables(self.wrongtips, self.smiles, self.features)