Closed sbgsbc closed 2 years ago
Hi Stephane,
The unichem.structure
function reutrns the structure for a given pair of source compound id and source id:
from chembl_webresource_client.unichem import unichem_client as unichem
ret = unichem.structure('CHEMBL12', 1)
print(ret)
[{'standardinchikey': 'AAOVKJBEBIDNHE-UHFFFAOYSA-N',
'standardinchi': 'InChI=1S/C16H13ClN2O/c1-19-14-8-7-12(17)9-13(14)16(18-10-15(19)20)11-5-3-2-4-6-11/h2-9H,10H2,1H3'}]
@ricardoaat
Hi,
Thanks to answer so quick :
I tried from chembl_webresource_client.unichem import unichem_client as unichem ret = unichem.inchiFromKey('AAOVKJBEBIDNHE-UHFFFAOYSA-N') print(ret)
The result is :
[{'standardinchi': 'InChI=1S/C25H23F3N4O2/c26-25(27,28)21-9-4-20(5-10-21)8-13-24-30-22(18-34-24)17-33-23-11-6-19(7-12-23)3-1-2-15-32-16-14-29-31-32/h4-14,16,18H,1-3,15,17H2/b13-8+'}]
So the connexion seems to be ok.
If I try your code from chembl_webresource_client.unichem import unichem_client as unichem ret = unichem.structure('CHEMBL12', 1) print(ret)
After 12 s I obtain the following error :
--------------------------------------------------------------------------- MaxRetryError Traceback (most recent call last) ~/miniconda3/envs/pkidb/lib/python3.9/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies) 438 if not chunked: --> 439 resp = conn.urlopen( 440 method=request.method, ~/miniconda3/envs/pkidb/lib/python3.9/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, response_kw) 845 log.debug("Retry: %s", url) --> 846 return self.urlopen( 847 method, ~/miniconda3/envs/pkidb/lib/python3.9/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, response_kw) 845 log.debug("Retry: %s", url) --> 846 return self.urlopen( 847 method, ~/miniconda3/envs/pkidb/lib/python3.9/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, response_kw) 845 log.debug("Retry: %s", url) --> 846 return self.urlopen( 847 method, ~/miniconda3/envs/pkidb/lib/python3.9/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, response_kw) 835 try: --> 836 retries = retries.increment(method, url, response=response, _pool=self) 837 except MaxRetryError: ~/miniconda3/envs/pkidb/lib/python3.9/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace) 573 if new_retry.is_exhausted(): --> 574 raise MaxRetryError(_pool, url, error or ResponseError(cause)) 575 MaxRetryError: HTTPSConnectionPool(host='www.ebi.ac.uk', port=443): Max retries exceeded with url: /unichem/rest/structure/CHEMBL12/1 (Caused by ResponseError('too many 404 error responses')) During handling of the above exception, another exception occurred: RetryError Traceback (most recent call last) /tmp/ipykernel_18210/1044002230.py in
RetryError: HTTPSConnectionPool(host='www.ebi.ac.uk', port=443): Max retries exceeded with url: /unichem/rest/structure/CHEMBL12/1 (Caused by ResponseError('too many 404 error responses'))
Could you explain it ?
Stéphane
De : Eloy Félix @.> Répondre à : chembl/chembl_webresource_client @.> Date : lundi 16 mai 2022 à 15:13 À : chembl/chembl_webresource_client @.> Cc : bourg @.>, Author @.***> Objet : Re: [chembl/chembl_webresource_client] Problem with unichem.structure (Issue #119)
Hi Stephane,
The unichem.structure function reutrns the structure for a given pair of source compound id and source id:
from chembl_webresource_client.unichem import unichem_client as unichem
ret = unichem.structure('CHEMBL12', 1)
print(ret)
[{'standardinchikey': 'AAOVKJBEBIDNHE-UHFFFAOYSA-N',
'standardinchi': 'InChI=1S/C16H13ClN2O/c1-19-14-8-7-12(17)9-13(14)16(18-10-15(19)20)11-5-3-2-4-6-11/h2-9H,10H2,1H3'}]
@ricardoaathttps://github.com/ricardoaat
— Reply to this email directly, view it on GitHubhttps://github.com/chembl/chembl_webresource_client/issues/119#issuecomment-1127655268, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMEXTHS4D6372JG6AHS2IN3VKJCR7ANCNFSM5WBMYYBA. You are receiving this because you authored the thread.Message ID: @.***>
which version of the library are you using? could you please try with the latest one? 0.10.8
I’m using 0.10.1.
I’ve switched to 0.10.8 and some tests are conclusive. It seems OK.
Many thanks.
Stephane
De : Eloy Félix @.> Répondre à : chembl/chembl_webresource_client @.> Date : lundi 16 mai 2022 à 17:11 À : chembl/chembl_webresource_client @.> Cc : bourg @.>, Author @.***> Objet : Re: [chembl/chembl_webresource_client] Problem with unichem.structure (Issue #119)
which version of the library are you using? could you please try with the latest one? 0.10.8
— Reply to this email directly, view it on GitHubhttps://github.com/chembl/chembl_webresource_client/issues/119#issuecomment-1127796691, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMEXTHV4ETFHKUMCNFBILR3VKJQPHANCNFSM5WBMYYBA. You are receiving this because you authored the thread.Message ID: @.***>
I'm enabled to get an answer to :
Answer is :
But
is fine.
Is there a problem with the structure() method ?
I'm using chembl_webresource_client 0.10.8 installalled from conda-forge.
Many thanks.
Stephane