[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Mon Feb 9 22:59:34 UTC 2004
mwilkinson
Mon Feb 9 17:59:34 EST 2004
Update of /home/repository/moby/moby-live/Perl/scripts/Services
In directory pub.open-bio.org:/tmp/cvs-serv1691/Services
Modified Files:
LocalServices.pm
Log Message:
added a DNA/Protein sequence retrieval service for genbank genomes from taxon ID using SeqHound.
moby-live/Perl/scripts/Services LocalServices.pm,1.56,1.57
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm 2004/02/09 22:11:10 1.56
+++ /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm 2004/02/09 22:59:34 1.57
@@ -157,6 +157,75 @@
return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter));
}
+sub getSHoundProteinsFromOrganism { # WORKS
+ my ($caller, $data) = @_;
+ my $MOBY_RESPONSE;
+ my (@inputs)= genericServiceInputParser($data); # ([SIMPLE, $queryID, $simple],...)
+ return SOAP::Data->type('base64' => responseHeader("illuminae.com") . responseFooter()) unless (scalar(@inputs));
+
+ my ($validNS) = validateNamespaces("taxon"); # ONLY do this if you are intending to be namespace aware!
+ return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . responseFooter)) unless $validNS;
+
+ foreach (@inputs){
+ my ($articleType, $qID, $input) = @{$_};
+ unless (($articleType == SIMPLE) && ($input) ){
+ $MOBY_RESPONSE .= collectionResponse([], "", $qID) ;
+ next;
+ } else {
+ my $namespace = getSimpleArticleNamespaceURI($input);
+ my ($identifier) = getSimpleArticleIDs($input); # note array output!
+ (($MOBY_RESPONSE .= collectionResponse([], "", $qID)) && next) unless ($namespace eq $validNS);
+ my $proteinGIs = SHoundProteinsFromOrganism($identifier,1);
+ (($MOBY_RESPONSE .= collectionResponse([], "", $qID)) && next) unless ($proteinGIs);
+ my @proteinGIs = split ",", $proteinGIs;
+ my @simples;
+ foreach my $gi (@proteinGIs){
+ next unless $gi;
+ $gi =~ s/\s//g;
+ push @simples, "<Object namespace='NCBI_gi' id='$gi'/>";
+ }
+ $MOBY_RESPONSE .= collectionResponse(\@simples, "", $qID);
+ }
+ }
+ print STDERR responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter;
+ return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter));
+}
+
+
+sub getSHoundDNAFromOrganism { # WORKS
+ my ($caller, $data) = @_;
+ my $MOBY_RESPONSE;
+ my (@inputs)= genericServiceInputParser($data); # ([SIMPLE, $queryID, $simple],...)
+ return SOAP::Data->type('base64' => responseHeader("illuminae.com") . responseFooter()) unless (scalar(@inputs));
+
+ my ($validNS) = validateNamespaces("taxon"); # ONLY do this if you are intending to be namespace aware!
+ return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . responseFooter)) unless $validNS;
+
+ foreach (@inputs){
+ my ($articleType, $qID, $input) = @{$_};
+ unless (($articleType == SIMPLE) && ($input) ){
+ $MOBY_RESPONSE .= collectionResponse([], "", $qID) ;
+ next;
+ } else {
+ my $namespace = getSimpleArticleNamespaceURI($input);
+ my ($identifier) = getSimpleArticleIDs($input); # note array output!
+ (($MOBY_RESPONSE .= collectionResponse([], "", $qID)) && next) unless ($namespace eq $validNS);
+ my $proteinGIs = SHoundDNAFromOrganism($identifier,1);
+ (($MOBY_RESPONSE .= collectionResponse([], "", $qID)) && next) unless ($proteinGIs);
+ my @proteinGIs = split ",", $proteinGIs;
+ my @simples;
+ foreach my $gi (@proteinGIs){
+ next unless $gi;
+ $gi =~ s/\s//g;
+ push @simples, "<Object namespace='NCBI_gi' id='$gi'/>";
+ }
+ $MOBY_RESPONSE .= collectionResponse(\@simples, "", $qID);
+ }
+ }
+ print STDERR responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter;
+ return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter));
+}
+
sub getTaxChildNodes { # WORKS
my ($caller, $data) = @_;
my $MOBY_RESPONSE;
More information about the MOBY-guts
mailing list