[Bioperl-l] negative reading frames in Search/HSP/BlastHSP.pm

Benjamin Berman benb@fruitfly.org
Fri Jan 24 05:30:00 EST 2003


Hi there,

I am using the psiblast module of SearchIO to parse in a tblastn 
report.  I am getting an error when reading the following HSP:
(TBLASTN 2.0MP-WashU [09-Nov-2000] [linux-i686 19:13:41 11-Nov-2000])
> >Contig14810 Contig16142
>         Length = 9451
>
>   Minus Strand HSPs:
>
>  Score = 27 (115.5 bits), Expect = 7.9e-94, Sum P(12) = 7.9e-94, Group 
> = 1
>  Identities = 27/27 (100%), Positives = 27/27 (100%), Frame = -1



This is the error I get:
> ------------- EXCEPTION: Bio::Root::Exception -------------
> MSG: '-1' is not a valid frame
> STACK: Error::throw
> STACK: Bio::Root::Root::throw /Bio/Root/Root.pm:342
> STACK: Bio::SeqFeature::Generic::frame /Bio/SeqFeature/Generic.pm:399
> STACK: Bio::SeqFeature::FeaturePair::frame 
> /Bio/SeqFeature/FeaturePair.pm:257
> STACK: Bio::Search::HSP::BlastHSP::_set_match_stats 
> /Bio/Search/HSP/BlastHSP.pm:861
> STACK: Bio::Search::HSP::BlastHSP::_set_data 
> /Bio/Search/HSP/BlastHSP.pm:710


I haven't read the code very thoroughly, but something in BlastHSP.pm 
seems kind of strange.  The _set_match_stats function is parsing the 
line containing "Frame = **" and just sets $self->frame to whatever ** 
contains, positive or negative.  So in my case, this becomes -1 and 
causes the SeqFeature class to fail:

/Bio/Search/HSP/BlastHSP.pm:861
>     if($data =~ m!Frame = ([\d+-]+)!) {
>       $self->frame($1);
>     }


But in an alternate case, when the "Frame = **" section is on its own 
line, $self->frame is set to the absolute value of **:

/Bio/Search/HSP/BlastHSP.pm:710
> 	} elsif( $line =~ /^ ?Frame = ([\d+-]+)/ ) {
> 	  # Version 2.0.8 has Frame information on a separate line.
> 	  # Storing frame according to SeqFeature::Generic::frame()
> 	  # which does not contain strand info (use strand()).
> 	  my $frame = abs($1) - 1;
> 	  $self->frame( $frame );
>

Why the inconsistency?   Should the first one actually use the absolute 
value too?   I couldn't find any other reports of problems with this, 
which seems strange to me.  Maybe most BLAST versions use the 2.0.8 
style of having the Frame part on its own line?

Thanks in advance for any help,
ben.

-- 
Benjamin Berman
benb@fruitfly.org
Rubin Lab, 539 Life Sciences Addition
Department of Molecular and Cell Biology
University of California, Berkeley CA 94720




More information about the Bioperl-l mailing list