chembl / chembl_webresource_client

Official Python client for accessing ChEMBL API
https://www.ebi.ac.uk/chembl/api/data/docs
Other
368 stars 95 forks source link

Querying molecules by common name depend on capitalization. #37

Closed sorenwacker closed 3 months ago

sorenwacker commented 6 years ago
from chembl_webresource_client.new_client import new_client as cwc
cwc.molecule.search('viagra')
[{'atc_classifications': [], 'availability_type': '1', 'biotherapeutic': None, 'black_box_warning': '1', 'chebi_par_id': 58987, 'chirality': '2', 'cross_references': [{'xref_id': 'sildenafil%20citrate', 'xref_name': 'sildenafil citrate', 'xref_src': 'DailyMed'}, {'xref_id': '144205270', 'xref_name': 'SID: 144205270', 'xref_src': 'PubChem'}, {'xref_id': '170465285', 'xref_name': 'SID: 170465285', 'xref_src': 'PubChem'}, {'xref_id': 'Sildenafil', 'xref_name': None, 'xref_src': 'Wikipedia'}], 'dosed_ingredient': True, 'first_approval': 1998, 'first_in_class': '0', 'helm_notation': None, 'indication_class': 'Impotence Therapy', 'inorganic_flag': '0', 'max_phase': 4, 'molecule_chembl_id': 'CHEMBL1737', 'molecule_hierarchy': {'molecule_chembl_id': 'CHEMBL1737', 'parent_chembl_id': 'CHEMBL192'}, 'molecule_properties': {'acd_logd': '2.45', 'acd_logp': '2.47', 'acd_most_apka': '10.05', 'acd_most_bpka': '6.03', 'alogp': '1.61', 'aromatic_rings': 3, 'full_molformula': 'C28H38N6O11S', 'full_mwt': '666.71', 'hba': 8, 'hba_lipinski': 10, 'hbd': 1, 'hbd_lipinski': 1, 'heavy_atoms': 33, 'molecular_species': 'NEUTRAL', 'mw_freebase': '474.59', 'mw_monoisotopic': '474.2049', 'num_lipinski_ro5_violations': 0, 'num_ro5_violations': 0, 'psa': '113.42', 'qed_weighted': '0.55', 'ro3_pass': 'N', 'rtb': 7}, 'molecule_structures': {'canonical_smiles': 'CCCc1nn(C)c2C(=O)NC(=Nc12)c3cc(ccc3OCC)S(=O)(=O)N4CCN(C)CC4.OC(=O)CC(O)(CC(=O)O)C(=O)O', 'standard_inchi': 'InChI=1S/C22H30N6O4S.C6H8O7/c1-5-7-17-19-20(27(4)25-17)22(29)24-21(23-19)16-14-15(8-9-18(16)32-6-2)33(30,31)28-12-10-26(3)11-13-28;7-3(8)1-6(13,5(11)12)2-4(9)10/h8-9,14H,5-7,10-13H2,1-4H3,(H,23,24,29);13H,1-2H2,(H,7,8)(H,9,10)(H,11,12)', 'standard_inchi_key': 'DEIYFTQMQPDXOT-UHFFFAOYSA-N'}, 'molecule_synonyms': [{'molecule_synonym': 'Revatio', 'syn_type': 'TRADE_NAME', 'synonyms': 'REVATIO'}, {'molecule_synonym': 'Sildenafil Citrate', 'syn_type': 'FDA', 'synonyms': 'SILDENAFIL CITRATE'}, {'molecule_synonym': 'Sildenafil Citrate', 'syn_type': 'OTHER', 'synonyms': 'SILDENAFIL CITRATE'}, {'molecule_synonym': 'Sildenafil Citrate', 'syn_type': 'TRADE_NAME', 'synonyms': 'SILDENAFIL CITRATE'}, {'molecule_synonym': 'Sildenafil Citrate', 'syn_type': 'USAN', 'synonyms': 'SILDENAFIL CITRATE'}, {'molecule_synonym': 'UK-9248010', 'syn_type': 'RESEARCH_CODE', 'synonyms': 'UK-92,480-10'}, {'molecule_synonym': 'UK-92480-10', 'syn_type': 'RESEARCH_CODE', 'synonyms': 'UK-92480-10'}, {'molecule_synonym': 'Viagra', 'syn_type': 'TRADE_NAME', 'synonyms': 'VIAGRA'}], 'molecule_type': 'Small molecule', 'natural_product': '0', 'oral': True, 'parenteral': True, 'polymer_flag': False, 'pref_name': 'SILDENAFIL CITRATE', 'prodrug': '0', 'score': 1.8465444, 'structure_type': 'MOL', 'therapeutic_flag': True, 'topical': False, 'usan_stem': '-afil', 'usan_stem_definition': 'PDE5 inhibitors', 'usan_substem': '-afil', 'usan_year': 1997, 'withdrawn_class': None, 'withdrawn_country': None, 'withdrawn_flag': False, 'withdrawn_reason': None, 'withdrawn_year': None}, {'atc_classifications': ['G04BE03'], 'availability_type': '1', 'biotherapeutic': None, 'black_box_warning': '1', 'chebi_par_id': 9139, 'chirality': '2', 'cross_references': [{'xref_id': 'sildenafil%20citrate', 'xref_name': 'sildenafil citrate', 'xref_src': 'DailyMed'}, {'xref_id': '26748898', 'xref_name': 'SID: 26748898', 'xref_src': 'PubChem'}, {'xref_id': '50085897', 'xref_name': 'SID: 50085897', 'xref_src': 'PubChem'}], 'dosed_ingredient': True, 'first_approval': 1998, 'first_in_class': '0', 'helm_notation': None, 'indication_class': 'Impotence Therapy', 'inorganic_flag': '0', 'max_phase': 4, 'molecule_chembl_id': 'CHEMBL192', 'molecule_hierarchy': {'molecule_chembl_id': 'CHEMBL192', 'parent_chembl_id': 'CHEMBL192'}, 'molecule_properties': {'acd_logd': '2.45', 'acd_logp': '2.47', 'acd_most_apka': '10.05', 'acd_most_bpka': '6.03', 'alogp': '1.61', 'aromatic_rings': 3, 'full_molformula': 'C22H30N6O4S', 'full_mwt': '474.59', 'hba': 8, 'hba_lipinski': 10, 'hbd': 1, 'hbd_lipinski': 1, 'heavy_atoms': 33, 'molecular_species': 'NEUTRAL', 'mw_freebase': '474.59', 'mw_monoisotopic': '474.2049', 'num_lipinski_ro5_violations': 0, 'num_ro5_violations': 0, 'psa': '113.42', 'qed_weighted': '0.55', 'ro3_pass': 'N', 'rtb': 7}, 'molecule_structures': {'canonical_smiles': 'CCCc1nn(C)c2C(=O)NC(=Nc12)c3cc(ccc3OCC)S(=O)(=O)N4CCN(C)CC4', 'standard_inchi': 'InChI=1S/C22H30N6O4S/c1-5-7-17-19-20(27(4)25-17)22(29)24-21(23-19)16-14-15(8-9-18(16)32-6-2)33(30,31)28-12-10-26(3)11-13-28/h8-9,14H,5-7,10-13H2,1-4H3,(H,23,24,29)', 'standard_inchi_key': 'BNRNXUUZRGQAQC-UHFFFAOYSA-N'}, 'molecule_synonyms': [{'molecule_synonym': 'Nipatra', 'syn_type': 'TRADE_NAME', 'synonyms': 'NIPATRA'}, {'molecule_synonym': 'Revatio', 'syn_type': 'TRADE_NAME', 'synonyms': 'REVATIO'}, {'molecule_synonym': 'Sildenafil', 'syn_type': 'ATC', 'synonyms': 'SILDENAFIL'}, {'molecule_synonym': 'Sildenafil', 'syn_type': 'BAN', 'synonyms': 'SILDENAFIL'}, {'molecule_synonym': 'Sildenafil', 'syn_type': 'BNF', 'synonyms': 'SILDENAFIL'}, {'molecule_synonym': 'Sildenafil', 'syn_type': 'INN', 'synonyms': 'SILDENAFIL'}, {'molecule_synonym': 'Sildenafil', 'syn_type': 'FDA', 'synonyms': 'Sildenafil'}, {'molecule_synonym': 'UK-92480', 'syn_type': 'RESEARCH_CODE', 'synonyms': 'UK-92480'}, {'molecule_synonym': 'Viagra', 'syn_type': 'TRADE_NAME', 'synonyms': 'VIAGRA'}, {'molecule_synonym': 'Vizarsin', 'syn_type': 'TRADE_NAME', 'synonyms': 'VIZARSIN'}], 'molecule_type': 'Small molecule', 'natural_product': '0', 'oral': True, 'parenteral': True, 'polymer_flag': False, 'pref_name': 'SILDENAFIL', 'prodrug': '0', 'score': 0.25654137, 'structure_type': 'MOL', 'therapeutic_flag': True, 'topical': False, 'usan_stem': '-afil', 'usan_stem_definition': 'PDE5 inhibitors', 'usan_substem': '-afil', 'usan_year': 1997, 'withdrawn_class': None, 'withdrawn_country': None, 'withdrawn_flag': False, 'withdrawn_reason': None, 'withdrawn_year': None}]

while

cwc.molecule.search('Viagra')
[]

The query should not depend on capitalization, I think.