Hi,
I'm trying to search by name a large set of molecules, in order to get their chembl_id, using:
for i in range(len(nams)):
try:
res = nc.molecule.search(nams[i])[0]
if len(res) == 0:
print("not found data for ", ids[i], nams[i])
else:
print("OK found data for ", ids[i], nams[i])
except:
print("error for ", ids[i], nams[i])
print("Finished ", i)
However, this takes huge a amount of time. It starts very fast, but later it slows down and it only retrieved about 2K molecules in one day. Is it possible to run the search in batches of names? I tried something like
nc.molecule.search(nams[i:(i+100)])
but it did not work:
TypeError: quote_from_bytes() expected bytes
In addition, a very large percentage of the searches returns an error like this (in this case, searching "Hericenone B", although it seems not reproducible, some times it returns the error but sometimes not):
Our web server says this is a 500 internal server error: the request cannot be carried out by the server.
This problem means that the service you are trying to access is currently unavailable. We're very sorry.
Please try again but if it keeps happening, you can contact us and we will try to help you.
Hi, I'm trying to search by name a large set of molecules, in order to get their chembl_id, using:
for i in range(len(nams)): try: res = nc.molecule.search(nams[i])[0] if len(res) == 0: print("not found data for ", ids[i], nams[i])
else: print("OK found data for ", ids[i], nams[i]) except: print("error for ", ids[i], nams[i]) print("Finished ", i)
However, this takes huge a amount of time. It starts very fast, but later it slows down and it only retrieved about 2K molecules in one day. Is it possible to run the search in batches of names? I tried something like
nc.molecule.search(nams[i:(i+100)])
but it did not work: TypeError: quote_from_bytes() expected bytes
In addition, a very large percentage of the searches returns an error like this (in this case, searching "Hericenone B", although it seems not reproducible, some times it returns the error but sometimes not):
Error for url https://www.ebi.ac.uk/chembl/api/data/molecule/search.json, server response: <!doctype html>
Server error
Something has gone wrong with our web server
Our web server says this is a 500 internal server error: the request cannot be carried out by the server.
This problem means that the service you are trying to access is currently unavailable. We're very sorry.
Please try again but if it keeps happening, you can contact us and we will try to help you.
How can I run a search for a long list of names?
Thanks
Gonzalo