[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Thu Jul 10 03:13:43 UTC 2003


mwilkinson
Wed Jul  9 23:13:43 EDT 2003
Update of /home/repository/moby/moby-live/Perl/scripts/Services
In directory pub.open-bio.org:/tmp/cvs-serv1671/Perl/scripts/Services

Modified Files:
	LocalServices.pm 
Log Message:
yeah yeah, I register services with a bug.  Sue me :-) 

moby-live/Perl/scripts/Services LocalServices.pm,1.6,1.7
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm	2003/07/10 02:16:17	1.6
+++ /home/repository/moby/moby-live/Perl/scripts/Services/LocalServices.pm	2003/07/10 03:13:43	1.7
@@ -73,6 +73,10 @@
 	my @input_nodes = $self->_getSimpleChildNodes($data);
 	@accessions = $self->_getIDs("NCBI_Acc", \@input_nodes);
 	foreach (@accessions){
+		unless (defined $_){
+			$response .= simpleResponse("");
+			next;
+		}
 		use Bio::DB::GenBank;
 		my $gb = new Bio::DB::GenBank;
 		my $seq = $gb->get_Seq_by_acc($_);
@@ -100,6 +104,10 @@
 	my @input_nodes = $self->_getSimpleChildNodes($data);
 	@accessions = $self->_getIDs("NCBI_Acc", \@input_nodes);
 	foreach (@accessions){
+		unless (defined $_){
+			$response .= simpleResponse("");
+			next;
+		}
 		use Bio::DB::GenBank;
 		my $gb = new Bio::DB::GenBank;
 		my $seq = $gb->get_Seq_by_acc($_);
@@ -128,6 +136,10 @@
 	my @input_nodes = $self->_getSimpleChildNodes($data);
 	@accessions = $self->_getIDs("NCBI_gi", \@input_nodes);
 	foreach (@accessions){
+		unless (defined $_){
+			$response .= simpleResponse("");
+			next;
+		}
 		use Bio::DB::GenBank;
 		my $gb = new Bio::DB::GenBank;
 		my $seq = $gb->get_Seq_by_gi($_);
@@ -153,8 +165,12 @@
     my $response; my @accessions;
 
 	my @input_nodes = $self->_getSimpleChildNodes($data);
-	@accessions = $self->_getGenbankGI("NCBI_gi", \@input_nodes);
+	@accessions = $self->_getIDs("NCBI_gi", \@input_nodes);
 	foreach (@accessions){
+		unless (defined $_){
+			$response .= simpleResponse("");
+			next;
+		}
 		use Bio::DB::GenBank;
 		my $gb = new Bio::DB::GenBank;
 		my $seq = $gb->get_Seq_by_gi($_);  # get the sequence object for each gi
@@ -185,32 +201,37 @@
 	return undef unless scalar @{$input_nodes};
 	my @input_nodes = @{$input_nodes};
 	
+	
 	my @accessions;	
-	foreach (@input_nodes){
-		my $ns = $_->getAttributeNode('namespace');  # get the namespace DOM node
-		$ns = $_->getAttributeNode('moby::namespace') unless ($ns);  # perhaps it is namespaced...
-		unless ($ns){   # if we don't get it at all, then move on to the next input
-			push @accessions, undef;  # but push an undef onto teh stack in order
-			next;
-		}
-		$ns = $ns->getValue;   # if we have a namespace, then get its value
-		unless ($ns eq $desired_namespace){  # we are registering as working in a particular namespace, so check this
-			push @accessions, undef;  # and push undef onto the stack if it isn't 
-			next;
-		}
-		# Now do the same thing for ID's
-		my $id = $_->getAttributeNode('id');
-		$id = $_->getAttributeNode('moby::id') unless ($id);
-		unless ($id){
-			push @accessions, undef;
-			next;
-		}
-		$id = $id->getValue;
-		unless (defined $id){  # it has to have a hope in hell of retrieving something...
-			push @accessions, undef;  # otherwise push undef onto the stack if it isn't 
-			next;
+	foreach my $in(@input_nodes){
+		#$in = "<Simple><Object namespace='' id=''/></Simple>"
+		my @simples = $in->getChildNodes;
+		foreach (@simples){ # $_ = <Object namespace='' id=''/> 
+			my $ns = $_->getAttributeNode('namespace');  # get the namespace DOM node
+			$ns = $_->getAttributeNode('moby::namespace') unless ($ns);  # perhaps it is namespaced...
+			unless ($ns){   # if we don't get it at all, then move on to the next input
+				push @accessions, undef;  # but push an undef onto teh stack in order
+				next;
+			}
+			$ns = $ns->getValue;   # if we have a namespace, then get its value
+			unless ($ns eq $desired_namespace){  # we are registering as working in a particular namespace, so check this
+				push @accessions, undef;  # and push undef onto the stack if it isn't 
+				next;
+			}
+			# Now do the same thing for ID's
+			my $id = $_->getAttributeNode('id');
+			$id = $_->getAttributeNode('moby::id') unless ($id);
+			unless ($id){
+				push @accessions, undef;
+				next;
+			}
+			$id = $id->getValue;
+			unless (defined $id){  # it has to have a hope in hell of retrieving something...
+				push @accessions, undef;  # otherwise push undef onto the stack if it isn't 
+				next;
+			}
+			push @accessions, $id;
 		}
-		push @accessions, $id;
 	}
 	return @accessions;
 }




More information about the MOBY-guts mailing list