[Bioperl-l] error parsing -m8 blast output

Jason Stajich jason.stajich at duke.edu
Tue May 17 15:27:49 EDT 2005


This works great for me on 1.5.0 branch and the HEAD code on Linux  
and OSX.  I am running perl 5.8.6 on OSX.

use Bio::SearchIO;
use strict;
use warnings;
my $file='test.out';
my $parser = new Bio::SearchIO(-file => $file, -format => 'blasttable');
while( my $result = $parser->next_result ) {
     while( my $hit = $result->next_hit ) {
     my $n = 1;
     while( my $hsp = $hit->next_hsp ) {
         printf "query=%s hit=%s HSP=%d bitscore=%s\n",
         $result->query_name,
         $hit->name,
         $n++, $hsp->bits;
     }
    }
}

Please not that the Hit object will not have any score or  
significance data because -m8/-m9 output is just HSPs.  Perhaps that  
is the problem, I don't see any part of your example code where you  
are even printing the bitscore so I can't really tell how you got to  
the specific error message.


You'll probably want to make sure that you aren't dealing with mixed  
versions on your machine.
% perl -MBio::SearchIO::blasttable -e 'print  
$Bio::SearchIO::blasttable::VERSION, "\n"'

and see the Revision
% perldoc -m Bio::Search::Hit::GenericHit | grep \$Id
   (I have 1.2)
% perldoc -m Bio::SearchIO::blasttable | grep \$Id
   (I have 1.34)

-jason

On May 17, 2005, at 10:01 AM, Arya Akmal wrote:

> use Bio::SearchIO;
> >$file='test.out';
> >$parser = new Bio::SearchIO(-file => $file, -format => 'blasttable');
> >$result = $parser->next_result;
>

--
Jason Stajich
jason.stajich at duke.edu
http://www.duke.edu/~jes12/




More information about the Bioperl-l mailing list