[Bioperl-l] Errors generated from example code in HOW-TO section

Aaron J Mackey ajm6q at virginia.edu
Fri Aug 1 06:46:51 EDT 2003


Ahem, not so fast:

perl -wle '$e = "e-100"; print $e < "e-10" ? 1 : 0;'
Argument "e-10" isn't numeric in numeric lt (<) at -e line 1.
Argument "e-100" isn't numeric in numeric lt (<) at -e line 1.
0
perl -wle '$e = "e-100"; print $e == "e-10" ? 1 : 0;'
Argument "e-10" isn't numeric in numeric eq (==) at -e line 1.
Argument "e-100" isn't numeric in numeric eq (==) at -e line 1.
1

e-100 (or e-10, or e-anything) is getting turned into 0, since "e-"
doesn't look like a number, the number parsing stops, and you get 0.

-Aaron

On Fri, 1 Aug 2003, Matthew Betts wrote:

>
> Hi,
>
> I recently ran up against the same warning, but was happy to see that perl
> did the comparison correctly anyway
>
> eg. both of the following give the warning, but the first prints out
> $e and the second one doesn't.
>
>   perl -we '$e = "e-169"; ($e < 1.0) and print "$e\n";'
>   perl -we '$e = "e-169"; ($e > 1.0) and print "$e\n";'
>
> Matt
>
>
> > Message: 18
> > Date: Fri, 01 Aug 2003 13:16:37 +1000
> > From: Wes Barris <wes.barris at csiro.au>
> > Subject: [Bioperl-l] Errors generated from example code in HOW-TO
> >         section
> > To: Bioperl Mailing List <bioperl-l at bioperl.org>
> > Message-ID: <3F29DB95.10901 at csiro.au>
> > Content-Type: text/plain; charset=us-ascii; format=flowed
> >
> > The HOW-TO section http://www.bioperl.org/HOWTOs/html/Graphics-HOWTO.html
> > shows examples using this code fragment:
> >
> > while( my $hit = $result->next_hit ) {
> >    next unless $hit->significance < 1.0;
> >    my $feature = Bio::SeqFeature::Generic->new(-score   =>
> > $hit->raw_score,
> >                                                -seq_id => $hit->name,
> >
> > If warnings are turned on, then the 2nd line above produces these errors:
> >
> > Argument "e-171" isn't numeric in numeric lt (<) at blasttoimg.pl line 49,
> > <DATA> line 191.
> > Argument "e-163" isn't numeric in numeric lt (<) at blasttoimg.pl line 49,
> > <DATA> line 191.
> > Argument "e-160" isn't numeric in numeric lt (<) at blasttoimg.pl line 49,
> > <DATA> line 191.
> > Argument "e-160" isn't numeric in numeric lt (<) at blasttoimg.pl line 49,
> > <DATA> line 191.
> > Argument "e-160" isn't numeric in numeric lt (<) at blasttoimg.pl line 49,
> > <DATA> line 191.
> >
> > I would suggest that when parsing a blast file, if the evalue does not
> > begin with a digit, a '1' (one) should be placed at the beginning of the
> > reported evalue.
>
>

-- 
 Aaron J Mackey
 Pearson Laboratory
 University of Virginia
 (434) 924-2821
 amackey at virginia.edu




More information about the Bioperl-l mailing list