Question: bioperl MapTiling error
gravatar for Shyam
19 months ago by
United States
Shyam120 wrote:

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/ 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

blast bioperl • 546 views
ADD COMMENTlink modified 14 months ago by Mark A. Jensen0 • written 19 months ago by Shyam120

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.

ADD REPLYlink written 19 months ago by RamRS17k

I tried with different queries with different number of HSPs, it works if I use only the 'query' instead of 'subject' for

my $sub_length_tiling = $tiling->length('subject');

I emailed Dr Jensen the developer for this module. Will update when I heard back from him.

Thanks for the suggestion.

ADD REPLYlink modified 19 months ago • written 19 months ago by Shyam120
gravatar for Mark A. Jensen
14 months ago by
Mark A. Jensen0 wrote:

Hi Shyam - I just ran across this by chance, sorry if I didn't see your email.

It has been a long time since I looked at this code, but my guess is that your subject sequence is being matched in its reverse complement (i.e., in the context "m_"), but the default is "p_" in this case. Try

 $tiling->length('subject', 'exact', 'm_')

and see if it succeeds.

The Perl error is a bug on my part; it shouldn't completely bork like that. If you could create an issue at that would be great.


ADD COMMENTlink written 14 months ago by Mark A. Jensen0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1461 users visited in the last hour