[Bioperl-l] SearchIO-BLAST

Bernd Web bernd.web at gmail.com
Tue Aug 21 16:32:09 UTC 2007

Dear all,

Recently, I stumbled on something with parsing BLAST reports.  To a
plain text blast report from NCBI a ">aaa" got prepended. This
(fasta-like header) changes the $result->hits array.
The amount of hits is now 2*num_hits + 1. Clearly, this is related to
faulty input, but still the effect of this line is great. Does someone
see what is causing this, and should the BLAST parser maybe be
slightly more relaxed wrt pre/appended text? I have not seen yet why
this extra fastaheader line has such a "large" effect.

A short example BLASTN output is attached.
Example code is:

use Bio::SearchIO;
my $in = new Bio::SearchIO(-format => 'blast',
                           -file   => 'apoe_plain.bls');
while( my $result = $in->next_result ) {
  print "Num of hits: ", $result->num_hits, "\n";
  my @hits = $result->hits;
  foreach my $el (@hits) {
  	print $el->name, "\n";

Kind regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apoe_plain.bls
Type: application/octet-stream
Size: 7890 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/bioperl-l/attachments/20070821/a367809e/attachment-0004.obj>

More information about the Bioperl-l mailing list