comparison chembl.py @ 5:e907c14ea4be draft

"planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 944ea4bb8a9cd4244152a4a4fecd0485fabc2ad0"
author bgruening
date Tue, 28 Jul 2020 11:54:13 +0000
parents 6aa23d7ae03b
children 9dbc85cd5780
comparison
equal deleted inserted replaced
4:6aa23d7ae03b 5:e907c14ea4be
11 """ 11 """
12 Get a list of SMILES from function results 12 Get a list of SMILES from function results
13 """ 13 """
14 smiles = set() 14 smiles = set()
15 for smi in res: 15 for smi in res:
16 smiles.add('{}\t{}'.format(smi['molecule_structures']['canonical_smiles'], smi['molecule_chembl_id'])) 16 try:
17 smiles.add('{}\t{}'.format(smi['molecule_structures']['canonical_smiles'], smi['molecule_chembl_id']))
18 except TypeError:
19 continue
17 return smiles 20 return smiles
18 21
19 def sim_search(smiles, tanimoto): 22 def sim_search(smiles, tanimoto):
20 """ 23 """
21 Return compounds which are within a Tanimoto range of the SMILES input 24 Return compounds which are within a Tanimoto range of the SMILES input