[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Mon Feb 9 22:11:10 UTC 2004


mwilkinson
Mon Feb  9 17:11:10 EST 2004
Update of /home/repository/moby/moby-live/Perl/scripts/Services
In directory pub.open-bio.org:/tmp/cvs-serv1534/Services

Modified Files:
	LocalServices.pm 
Log Message:
added a DNA sequence retrieval service from taxon ID using SeqHound.

moby-live/Perl/scripts/Services LocalServices.pm,1.55,1.56
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm	2004/02/09 21:45:44	1.55
+++ /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm	2004/02/09 22:11:10	1.56
@@ -3,7 +3,6 @@
 
 use lib "/var/www/cgi-bin";
 use lib "/usr/local/apache/cgi-bin/bioperl/core";
-use lib "/usr/local/apache/cgi-bin/MOBY05/";
 use lib "/export/home/root/BIOPERL/perl-api";
 
 use strict;
@@ -89,6 +88,41 @@
 ##################################################
 
 
+sub getSHoundDNAFromTaxID {  # 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 = SHoundDNAFromTaxID($identifier);
+            (($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 getSHoundProteinsFromTaxID {  # WORKS
     my ($caller, $data) = @_;
     my $MOBY_RESPONSE;




More information about the MOBY-guts mailing list