[Bioperl-l] bl2seq error when no alignment
Jason Stajich
jason at cgt.duhs.duke.edu
Tue Jun 3 11:45:54 EDT 2003
I have to preface this with - I do not want to maintain BPbl2seq or BPlite
- all the functionality is part of SearchIO now.
When this module was ported someone didn't try and make it handle the
empty reports problem for some reason.
I can put a fix in which won't cause this to happen, but you can get
around it by doing this with the current code:
#!/usr/bin/perl -w
use Bio::Tools::BPbl2seq;
my $in = new Bio::Tools::BPbl2seq(-report_type => 'BLASTN');
my $sbjct = $in->getSbjct;
if( $sbjct ) {
while( my $feature = $sbjct->nextHSP ) {
# process the feature like you would before
}
} else {
print STDERR "no sbjct\n";
}
-jason
On Tue, 3 Jun 2003, Julio Fernandez Banet wrote:
> Hello.
> I'm parsing bl2seq using BPbl2seq. My problem comes when only of my
> sequences didn't give me any alignment and the program crashes with the
> following error message:
> Can't call method "nextHSP" on unblessed reference at
> /Library/Perl/Bio/Tools/BPbl2seq.pm line 242, <GEN79> line 31.
>
> I place lots of check lines in my code and I the program crashes when
> reaching this line:
> while(my $hsp = $report->next_feature) {
>
> Should I change or add something so the program doesn't crash when there's
> no sequence alignment?.
>
> Thanks a lot for your help.
>
> P.S.
> The file that give the error is:
>
> Query= ABIX Testing -- no comment
> (762 letters)
>
> Lambda K H
> 1.37 0.711 1.31
>
> Gapped
> Lambda K H
> 1.37 0.711 1.31
>
>
> Matrix: blastn matrix:1 -3
> Gap Penalties: Existence: 5, Extension: 2
> Number of Hits to DB: 0
> Number of Sequences: 0
> Number of extensions: 0
> Number of successful extensions: 0
> Number of sequences better than 10.0: 0
> length of query: 762
> length of database: 53,522
> effective HSP length: 13
> effective length of query: 749
> effective length of database: 52,612
> effective search space: 39406388
> effective search space used: 39406388
> T: 0
> A: 30
> X1: 6 (11.9 bits)
> X2: 15 (29.7 bits)
> S1: 12 (24.3 bits)
> S2: 11 (22.3 bits)
>
>
--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu
More information about the Bioperl-l
mailing list