[Bioperl-guts-l] bioperl commit

Lincoln Stein lstein at pub.open-bio.org
Wed Jun 23 17:48:38 EDT 2004


lstein
Wed Jun 23 17:48:38 EDT 2004
Update of /home/repository/bioperl/bioperl-live/Bio/DB
In directory pub.open-bio.org:/tmp/cvs-serv27473/Bio/DB

Modified Files:
	WebDBSeqI.pm 
Log Message:
the retry code seems to be working now

bioperl-live/Bio/DB WebDBSeqI.pm,1.38,1.39
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/DB/WebDBSeqI.pm,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- /home/repository/bioperl/bioperl-live/Bio/DB/WebDBSeqI.pm	2004/06/22 23:43:10	1.38
+++ /home/repository/bioperl/bioperl-live/Bio/DB/WebDBSeqI.pm	2004/06/23 21:48:38	1.39
@@ -724,19 +724,22 @@
   my $child = open (FETCH,"-|");
   $self->throw("Couldn't fork: $!") unless defined $child;
 
+  my $is_fasta = $self->request_format eq 'fasta';
+
   if ($child) { # in parent
-    local ($/) = "//\n";  # assume genbank/swiss format
+    local ($/) =  $is_fasta ? ">" : "//\n";  # assume genbank/swiss format
     $| = 1;
     my $records = 0;
     while (my $record = <FETCH>) {
+      chomp;
+      next unless $record;
       $records++;
       $self->postprocess_data('type'     => 'string',
 			      'location' => \$record);
-      print STDOUT $record;
+      print STDOUT $is_fasta ? ">$record" : "$record//\n";
     }
     $/ = "\n"; # reset to be safe;
-    close(FETCH);
-    close STDOUT;
+    close FETCH;
     return $records;
   }
   else {



More information about the Bioperl-guts-l mailing list