chembl / chembl_webresource_client

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

.filter for different names in "document_journal" column #114

Closed RicardoMBorges closed 2 years ago

RicardoMBorges commented 2 years ago

Hello, I'm trying to get compounds from the activity table that would match to "J. Nat. Prod." and to "J Nat Prod" but all my attempts fails..

activity.filter(target_chembl_id=selected_target).filter(standard_type="IC50").filter(document_journal="J. Nat. Prod." or "J Nat Prod") activity.filter(target_chembl_id=selected_target).filter(standard_type="IC50").filter(document_journal="J. Nat. Prod." and "J Nat Prod") ... they don't get me the filtered table with both "J. Nat. Prod." and to "J Nat Prod".

Can someone help? Thanks

eloyfelix commented 2 years ago

Hi Ricardo, this should work:

from chembl_webresource_client.new_client import new_client

activity = new_client.activity

acts = activity.filter(target_chembl_id=selected_target).filter(standard_type="IC50").filter(document_journal__in=["J. Nat. Prod.", "J Nat Prod"])