Hi I wrote a script for parsing blast output and get some of the statistics. But while I run the script:
use strict;
use warnings;
use Bio::SearchIO;
use Bio::Search::Tiling::MapTiling;
my $infile = $ARGV[0];
my $in = Bio::SearchIO->new(-format => 'blast', -file => $infile);
my $result = $in->next_result;
my $hit;
while ($hit = $result->next_hit){
my $tiling = Bio::Search::Tiling::MapTiling->new($hit);
my $query_length_tiling = $tiling->length('query');
my $sub_length_tiling = $tiling->length('subject');
my $qid = $tiling->frac_identical('query');
my $qcov = $tiling->percent_identity('query');
print $query_length_tiling."\t".$sub_length_tiling."\t".$qid."\t".$qcov;
print "\n";
}
I am getting this error
--------------------- WARNING ---------------------
MSG: No HSPS present for type 'hit' in context 'p_' for this hit
---------------------------------------------------
Can't use an undefined value as an ARRAY reference at /Library/Perl/5.18/Bio/Search/Tiling/MapTiling.pm line 1135, <GEN1> line 600.
Please help me to resolve this error. Bioperl v1.007001 and BLAST+ 2.2.31
EDIT: Only throws this error when asking to report the methods for 'subject' or 'hit'. For 'query' only, everything works just as expected.
Thank you shyam
I'd print out to stdout the query that's causing this error, then examine a GUI based BLAST output to check on the HSPs.
I tried with different queries with different number of HSPs, it works if I use only the 'query' instead of 'subject' for
I emailed Dr Jensen the developer for this module. Will update when I heard back from him.
Thanks for the suggestion.