[Bioperl-l] Inhereting environmental variables
david coornaert
dcoorna@dbm.ulb.ac.be
Mon, 09 Dec 2002 12:01:32 +0100
I ran into similar troubles
The only way around I found was using the "BEGIN block" as such :
#!/usr/bin/perl -w
BEGIN {
$ENV{BLASTDIR}='/opt/blast225/';
$ENV{BLASTDATADIR}='/home/dcoorna/db/';
}
use Bio::SeqIO;
use Bio::SearchIO;
use Bio::Tools::Run::StandAloneBlast;
...SNIP...
just my two €cents
David.
Andy Nunberg wrote:
>Hi,
>I am running a script(pipeline.pl)with my own subroutine(blast_and_parse)
>which calls StandAloneBlast.pm. If I change the environmental variable
>BLASTDB in the script, StandAloneBlast does not see the change. Is this a
>perl or bioperl issue??
>Andy
>
>pipeline.pl
>#!/usr/bin/perl -w
>use strict;
>use Pipeline;
>if ( -d "local copy"){
> $ENV{'BLASTDB'}='/localcopy';
>}else{
> $ENV{'BLASTDB'}='/sharedcopy';
>}
>....
>blast_and_parse(fasta_file);
>....
>
>Pipeline.pm
>blast_and_parse {
>.....
>warn "blast db' s are in $ENV{'BLASTDB'}....\n";##this is show the changes
>made in the script
>$blast_report=$factory->blastall($seq);
>....
>}
>
>StandAloneBlast will throw an exception showing the $BLASTDB set in
>.bash_profile or whatever it is set to in the shell rather than what it is
>set in the script(because the .bash_profile setting now has no databases in
>it).
>
>*******************************************************************
>Andy Nunberg, Ph.D
>Computational Biologist
>Orion Genomics, LLC
>(314) 615-6989
>http://www.oriongenomics.com
>
>
>_______________________________________________
>Bioperl-l mailing list
>Bioperl-l@bioperl.org
>http://bioperl.org/mailman/listinfo/bioperl-l
>
>
>
>