comparison chembl.py @ 5:1ade252ebe08 draft

"planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 944ea4bb8a9cd4244152a4a4fecd0485fabc2ad0"
author bgruening
date Tue, 28 Jul 2020 08:20:47 -0400
parents 59eea7d0d720
children a57de37f12c2
comparison
equal deleted inserted replaced
4:59eea7d0d720 5:1ade252ebe08
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