chembl/chembl_webresource_client

Lookup compound by synonym - how does the code translate to chembl SQL queries ?

joetym opened this issue · 2 comments

hi,
I'm just wondering how this call translates into an SQL query(s) in the CHEMBL schema ?

from chembl_webresource_client.new_client import new_client
molecule = new_client.molecule
res = molecule.search('viagra')

I tried looking in molecule_synonyms but there seems to be some cases where I am getting results with the above, but can't find it in molecule_synonyms.

Thanks
Joe

Hi Joe,

Sorry for the late reply. This search endpoint uses elasticsearch to do a fuzzy search and try to retrieve names that might be not found due to typos.

This notebook with an example of how to translate drug names to chembl entities might be useful for you:
https://github.com/eloyfelix/chembl_multitask/blob/master/name2chembl.ipynb

molecule_dictionary.pref_name also contains names that might not be present in the synonyms table, so it's possible that elastic gets the name from there.