
Untitled
By: a guest on
Apr 24th, 2012 | syntax:
Python | size: 0.77 KB | hits: 20 | expires: Never
#!/usr/bin/python
from suds.client import Client
import time
#URL with WSDL file
url = 'http://iimcb.genesilico.pl/MetaLocGramN/soap_fix/services.wsdl'
#Your sequence
seq = """>fasta
MKLSINKNTLESAVILCNAYVEKKDSSTITSHLFFHADEDKLLIKASDYEIGI
NYKIKKIRVESSGFATANAKSIADVIKSLNNEEVVLETIDNFLFVRQKNTKYK
"""
client = Client(url)
#Send a request with your sequence
job_id = client.service.predict(seq)
#if there is no error, get_status
status = ''
if job_id != 'error':
print '#job_id:', job_id
while status != 'done':
status = client.service.get_status(job_id)
print '#status:', status
#wait 5s
time.sleep(5)
#print the result
result = client.service.get_result(job_id)
print '#result:', result
else:
print 'error'