Beispiel #1
0
 def test_path_fingerprint(self):
     mol = helium.Molecule()
     fp = helium.path_fingerprint(mol)
     fp = helium.path_fingerprint(mol, 7)
     fp = helium.path_fingerprint(mol, 7, 16)
     fp = helium.path_fingerprint(mol, 7, 16, 1021)
     self.assertEqual(16, fp.numWords)
Beispiel #2
0
 def test_path_fingerprint(self):
     mol = helium.Molecule()
     fp = helium.path_fingerprint(mol)
     fp = helium.path_fingerprint(mol, 7)
     fp = helium.path_fingerprint(mol, 7, 16)
     fp = helium.path_fingerprint(mol, 7, 16, 1021)
     self.assertEqual(16, fp.numWords)
Beispiel #3
0
    def test_brute_force_similarity_search(self):
        storage = helium.InMemoryRowMajorFingerprintStorage()
        storage.load(self.datadir + '/1K_fp_path_7_1024_row.hel')

        mol = helium.Molecule()
        self.assertTrue(SMILES.read('c1ccccc1', mol))
        query = helium.path_fingerprint(mol)

        similar = helium.brute_force_similarity_search(query, storage, 0.8)
        self.assertTrue(isinstance(similar, list))
        self.assertEqual(1, len(similar))
        self.assertTrue(isinstance(similar[0], tuple))
        i, tanimoto = similar[0]
        self.assertEqual(227, i)
        self.assertTrue(tanimoto > 0.8)
Beispiel #4
0
    def test_brute_force_similarity_search(self):
        storage = helium.InMemoryRowMajorFingerprintStorage()
        storage.load(self.datadir + '/1K_fp_path_7_1024_row.hel')

        mol = helium.Molecule()
        self.assertTrue(SMILES.read('c1ccccc1', mol))
        query = helium.path_fingerprint(mol)

        similar = helium.brute_force_similarity_search(query, storage, 0.8)
        self.assertTrue(isinstance(similar, list))
        self.assertEqual(1, len(similar))
        self.assertTrue(isinstance(similar[0], tuple))
        i, tanimoto = similar[0]
        self.assertEqual(227, i)
        self.assertTrue(tanimoto > 0.8)