[Bioperl-l] Re: Bio::Species validation broken
Steve Chervitz
sac@bioperl.org
Fri, 30 Aug 2002 23:44:17 -0700 (PDT)
RestrictionEnzyme.t passes now (branch and trunk).
Steve
--- Hilmar Lapp <hlapp@gnf.org> wrote:
> Fixed and committed. Along the way I replaced t/data/revcomp_mrna.gb
> with a current ensembl download (and truncated after 50 kb). The
> previous version raised an error with the functional validation in
> place due one trailing whitespace at the end of line. Now all tests
> pass except RestrictionEnzyme.t.
>
> -hilmar
>
> On Friday, August 30, 2002, at 12:42 PM, Hilmar Lapp wrote:
>
> > I just came across this by chance as the test case in bioperl-db
> > gave wrong results for binomial, the reason being that the order of
> > @classification on instantiation was reversed, which should have
> > been caught by $species->validate_[species_]name() but wasn't. It
> > turns out these validations are completely broken.
> >
> > First off,
> >
> > return $string =~ /yourregexp here/ or $self->throw("oops");
> >
> > will always return and never throw the exception. (Why? Doesn't
> > look intuitively so, but it is true at least on Perl 5.6.0, Mac OS
> > X). Safe, and more readable is
> >
> > return 1 if $string =~ /yourregexp here/;
> > $self->throw("oops");
> >
> > Second, can anyone explain why the validating regexp for species
> > name was set to be
> >
> > /^[\S\d\.]+$||""/
> >
> > This regexp is not only redundant in itself, it also matches every
> > possible string.
> >
> > I'm going to fix this now, expect exceptions to be thrown finally ...
> >
> > -hilmar
> > --
> > -------------------------------------------------------------
> > Hilmar Lapp email: lapp at gnf.org
> > GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
> > -------------------------------------------------------------
> >
> >
> --
> -------------------------------------------------------------
> Hilmar Lapp email: lapp at gnf.org
> GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
> -------------------------------------------------------------
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
=====
Steve Chervitz
sac@bioperl.org
__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com