Comments (3)
Unfortunately, when an unknown parameter/filter is included in the query it is ignored. In this case drug_chembl_id
is not a property present in the mechanism endpoint (https://www.ebi.ac.uk/chembl/api/data/mechanism.json), and for that reason you are retrieving all the records from it instead of the ones related with CHEMBL269732. You should use the property parent_molecule_chembl_id
instead.
from chembl_webresource_client.new_client import new_client
mechanism_res = new_client.mechanism.filter(parent_molecule_chembl_id="CHEMBL269732")
mechanism_ids = {x["target_chembl_id"] for x in tqdm(mechanism_res)}
len(mechanism_ids)
I hope this helps, we are considering including an error message that lets you know that an unknown filter is being used.
from chembl_webresource_client.
Thanks for your help!
However, I encountered another related problem - when I try to search for targets of a compound I get an empty list even though on the website it shows 325 targets:
target_res = new_client.target.filter(target_chembl_id="CHEMBL269732")
print(target_res)
and target_chembl_id
is present at https://www.ebi.ac.uk/chembl/api/data/target.json
from chembl_webresource_client.
this might be a little more complex, since we do additional processing to display information on the web interface from information that is on the web services/database.
CHEMBL269732 is an identifier for a compound, it is not an identifier for targets, so you can't use it to filter on the target endpoint directly
In order to filter targets based on a compound identifier, you have 2 options use the Mechanisms of Action endpoint or the Assay-Activity endpoints.
Mechanisms of Action
https://www.ebi.ac.uk/chembl/api/data/mechanism.json?parent_molecule_chembl_id=CHEMBL269732
Activity
https://www.ebi.ac.uk/chembl/api/data/activity.json?parent_molecule_chembl_id=CHEMBL269732
From here you could collect the target_chembl_id
and later on use them to filter on the target endpoint:
I hope this helps.
from chembl_webresource_client.
Related Issues (20)
- .filter for different names in "document_journal" column HOT 1
- Query hangs after reaching specific entry HOT 1
- Error for url https://www.ebi.ac.uk/chembl/api/data/activity.json, server response: <!doctype html> HOT 6
- Isomeric SMILES string
- Problem with unichem.structure HOT 4
- Http Application error HOT 5
- Querying by inchi
- new_client is failing to import from chembl_webresource_client HOT 1
- Assay offsets and limit HOT 2
- How do I retrieve the Unichem Cross references as a dictionary/list for a CHEMBL compound?
- Fail to import new_client due to API problem HOT 5
- Fixed
- Space between words of the query
- HttpApplicationError HOT 8
- confidence score
- Error for url
- ChEMBL webresourse client issue
- status 500 with chembl_webresource_client.new_client
- Problem of parallelized big data mining via batch chunks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chembl_webresource_client.