[Bioperl-l] standaloneblast executable location?

Jason Stajich jason at cgt.duhs.duke.edu
Thu Nov 13 18:25:08 EST 2003


On Fri, 14 Nov 2003, Wes Barris wrote:

> Hi,
>
> I am using Bio::Tools::Run::StandAloneBlast.  The only thing that I have
> been having trouble with is telling it where my "blastall" executable
> is located.  If I set this environment variable outside of the bioperl
> script it works:
>
> setenv BLASTDIR /usr/local/blast2.0
>
> However, I want this script to be self contained and have everything set
> from inside the script.  I have tried the following inside the script,
> but none of them work:
>
> BEGIN {$ENV{'BLASTDIR'} = '/usr/local/blast2.0';}
>
> $ENV{'BLASTDIR'} = '/usr/local/blast2.0';
>
> my $PROGRAMDIR = '/usr/local/blast2.0';
>
> In all cases (unless I set the BLASTDIR outside of the script), I get
> this error:

So you need to put the env setting BEFORE the 'use StandAloneBlast'
use strict;
BEGIN {$ENV{'BLASTDIR'} = '/usr/local/blast2.0';}
use Bio::Tools::Run::StandAloneBlast;


This is because at compile time BLASTDIR envvariable is used to set the
$PROGRAMDIR in StandAloneBlast

Doing this
$Bio::Tools::Run::StandAloneBlast::PROGRAMDIR='/usr/local/blast2.0';
will also work I think.


-jason

> ---------------------------------------------------
>
> Here is a portion of my code:
>
> #!/usr/local/bin/perl -w
> #
> use strict;
> use Bio::Tools::Run::StandAloneBlast;
> #BEGIN {$ENV{'BLASTDIR'} = '/usr/local/blast2.0';}
> #my $PROGRAMDIR = '/usr/local/blast2.0';
> my $usage = "Usage: $0 <fasta.txt>\n";
> my $infile = shift or die $usage;
> my $seq_in = Bio::SeqIO->new(-format=>'fasta', -file=>$infile);
> my $seq = $seq_in->next_seq;
> my @params = (
>          'program'  => 'blastn',
>          'database' => '/htdocs/db/blast/refseq',
>          );
> my $factory = Bio::Tools::Run::StandAloneBlast->new(@params);
> my $blast_result = $factory->blastall($seq);
>
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list