Entering edit mode
20 months ago
joselu
▴
110
Hello, I want to implement a rest api with python and requests to perform an alignment on Emboss needle https://www.ebi.ac.uk/Tools/psa/emboss_needle/
I have used the following code but I am getting the following error. I do not know what I'm doing wrong. Can somebody help me?
Thank you so much
import requests
base_url="https://www.ebi.ac.uk/Tools/services/rest/emboss_needle/run"
auth_data = {'email': 'joseludenia@gmail.com'}
params={"asequence":"agtgctagggaggatcgggatgcgatgca" , "bsequence":"agtgcttggaggatcatgctaggatgca"}
response=requests.post(base_url, data=auth_data, params=params)
id=response.text
res=requests.get(f"https://www.ebi.ac.uk/Tools/services/rest/emboss_needle/result/{id}/aln")
print(res.text)
ERROR
<?xml version='1.0' encoding='UTF-8'?>
<error>
<description>Job 'emboss_needle-R20230322-062343-0348-8675423-p1m' is still running</description>
</error>
Yes, I agree, but is it possible to modify my code so that it doesn't return the error and keep waiting while the job is running? Thank you.
Just check what they'd implemented so far in their script (for example, in the
clientPool
function).