#!/usr/bin/perl # Description: Use eFetch to retrieve a protein sequence given it's id # Author: Francisco Roque # Email: chico@cbs.dtu.dk # Version: eFetch 1.5b # Date: 2008-01-23 use SOAP::Lite; # Receive the protein id from the command line my $protid = shift; # create entry point for the service and run the run_eFetch server my $efetch = SOAP::Lite -> service('http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/efetch.wsdl') -> on_fault( sub { my($self, $res) = @_; die "faultcode:", ref $res ? $res->faultcode : $self->transport->status, "\n" , "faultstring:", ref $res ? $res->faultstring : $self->transport->status, "\n"; }); # run the run_eFetch service my $result = $efetch-> run_eFetch( SOAP::Data->name(db => "protein"), SOAP::Data->name(id => $protid)); # print the results # print $result->{GBSeq}->{'GBSeq_primary-accession'}; # print "\t"; # print uc($result->{GBSeq}->{GBSeq_sequence}); # print "\n";