[Bioperl-l] SearchIO and WU-BLAST ....

morgarws@mh.us.sbphrd.com morgarws@mh.us.sbphrd.com
Tue, 26 Mar 2002 14:38:15 -0500


I'm having a problem with the SearchIO module and parsing WashU Blast output 
.. The SearchIO parser is skipping groups of HSPs that have been combined, 
i.e. the only HSPs that are found are those where the P(N) is P(1). Is this a 
known problem with SearchIO or have I missed something (likely)? Here is some 
code that doesn't work for hits that have more than 1 HSP combined:

use Bio::SearchIO;

my $searchio = Bio::SearchIO->new('-format' => 'blast',
				  '-file' => 'gbfunc-test.fasta.out');
while (my $result = $searchio->next_result()) {
    
# Get info about the entire report
    print "DB: " .  $result->database_name . "\n";

# get info about each hit
    my ($hit, $hsp);
    while ($hit = $result->next_hit) {
	my $hit_name = $hit->name ;
	my $hit_description = $hit->description;
	my $hit_rawscore = $hit->raw_score;
	my $hit_length = $hit->length;
	my $hit_significance = $hit->significance;
	print "Hit: [$hit_name] [$hit_description]\n      [$hit_rawscore] 
[$hit_length] [$hit_significance]\n";
	
# get info about the hsp(s) of the hit
	while ($hsp = $hit->next_hsp()) {
	    my $hsp_part;
	    my $hsp_percent_id = $hsp->percent_identity();
	    my $hsp_length = $hsp->length();
	    print "  HSP: [$hsp_percent_id] [$hsp_length]\n";
	}
    }
}

Regards,

Bill Morgart
morgarws@Molbio.sbphrd.com