Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 24th, 2012  |  syntax: Python  |  size: 0.77 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/usr/bin/python
  2.  
  3. from suds.client import Client
  4. import time
  5. #URL with WSDL file
  6. url = 'http://iimcb.genesilico.pl/MetaLocGramN/soap_fix/services.wsdl'
  7. #Your sequence
  8. seq = """>fasta
  9. MKLSINKNTLESAVILCNAYVEKKDSSTITSHLFFHADEDKLLIKASDYEIGI
  10. NYKIKKIRVESSGFATANAKSIADVIKSLNNEEVVLETIDNFLFVRQKNTKYK
  11. """
  12. client = Client(url)
  13. #Send a request with your sequence
  14. job_id = client.service.predict(seq)
  15. #if there is no error, get_status
  16. status = ''
  17. if job_id != 'error':
  18.     print '#job_id:', job_id
  19.     while status != 'done':
  20.         status = client.service.get_status(job_id)
  21.         print '#status:', status
  22.         #wait 5s
  23.         time.sleep(5)
  24.     #print the result
  25.     result =  client.service.get_result(job_id)
  26.     print '#result:', result
  27. else:
  28.     print 'error'