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

Ma, Man Chun John manchunjohn-ma at uiowa.edu
Sat May 8 22:43:11 UTC 2010


Hi Dave,

Yes, I tried to write a separate script to parse all those files, and
they came out fine. It just happens when I run the entire target script;
and if I replace the StandAloneBlast part with the standard RemoteBlast
code, it's file, too.

Cheers, 


John MC Ma
Graduate Assistant
Kwitek Lab
Department of Internal Medicine
3125E MERF
375 Newton Road
Iowa City IA 52242
-----Original Message-----
From: Dave Messina [mailto:David.Messina at sbc.su.se] 
Sent: Saturday, May 08, 2010 5:40 PM
To: Ma, Man Chun John
Cc: BioPerl List
Subject: Re: [Bioperl-l] Array Handling Differences between RemoteBlast
and StandAloneBlast

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