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

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

Embed Size (px)

Citation preview

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

EBI is an Outstation of the European Molecular Biology Laboratory. Web Services Course CBS, DK.

EBI Web Services

Teresa Miyar EMBL-EBI

External Services Group

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

Web Services Course CBS, DK.

EBI web services (analysis tools)

jobid

getResults (jobid)

results available

checkStatus (jobid)

status

run(params, data)

poll (jobid, type)

result file

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

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);

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

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]));

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

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;

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

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();

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

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

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

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'})• • jobid = urllib.urlopen(url, params).read()

• print jobid

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

Web Services Course CBS, DK.

Ensembl (Martservice)

Ensembl (Martservice)

Data Retrieval

(WSDbfetch)

Data Retrieval

(WSDbfetch)

Expression ProfilerExpression Profiler

Protein families, motifs and domains (WSInterProScan)

Protein families, motifs and domains (WSInterProScan)

Protein structure & function: (MSD API)

Protein structure & function: (MSD API)

Literature and text mining (Whatizit, CiteXplore)

Literature and text mining (Whatizit, CiteXplore)

Sequence homology WSWUBlast

WSFastaWSMPsrchWSScanPS

Wise, PromoterWise, ScanWise

Sequence homology WSWUBlast

WSFastaWSMPsrchWSScanPS

Wise, PromoterWise, ScanWise

Sequence alignment WSClustalWWSMuscleWSTCoffee

Sequence alignment WSClustalWWSMuscleWSTCoffee

Sequence analysis

(WSEmboss)

Sequence analysis

(WSEmboss)

Ontologies (OntologyLookup)Ontologies (OntologyLookup)

DaliLite, MaxsproutDaliLite, Maxsprout

Integr8 APIIntegr8 API

Uniprot APIUniprot API

Available Services

ID mapping (Picr, Martservice)ID mapping (Picr, Martservice)

Search (EB-Eye)Search (EB-Eye)

ChEBI APIChEBI API

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

Web Services Course CBS, DK.

Text output

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

Web Services Course CBS, DK.

XML results

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

Web Services Course CBS, DK.

Documentation

http://www.ebi.ac.uk/Tools/webservices

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

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

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

Web Services Course CBS, DK.

Acknowledgements