[Bioperl-l] Array Handling Differences between RemoteBlast and StandAloneBlast

Dave Messina David.Messina at sbc.su.se
Sat May 8 22:40:22 UTC 2010


Hi John,

Your blast report works fine for me with the following code taken from the Bio::SearchIO HOWTO:

#!usr/bin/perl                                                                  

use strict;
use warnings;
use Bio::SearchIO;

my $in = Bio::SearchIO->new('-file' => 'blastout', '-format' => 'blast');

while(my $result = $in->next_result) {
    while (my $hit = $result->next_hit) {
        while (my $hsp = $hit->next_hsp) {
            print "Query=",   $result->query_name,
            " Hit=",        $hit->name,
            " Length=",     $hsp->length('total'),
            " Percent_id=", $hsp->percent_identity, "\n";
        }
    }
}


## Here is the output:
Query=F Hit=ref|NC_005116.2|NC_005116 Length=27 Percent_id=100
Query=F Hit=ref|NC_005117.2|NC_005117 Length=18 Percent_id=100
Query=F Hit=ref|NC_005105.2|NC_005105 Length=18 Percent_id=100
Query=R Hit=ref|NC_005116.2|NC_005116 Length=27 Percent_id=100


Dave



More information about the Bioperl-l mailing list