EBI Web Services Teresa Miyar EMBL-EBI External Services Group Web Services Course CBS, DK. EBI is an Outstation of the European Molecular Biology Laboratory.

Download Report

Transcript EBI Web Services Teresa Miyar EMBL-EBI External Services Group Web Services Course CBS, DK. EBI is an Outstation of the European Molecular Biology Laboratory.

EBI Web Services
Teresa Miyar EMBL-EBI
External Services Group
Web Services Course CBS, DK.
EBI is an Outstation of the European Molecular Biology Laboratory.
EBI web services (analysis tools)
run(params, data)
jobid
checkStatus (jobid)
status
getResults (jobid)
results available
poll (jobid, type)
result file
Web Services Course CBS, DK.
Perl Soap Client (synchronous)
•
#!/usr/bin/env perl
•
use SOAP::Lite;
•
•
my $WSDL = 'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSFasta.wsdl';
my $fasta_client = SOAP::Lite->service($WSDL);
•
•
•
•
•
•
my %params=();
$params{'program'}='fasta3';
$params{'database'}='uniprot';
$params{'email'}='youremail';
$data={type=>"sequence",
content=>“uniprot:slpi_human"};
•
•
•
my $jobid = $fasta_client->runFasta(
SOAP::Data->name('params')->type(map=>\%params),
SOAP::Data->name( content => [$data]));
•
print $fasta_client->poll($jobid);
Web Services Course CBS, DK.
Perl Soap Client (asynchronous)
•
#!/usr/bin/env perl
•
•
•
•
•
•
•
•
•
use SOAP::Lite;
my $WSDL = 'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSFasta.wsdl';
my $fasta_client = SOAP::Lite->service($WSDL);
my %params=();
SOAP::Lite->import(+trace => debug);
$params{'program'}='fasta3';
$params{'database'}='uniprot';
$params{'email'}='[email protected]';
$params{'async'}= 1;
•
•
$data={type=>"sequence",
content=>"uniprot:slpi_human"};
•
•
•
my $jobid = $fasta_client->runFasta(
SOAP::Data->name('params')->type(map=>\%params),
SOAP::Data->name( content => [$data]));
Web Services Course CBS, DK.
Perl Soap Client (asynchronous cont.)
•
•
# set a loop for checking job submission status
# RUNNING, NOT_FOUND, ERROR, DONE
•
•
•
•
my $status = $fasta_client ->checkStatus($jobid);
while ($status eq "RUNNING") {
sleep 10; $status = $fasta_client-checkStatus($jobid);
}
•
# when job is done, poll for the results
•
my $result = $fasta_client ->poll($jobid) if ($status eq "DONE") ;
•
print $result;
Web Services Course CBS, DK.
Perl Rest Client
•
#!/usr/bin/env perl
•
•
•
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
•
$URL="http://www.ebi.ac.uk/Tools/webservices/rest/submit";
•
•
•
•
•
•
my %params=();
$params{'tool'}="iprscan";
$params{'sequence'}="uniprot:slpi_human";
$params{'seqtype'}="P";
$params{'email'}=“youremail";
@args=%{\%params};
•
•
•
$ua= LWP::UserAgent->new();
$resp = $ua->request( POST $URL , 'Content' => \@args);
print $resp->content();
Web Services Course CBS, DK.
Python Soap Client
•
#!/usr/bin/env python
•
•
import sys
from SOAPpy import WSDL
•
•
•
•
blast_wsdUrl='http://www.ebi.ac.uk/Tools/webservices/wsdl/WSWUBlast.wsdl'
server = WSDL.Proxy(blast_wsdUrl)
server.soapproxy.config.dumpSOAPOut = 1
server.soapproxy.config.dumpSOAPIn = 1
•
•
•
•
•
•
•
•
•
•
•
•
•
•
seq = """>UniProt/TrEMBL|Q8E5Q5|Q8E5Q5_STRA3 Hypothetical protein gbs0925
MKLSKRYRFWQKVIKALGVLALIATLVLVVYLYKLGILNDSNELKDLVHKYEFWGPMIFI
VAQIVQIVFPVIPGGVTTVAGFLIFGPTLGFIYNYIGIIIGSVILFWLVKFYGRKFVLLF
MDQKTFDKYESKLETSGYEKFFIFCMASPISPADIMVMITGLSNMSIKRFVTIIMITKPI
SIIGYSYLWIYGGDILKNFLN"""
blast_params = {'program':'blastp','database':'uniref90',
'email':'[email protected]', 'async':0}
blast_data = [{'type':'sequence',
'content':seq}]
jobid = server.runWUBlast(params=blast_params,content=blast_data)
print jobid
sys.stdout.flush()
result = server.poll(jobid,'tooloutput')
print result
Web Services Course CBS, DK.
Python Rest Client
•
#!/usr/bin/env python
•
import urllib
•
url = 'http://www.ebi.ac.uk/Tools/webservices/rest/submit'
•
params = {}
•
•
•
•
•
•
params = urllib.urlencode({'tool':'iprscan',
'sequence':'uniprot:slpi_human',
'email':'[email protected]',
'seqtype':'P'})
•
print jobid
jobid = urllib.urlopen(url, params).read()
Web Services Course CBS, DK.
Search (EB-Eye)
Available Services
Data Retrieval
(WSDbfetch)
Ensembl
(Martservice)
Uniprot API
Integr8 API
Expression Profiler
Protein families,
motifs and domains
(WSInterProScan)
Wise, PromoterWise,
ScanWise
Sequence alignment
WSClustalW
WSMuscle
WSTCoffee
Protein structure & function:
(MSD API)
Literature and text mining
(Whatizit, CiteXplore)
Sequence homology
WSWUBlast
WSFasta
WSMPsrch
WSScanPS
DaliLite, Maxsprout
Ontologies (OntologyLookup)
ID mapping (Picr, Martservice)
Web Services Course CBS, DK.
ChEBI API
Sequence analysis
(WSEmboss)
Text output
Web Services Course CBS, DK.
XML results
Web Services Course CBS, DK.
Documentation
http://www.ebi.ac.uk/Tools/webservices
Web Services Course CBS, DK.
Exercise Proposal
•
Stacey, G., Koh, S., Granger, C. & Becker, J. M. (2002). Peptide
transport in plants. Trends Plant Sci 7, 257-263.
•
•
•
•
•
•
Reproduce the philogenetic tree from Stacey’s article
Find in Uniprot an id for a PTR (Peptide Transporters) protein
Do a Blast using Uniprot
Download the sequences of the hits
Align These sequences using a MSA (Muscle, Mafft, TCoffee)
Generate ClustalW tree
Web Services Course CBS, DK.
Acknowledgements
Web Services Course CBS, DK.