Bioperl: Bio::Tools::Blast->new on sequence file w/no hits, throws fatal exception. Any ideas?
Michael Lonetto
lonettma@mh.us.sbphrd.com
Fri, 28 May 1999 09:40:23 -0400 (EDT)
Dear Steves,
I agree with Steve Brenner on this: the absence of hits below a significance
level is often one of the things I'm looking for when I parse a stream of blast
results for, say, all the orfs in one genome compared to all the orfs in a
closely related species. I thus have to deal with the "no hits" by trapping
exceptions instead of querying the object. Other exceptions on our system arise
from failed automounts, machines crashing, etc. This requires very different
handling than the no-hits case.
Michael_A_Lonetto@sbphrd.com lonettma@mh.us.sbphrd.com
SmithKline Beecham Pharmaceuticals R&D
On Thu, 27 May 1999, Steven E. Brenner wrote:
> Steve,
>
> > You might wonder: why does the blast object throw an exception when
> > I gave it a perfectly valid, parsable blast report? Well, when you
> > specify a -signif criterion, you are adding a requirement that the
> > blast object should only contain hits at or below the indicated
> > significance value. Since hits are the raison d'etre of a parsed blast
> > object, the object dies since it cannot attach any hits to itself (am
> > I personifying the blast object too much?).
>
> I am afraid I have to disagree with your logic here. I think that finding
> nothing is a perfectly valid behavior. It doesn't seem reasonable to me
> that it would throw an exception.
>
> An exception would indicate (to me) that the operation failed in some
> technical way (e.g., the file wasn't found; the file was corrupted).
>
>
> > Throwing an exception guarantees that a blast object won't be used any
> > further. It also provides a convenient screen, since you know that
> > every object created will have at least one hit at or below your
> > -signif cutoff.
>
> This does not seem a convenient screen to me! This lumps illegal calls
> (to bad or missing files) with valid calls on files with no matches. I
> would much rather have the exception status indicate whether or not the
> parsing worked. It's easy to check for matches later.
>
>
> > BTW, I'd strongly recommend using the above eval {} strategy when
> > doing any reasonably complex operation in a situation where an
> > exception could halt a long-running script prematurely. It's a good
> > "safe scripting" practice.
>
> Agreed. But an exeception should basically only be thrown when the
> program cannot continue in its documented manner. (Hence, the need for an
> exeption to the standard behavior.) Finding no hits definitely doesn't
> meet this criterion for me.
>
> Steve
>
>
> P.S. No angered Bioperl modules were used in the composition of this message.
>
> =========== Bioperl Project Mailing List Message Footer =======
> Project URL: http://bio.perl.org/
> For info about how to (un)subscribe, where messages are archived, etc:
> http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
> ====================================================================
>
=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
====================================================================