Re: [galaxy-dev] Galaxy 'environment' variables
Dear Jean-François, But thanks for asking again, because now I had to look things up again, and now I found it. :-) Helping other people is apparently a strong drive to learn. The only variables I have found, are following variables below (See alsohttp://wiki.g2.bx.psu.edu/Admin/Tools/Tool%20Config%20Syntax?highlight=%28me...). You can use them in the tool definition file as shown in example below. $GALAXY_HOME : /home/galaxy/galaxy-dist ${GALAXY_DATA_INDEX_DIR} :$GALAXY_HOME/tool-data $__new_file_path__ : universe_wsgi.ini's new_file_path --> temporary directory $__tool_data_path__ : tool_data_path value $__root_dir__ Top-level Galaxy source directory $__datatypes_config__ universe_wsgi.ini's datatypes_config value $__user_id__ Email's numeric ID $__user_email__ User's email address $__app__ (don't know about this one, seems to be deprecated) <http://wiki.g2.bx.psu.edu/Admin/Tools/Tool%20Config%20Syntax?highlight=%28metadata%29#A.3Ccommand.3E_tag_set> An example of what I like to do: I work with a 'configfile' to pass all parameters and galaxy settings to my tool/wrapper. *Tool definition file:* <tool ....> <command interpreter='perl'> my_program.pl $configfile </command> <inputs> ... configure here the inputs ... </inputs> <configfiles> <configfile name="$configfile"> param1==$param1 param2==$param2 ... ##Galaxy Environment Variables tempdir==${__new_file_path__}* *galaxyhome==${GALAXY_HOME} </configfile> </configfiles> <outputs> ... </outputs> <tests> </tests> </tool> *An my program 'my_program.pl' starts like:* #!/usr/bin/perl use strict; #------------ PARSE GALAXY ARGUMENTS # Get file with program parameters and Galaxy settings #---------------------------------------------------------------------------# my $configfile =$ARGV[0]; #------------- PARSE PARAMETERS # Parse parameters from config file #---------------------------------------------------------------------------## my (%para); open(CONFIG,"<$configfile"); while (<CONFIG>) { if (/(\S+)==(.+)$/){ $para{ $1 } = $2 ; } } close(CONFIG); exit 0; So now I have all parameters available in my program, in the hash %para, e.g. $para{'tempdir'}. Quick and easy! I hope this is clear, if not, just ask. Good luck with your implementation, Joachim Joachim Jacob, PhD Rijvisschestraat 120, 9052 Zwijnaarde Tel: +32 9 244.66.34 Bioinformatics Training and Services (BITS) http://www.bits.vib.be @bitsatvib On 05/23/2012 08:26 PM, Jean-Francois Payotte wrote:
Dear Joachim,
I am interested at the exact same thing, such as finding a list of 'environment' variables in Galaxy. Did you ever got your answer?
Best regards, Jean-François
*[galaxy-dev] Galaxy 'environment' variables*
Joachim Jacob Wed, 11 Apr 2012 08:18:46 -0700 Hello all,
Where can I find a list of 'environment' variables in Galaxy, such as: $GALAXY_HOME ${GALAXY_DATA_INDEX_DIR}
More specifically, I am looking for the temporary directory setting of a user's Galaxy (as set in the universe_wsgi.ini).
Kind regards, Joachim
-- Joachim Jacob, PhD
Rijvisschestraat 120, 9052 Zwijnaarde Tel: +32 9 244.66.34 Bioinformatics Training and Services (BITS) _http://www.bits.vib.be_ <http://www.bits.vib.be/> @bitsatvib
participants (1)
-
Joachim Jacob