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

How to extract all the activities measured for a protein #54

Closed wmmxk closed 5 years ago

wmmxk commented 5 years ago

I was trying to download all the measured activities for this protein (CHEMBL5455). I can download the csv file from the following link: https://www.ebi.ac.uk/chembl/g/#browse/activities/filter/target_chembl_id%3ACHEMBL5455

Is there a way to automate this in Python?

Thanks, Xiaokang

MatthewMasters commented 5 years ago

Absolutely. If you follow the examples in the README, you should be able to piece together

from chembl_webresource_client.new_client import new_client
activity = new_client.activity
result = activity.filter(target_chembl_id="CHEMBL5455")
print(result[0])
print(result[0].find("molecule_chembl_id")
wmmxk commented 5 years ago

Thanks Mathew for your reply. Oh. It is so convenient.

Best, Xiaokang

On Sat, Apr 6, 2019 at 9:41 AM Matthew Masters notifications@github.com wrote:

Absolutely. If you follow the examples in the README, you should be able to piece together

from chembl_webresource_client.new_client import new_client activity = new_client.activity result = activity.filter(target_chembl_id="CHEMBL5455") print(result[0]) print(result[0].find("molecule_chembl_id")

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chembl/chembl_webresource_client/issues/54#issuecomment-480518504, or mute the thread https://github.com/notifications/unsubscribe-auth/AKJ7dVPMSJQqVol3-16gZz6Cxzx2V0Sjks5veM4lgaJpZM4cY8UT .

-- Xiaokang Wang Biomedical Engineering Department University of California-Davis

MatthewMasters commented 5 years ago

Great! I'm glad that was helpful. Be sure to close the issue if everything is good ;)