[Bioperl-l] Bug in StandAloneBlast.pm concerning BLASTDIR-Environmentvariable
Michael Spitzer
michael.spitzer@uni-muenster.de
Mon, 9 Sep 2002 11:21:43 +0200
Hi all!
I found a "bug" in StandAloneBlast.pm, Version "v 1.18.2.6 2002/03/16 18:55:52"
distributed within BioPerl 1.0.2 which prevents users under certain
circumstances to use a locally installed BLAST-executable (by defining
an environment variable "$BLASTDIR").
This bug only shows up under the following circumstances:
- one installs the BLAST-executables locally, eg. "/home/user/bin/blast-exe/"
- there exists a *global* BLAST-installation and its directory is
included in the PATH-environmentvariable, eg. "/usr/bin/blast-exe/".
The following lines from the subroutine "exists_blast()" represent the
"buggy" lines:
if( ($f = Bio::Root::IO->exists_exe($exe)) ||
($f = Bio::Root::IO->exists_exe(Bio::Root::IO->catfile($BLASTDIR, $exe))) ) {
[...more code...]
}
The order of the statements in the if-block produce the buggy behaviour:
if a "global" BLAST-executable is found via
"($f = Bio::Root::IO->exists_exe($exe))"
(which is the case if it's in $PATH) this one is used and the one desired
by the user is simply omitted from the search for the executable. The part
($f = Bio::Root::IO->exists_exe(Bio::Root::IO->catfile($BLASTDIR, $exe)))
is not tackled anymore if the first condition is true.
IMO the following behaviour would be more desireable (well, I "fixed" this
to fit my needs, anyway ;-):
- first look for a locally installed BLAST-executable
- if none is found, look for a globally installed one
and this can be achieved by just exchanging the two conditional blocks:
if (($f = Bio::Root::IO->exists_exe(Bio::Root::IO->catfile($BLASTDIR, $exe))) ||
($f = Bio::Root::IO->exists_exe($exe))) {
[...more code...]
}
A "copy" of this mail goes into the Bug-Tracking system.
Bye, Micha