Comments (3)
I should clarify, I'm getting that error on the import only for ChEMBL
from bioservices.uniprot import UniProt
from bioservices.chembl import ChEMBL
from bioservices.chebi import ChEBI
If I persist in trying to access ChEMBL I get functionally the same outcome. Uniprot & ChEBI are both functional and operate as expected.
chembl_ws = ChEMBL()
chembl_data = chembl_ws.get_molecule('CHEMBL2835')
WARNING [bioservices.ChEMBL:596]: status is not ok with Not Found
/usr/local/lib/python3.6/site-packages/bioservices/chembl.py in get_molecule(self, query, limit, offset, filters)
671 """
672 params = {"limit": limit, "offset": offset, "filters": filters}
--> 673 return self._get_this_service("molecule", query, params=params)
674
675 def get_molecule_form(self, query=None, limit=20, offset=0, filters=None):
/usr/local/lib/python3.6/site-packages/bioservices/chembl.py in _get_this_service(self, name, query, params)
477 elif isinstance(query, (str, int, float)):
478 res = self.http_get("{}/{}".format(name, query), params=params)
--> 479 self._check_request(res)
480 elif isinstance(query, list):
481 assert params["limit"] <= 1000, "limit must be less than 1000"
/usr/local/lib/python3.6/site-packages/bioservices/chembl.py in _check_request(self, res)
430 # If there is no output because of wrong query, a 404 is returned.
431 if isinstance(res, int):
--> 432 raise ValueError("Invalid request for {} {}. Check your query and parameters")
433
434 def _get_this_service(self, name, query, params={"limit": 20, "offset": 0}):
ValueError: Invalid request for {} {}. Check your query and parameters
from bioservices.
First of all, thanks for using bioservices. I must agree that the error message is not very useful.
I believe that molecule CHEMBL2835 does not exists hence the error message.
If you try with CHEMBL24, does it work for you ?
One difficulty with the services is that you do not have the list of valid identifiers on the hood, so you need to know the correct ones.
One way is to use gte_molecule() without option but it returns by default only the first 1000 entries.
The warning message can be ignored (at the beginning); it is just a warning.
from bioservices.
Of course, it's great library! Thank you for your indulgence, I'm going to chalk this up to me being a software engineer and not knowing any better. It looks like ChEMBL is providing a context-sensitive response which is a little awkward for API work in this way. But they both ChEMBL id's provide a target report card as shown below. I'll have to inquire with the chemist I'm working with to muddle through this. Thanks for the feedback.
!# appears to default to the "card view" as a "compound"
https://www.ebi.ac.uk/chembl/g/#search_results/all/query=chembl24
!# defaults to "table view" as a "target"
https://www.ebi.ac.uk/chembl/g/#search_results/all/query=chembl2835
https://www.ebi.ac.uk/chembl/target_report_card/CHEMBL2835/
https://www.ebi.ac.uk/chembl/target_report_card/CHEMBL24/
print(c.get_molecule('CHEMBL2835')) # FAILS
print(c.search_target('CHEMBL2835')) # SUCCEEDS
from bioservices.
Related Issues (20)
- KEGG 'MEMBER' keyword without special parsing & T/nt numbers HOT 3
- When importing UniProt from bioservices I get this TypeError: __init__() got an unexpected keyword argument 'text_color' HOT 2
- pip install throws an OSError for version 1.10.1 HOT 6
- Could not build wheels for gseapy HOT 1
- Include Uniprot secondary accessions in DataFrame columns HOT 1
- ChEMBL Service cannot be reached HOT 1
- pip install gives FileNotFoundError for version 1.10.3 HOT 10
- Failing for UniProt examples HOT 1
- Limit of 25 proteins for UniProt mapping. HOT 3
- [Bug in v1.11.0] Need to check for the presence of `failedIds` key in uniprot.mapping HOT 3
- error in PDBe module or just in the example? HOT 1
- Retrieving error from Psicquic request HOT 4
- Is there plan to update Pubchem API?
- UniChem example from docs fails HOT 1
- Error in bioservices/uniprot.py HOT 1
- bioservics Panther HOT 1
- Unable to reach BioDBNet URL HOT 1
- BioMart filter input
- parse_kgml_pathway HOT 1
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 bioservices.