Alignment REST API
1
0
Entering edit mode
21 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>
emboss rest-api alignment needle python • 979 views
ADD COMMENT
1
Entering edit mode
21 months ago
Shred ★ 1.6k

Why reinventing the wheel if they kindly give code for using their REST API? From https://www.ebi.ac.uk/seqdb/confluence/display/JDSAT/EMBOSS+Needle+Help+and+Documentation#EMBOSSNeedleHelpandDocumentation-RESTAPI

ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

Just check what they'd implemented so far in their script (for example, in the clientPool function).

ADD REPLY

Login before adding your answer.

Traffic: 2044 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6