Esempio n. 1
0
 def test_featureMatch2(self):
     goodcsi = self.goodcsi.view(CSIDirFmt)
     tablefp = collate_fingerprint(goodcsi)
     smiles = get_feature_smiles(goodcsi, tablefp)
     fpfeatrs = set(tablefp.index)
     smlfeatrs = set(smiles.index)
     self.assertEqual(fpfeatrs == smlfeatrs, True)
Esempio n. 2
0
 def test_featureMatch1(self):
     goodcsi = self.goodcsi.view(CSIDirFmt)
     tablefp = collate_fingerprint(goodcsi)
     features = load_table(self.featureTable)
     allfeatrs = set(features.ids(axis='observation'))
     fpfeatrs = set(tablefp.index)
     self.assertEqual(fpfeatrs <= allfeatrs, True)
 def setUp(self):
     THIS_DIR = os.path.dirname(os.path.abspath(__file__))
     table = pd.DataFrame()
     self.emptyfps = table
     table = pd.DataFrame(index=['a', 'b', 'c'], data=['a', 'b', 'c'])
     self.wrongtips = table
     goodtable = os.path.join(THIS_DIR, 'data/features_formated.biom')
     self.features = load_table(goodtable)
     goodsmiles = os.path.join(THIS_DIR, 'data/features_smiles.txt')
     self.smiles = pd.read_csv(goodsmiles, dtype=str, sep='\t')
     self.smiles = self.smiles.set_index('#featureID')
     goodcsi = os.path.join(THIS_DIR, 'data/goodcsi')
     self.tablefp = collate_fingerprint(goodcsi)
Esempio n. 4
0
 def test_pubchemFalse(self):
     goodcsi = self.goodcsi.view(CSIDirFmt)
     tablefp = collate_fingerprint(goodcsi)
     indx = self.properties.index
     self.assertEqual(set(tablefp.columns) == set(indx), True)
Esempio n. 5
0
 def test_fingerprintOut(self):
     msg = "Fingerprint file is empty!"
     with self.assertRaisesRegex(ValueError, msg):
         collate_fingerprint(self.emptycsi)
 def test_pubchemTrue(self):
     goodcsi = self.goodcsi.view(CSIDirFmt)
     tablefp = collate_fingerprint(goodcsi, qc_properties=True)
     indx = self.properties.loc[self.properties.type == 'PUBCHEM'].index
     self.assertEqual(set(tablefp.columns) == set(indx), True)