import requests
client = requests.session()
#retrive csrf token
y = client.get(http://hotidp.leloir.org.ar/api/querymsa)
y = y.json()
data_send = {
"csrfmiddlewaretoken": y['csrfmiddlewaretoken'],
"uniprot_accession": "P46527",
"aln_method": "both",
"aln_type": "both",
"dp_identity": "both",
"fullseq_identity": "both",
"regionseq_identity": "both",
"nd_full_cutoff": 0.6,
"nd_region_cutoff": 0.6
}
consult_r = client.post(http://hotidp.leloir.org.ar/api/querymsa, data=data_send)
print(consult_r.status_code)
#list of found MSAs
msas_data = consult_r.json()
if (consult_r.status_code == 200):
#Retrieve the MSAs
for x in msas_data["alignments"]:
msaname = x["file_name"]
consult_r = requests.get(http://hotidp.leloir.org.ar/api/querymsa/download/ + msaname)
if consult_r.status_code == 200:
#save as tar.gz
with open(msaname, 'wb') as f:
f.write(consult_r.content)
import requests
client = requests.session()
#retrive csrf token
y = client.get(http://hotidp.leloir.org.ar/api/pipeline)
y = y.json()
data_send = {
"csrfmiddlewaretoken": y['csrfmiddlewaretoken'],
"aln_methods": ["clustalO"],
"identity_full": ["60"],
"identity_region": ["60"],
"aa_percent_full": 30,
"aa_max_full": 500,
"aa_percent_region": 30,
"aa_max_region": 100,
"transfer_identity_full": 60,
"transfer_identity_region": 60,
"transfer_normd_full" : 0.6,
"transfer_normd_region" : 0.6
}
text_type = {
"txt": 'text/plain',
"csv": 'application/vnd.ms-excel',
"tsv": 'application/octet-stream'
}
file_send = {
"uniprot_accessions": ('uniprot_list_P10636.txt', open('uniprot_list_P10636.txt', 'rb'), text_type['txt']),
"regions": ('regions_P10636_TAU.txt', open('regions_P10636_TAU.txt', 'rb'), text_type['txt'])
}
consult_r = client.post(http://hotidp.leloir.org.ar/api/pipeline, data=data_send, files=file_send)
print(consult_r.status_code)
print(consult_r.json())
import requests
jobid='your_job_id'
consult_r = requests.get(http://hotidp.leloir.org.ar/api/pipeline/ + jobid)
print(consult_r.status_code)
print(consult_r.json())
import requests
jobid='your_job_id'
consult_r = requests.get(http://hotidp.leloir.org.ar/api/pipeline/download/ + jobid)
if consult_r.status_code == 200:
#save as tar.gz
with open(jobid + ".tar.gz", 'wb') as f:
f.write(consult_r.content)
else:
#some error found
print(consult_r.json())
We provide two template files: Example of JSON used to retrieve precalculated MSAs and transferred terms Example of JSON used to execute pipeline
We provide two example files used to execute the pipeline: Example of input file with UniProt Accessions Example of input file with the Regions for the UniProt Accessions
Examples of output files for the examples: Example of output file for executed pipeline Example of output file for precalculated MSAs