[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Tue Feb 10 01:10:45 UTC 2004
mwilkinson
Mon Feb 9 20:10:45 EST 2004
Update of /home/repository/moby/moby-live/Perl/scripts/Services
In directory pub.open-bio.org:/tmp/cvs-serv2100/Services
Modified Files:
LocalServices.pm
Log Message:
added two GO traversal routines - get parents and get children
moby-live/Perl/scripts/Services LocalServices.pm,1.59,1.60
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm 2004/02/09 23:27:34 1.59
+++ /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm 2004/02/10 01:10:45 1.60
@@ -261,6 +261,81 @@
return SOAP::Data->type('base64' => (responseHeader("illuminae.com") . $MOBY_RESPONSE . responseFooter));
}
+sub getSHoundGODBGetParentOf { # 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("GO"); # 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!
+ # GO id's should not, but sometimes may begin with the GO: namespace... get rid of this, and the leading 0's for SeqHound
+ $identifier =~ s/^GO://;
+ $identifier =~ s/^0+//;
+ (($MOBY_RESPONSE .= collectionResponse([], "", $qID)) && next) unless ($namespace eq $validNS);
+ my $GOs = SHoundGODBGetParentOf($identifier);
+ (($MOBY_RESPONSE .= collectionResponse([], "", $qID)) && next) unless ($GOs);
+ my @GOs = split ",", $GOs;
+ my @simples;
+ foreach my $go (@GOs){
+ next unless $go;
+ $go =~ s/\s//g;
+ my $goacc = sprintf("%07d", $go);
+ push @simples, "<Object namespace='GO' id='$goacc'/>";
+ }
+ $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 getSHoundGODBGetChildrenOf { # 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("GO"); # 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!
+ # GO id's should not, but sometimes may begin with the GO: namespace... get rid of this, and the leading 0's for SeqHound
+ $identifier =~ s/^GO://;
+ $identifier =~ s/^0+//;
+ (($MOBY_RESPONSE .= collectionResponse([], "", $qID)) && next) unless ($namespace eq $validNS);
+ my $GOs = getSHoundGODBGetChildrenOf($identifier);
+ (($MOBY_RESPONSE .= collectionResponse([], "", $qID)) && next) unless ($GOs);
+ my @GOs = split ",", $GOs;
+ my @simples;
+ foreach my $go (@GOs){
+ next unless $go;
+ $go =~ s/\s//g;
+ my $goacc = sprintf("%07d", $go);
+ push @simples, "<Object namespace='GO' id='$goacc'/>";
+ }
+ $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) = @_;
More information about the MOBY-guts
mailing list