[Bioperl-l] problem reading multiple sequence fasta files

Adam Witney witneya@nmrc.navy.mil
Thu, 15 Feb 2001 10:14:02 -0500


Hi,

I am new to using BioPerl. I downloaded bioperl-0.6.2 the other day and set
about using it. I tried the simple example in biostart.pod, basically this

  #!/usr/local/bin/perl

  use Bio::Seq;
  use Bio::SeqIO;

  $seqin = Bio::SeqIO->new( '-format' => 'Fasta' , -file => 'myfile.dat');

  while((my $seqobj = $seqin->next_seq())) {
        print "Seen sequence ",$seqobj->display_id,", start of seq ",
               substr($seqobj->seq,1,10),"\n";
   }

however I was unable to read multiple sequence Fasta files with this (it
would only display the result for the first sequence). I fixed the problem
by uncommenting this part from Fasta.pm (in next_primary_seq, line 103)

   my $next_rec = $entry;
   while( $next_rec =~ /(^|.)>$/) {
       # Jason applying HL's patch from 25/05/2000
       # (on 02/10/2000)
       # a greater sign not preceded by a newline indicates that there is a
       # '>' within the description, so we need more to complete the record
       return unless defined($next_rec = $self->_readline);
       $entry .= $next_rec;
   }

so was I doing something wrong in the first place, or is this a known
problem?

thanks

adam


Adam Witney MSc PhD,
Malaria Program (IDD),
Naval Medical Research Center,
503 Robert Grant Avenue, Rm. 3A40
Silver Spring, MD  20910-7500

Tel: 301 319 7564
Fax: 301 319 7545