Bioperl: Bio::Tools::Blast->new on sequence file w/no hits, throws fatal exception. Any ideas?

Keith Allen allen@deltagen.com
Fri, 28 May 1999 11:22:00 -0700


I'd like to add a related issue into this thread, and that is the
overall problem of handling NCBI Blast2.0x errors.  We run a number
of scripts where sequences are sequentially fed to blast, and then
we do one thing or another with the output stream.  But we were
finding that at some rate blast returns a segfault.  I tried to
trap these events by saying "if $? == 11 print the query and the
blast command string to a logfile", but when I looked at the results
there wasn't anything wrong.  Nor does it fail at a predictable
place in a file containing multiple sequences.  It just happens
at random, and it will even happen at the command line when running
a single sequence.

The solution we came up with is simply to resubmit the blast query
if we get exit status 11 back, up to some reasonable $MAX_RESUBMIT.
I have yet to see it require more than a single resubmit.
But this is an incomplete solution to handling blast errors
because the program takes such a liberal view of what sort of
exit status it should hand back to you.

Consider the following script running NCBI blast 2.0.8 on Solaris 2.6.
The real database is called targetdb, and there is a real file called
"query".

#!/usr/bin/perl

$result = `blastall -pblastn -dtargetdb -iquery -e1E-2`;
print "normal run:  $?\n";

$result = `blastall -pbalstn -dtargetdb -iquery -e1E-2`;
print "balstn:  $?\n";

$result = `blastall -pblastn -dtastdb -iquery -e1E-2`;
print "no db:  $?\n";

$result = `blastall -pblastn -dtargetdb -inoquery -e1E-2`;
print "no query:  $?\n";


This produces the following output on stdout:

____________________________
normal run:  0
[blastall] FATAL ERROR: Only blastn, blastp, blastx, tblastn tblastx is allowed

balstn:  0
[blastall] WARNING: Could not find index files for database tastdb
[blastall] WARNING: Could not find index files for database tastdb
[blastall] WARNING: Could not find index files for database tastdb
no db:  0
[blastall] FATAL ERROR: blast: Unable to open input file noquery

no query:  0
_____________________________


I see two fatal errors here, and a third that certainly ought to be considered
fatal, since it prevents the program from running, but they all return
an exit status of 0.  Not to be critical of the nice folks at NCBI, but
this is not the behaviour I would have expected, and it means the exit
status is of no value for making sure the job went as expected.  You
either have to capture and parse STDERR, or parse the blast output (which
is what we do) to make sure things went OK.

How is this stuff being handled in the current blast modules?  I haven't
run through this stuff with WUBlast, is it handled any better?


					-Keith Allen



-----------------------------------------
Keith Allen, PhD
Bioinformatics Specialist
Deltagen, Inc
1031 Bing St.
San Carlos, CA 94070
650 610-6826


=========== 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
====================================================================