bioperl MapTiling error
1
0
Entering edit mode
7.8 years ago
Shyam ▴ 150

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

blast bioperl • 1.7k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode
7.4 years ago

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 https://github.com/bioperl/bioperl-live/issues that would be great.

MAJ

ADD COMMENT

Login before adding your answer.

Traffic: 1988 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6