[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Thu Dec 11 22:30:53 UTC 2003


mwilkinson
Thu Dec 11 17:30:53 EST 2003
Update of /home/repository/moby/moby-live/Perl/scripts/Services
In directory pub.open-bio.org:/tmp/cvs-serv5159/Services

Modified Files:
	LocalServices.pm 
Log Message:
two more services dealing with taxon data

moby-live/Perl/scripts/Services LocalServices.pm,1.47,1.48
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm	2003/12/11 18:22:02	1.47
+++ /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm	2003/12/11 22:30:53	1.48
@@ -46,13 +46,13 @@
     my ($caller, $data) = @_;
     my $MOBY_RESPONSE;
     my (@inputs)= genericServiceInputParser($data); # ([SIMPLE, $queryID, $simple],...)
-    return SOAP::Data->type('base64' => responseHeader() . responseFooter()) unless (scalar(@inputs));
+    return SOAP::Data->type('base64' => responseHeader("illuminae.com") . responseFooter()) unless (scalar(@inputs));
 
     my @validNS = validateNamespaces("NCBI_Acc");  # ONLY do this if you are intending to be namespace aware!
 
     foreach (@inputs){
         my ($articleType, $qID, $input) = @{$_};
-        unless ($articleType == SIMPLE){
+        unless (($articleType == SIMPLE) && ($input)){
             $MOBY_RESPONSE .= simpleResponse("", "", $qID) ;
             next;
         } else {
@@ -69,6 +69,97 @@
 ##################################################
 ##################################################
 
+sub getTaxChildNodes {  # 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([], "wrong_namespace", $qID) unless ($namespace eq $validNS);
+			my $children = SHoundGetTaxChildNodes($identifier);
+            $MOBY_RESPONSE .= collectionResponse([], "nothing_found", $qID) unless ($children);
+			my @children = split ",", $children;
+			my @simples;
+			foreach my $taxon (@children){
+				next unless $taxon;
+				$taxon =~ s/\s//g;
+	            push @simples, "<Object namespace='taxon' id='$taxon'/>";
+			}
+			$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 getTaxParent { # DOES NOT WORK - SHound call doesn't exist
+    my ($caller, $data) = @_;
+    my $MOBY_RESPONSE;
+    my (@inputs)= genericServiceInputParser($data); # ([SIMPLE, $queryID, $simple],...)
+    return SOAP::Data->type('base64' => responseHeader() . 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 .= simpleResponse("", "", $qID) ;
+            next;
+        } else {
+            my $namespace = getSimpleArticleNamespaceURI($input);
+			my ($identifier) = getSimpleArticleIDs($input);  # note array output!
+            $MOBY_RESPONSE .= simpleResponse("", "wrong_namespace", $qID) unless ($namespace eq $validNS);
+			my $parent = SHoundGetTaxParent($identifier);
+            $MOBY_RESPONSE .= simpleResponse("", "nothing_found", $qID) unless ($parent);
+			$parent && ($MOBY_RESPONSE .= simpleResponse("<Object namespace='taxon' id='$parent'/>", "", $qID));
+        }
+    }
+	print STDERR responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter;
+    return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter));    
+}
+
+
+sub getTaxNameFromTaxID{  # WORKS
+    my ($caller, $data) = @_;
+    my $MOBY_RESPONSE;
+    my (@inputs)= genericServiceInputParser($data); # ([SIMPLE, $queryID, $simple],...)
+    return SOAP::Data->type('base64' => responseHeader() . 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 .= simpleResponse("", "", $qID) ;
+            next;
+        } else {
+            my $namespace = getSimpleArticleNamespaceURI($input);
+			my ($identifier) = getSimpleArticleIDs($input);  # note array output!
+            $MOBY_RESPONSE .= simpleResponse("", "wrong_namespace", $qID) unless ($namespace eq $validNS);
+			my $name = SHoundGetTaxNameFromTaxID($identifier);
+            $MOBY_RESPONSE .= simpleResponse("", "nothing_found", $qID) unless ($name);
+			$name && ($MOBY_RESPONSE .= simpleResponse("<String namespace='taxon' id='$identifier'>
+													   <CrossReference>
+													   <Object namespace='Global_Keyword' id='$name'/>
+													   </CrossReference>$name</String>", "", $qID));
+        }
+    }
+	print STDERR responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter;
+    return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter));    
+}
 
 sub getGoTerm {
     my ($caller, $message) = @_;




More information about the MOBY-guts mailing list