Greg, Pablo,

I'm using a SnpEffect repository 'snpeff_with_dep'  in
to test using tool_dependencies.xml with the <set_environment> tag.
( You both write access, if you want to use this for correcting my errors or 
debugging. )

I'm getting an error in prepare_for_install:

|{'set_environment': [{'type': 'environment variable', 'name': 
'JAVA_JAR_PATH'}], 'snpEff/3.0f': {'readme': '\n        ', 'version': '3.0f', 
'type': 'package', 'name': 'snpEff'}}|
*TypeError: list indices must be integers, not str*

It appears that the requirements_dict for the set_environment tag is enclosed 
in an array.
I haven't yet looked at the repository code to see how that might happen.


The  repository should probably 
have versions packaged for download named like:

  $ tar ztvf snpEff_3_0.tgz
  drwxrwxrwx  0 0      0           0 Aug 23 12:17 snpEff_3_0/
  -rwxrwxrwx  0 0      0    14298767 Aug 23 12:17 snpEff_3_0/SnpSift.jar

That will allow versioning within galaxy, and successive versions of 
tool_dependencies.xml with only need a change to the action tag: download_by_url



I'm trying to test a repository that use  in tool_depen
Message: 18
Date: Thu, 13 Sep 2012 11:46:32 -0400
From: Greg Von Kuster<>
To: David Hoover<>
Subject: Re: [galaxy-dev] environment variables and paths for toolshed
Content-Type: text/plain; charset="us-ascii"

Hello David,

I've just committed change set 7656:6aadac8026cb to the Galaxy central 
repository that provides the ability to do what you need here.  It would be 
great if you could try things out and let me know if you run into any problems.

I've been working with nikhil-joshi's deseq_and_sam2counts repository in the 
main Galaxy tool shed because his tools require this new feature as well.  This 
example should provide you with the information you'll need to tweak your tool 
shed repository so that your tool dependencies are located where they get 
installed rather than attempting to move them to ${GALAXY_DATA_INDEX_DIR} or 
some other location.

Here is the tool_dependency.xml file entry for locating a directory referred to 
by an environment variable name R_SCRIPT_PATH.

<?xml version="1.0"?>
     <set_environment version="1.0">
         <environment_variable name="R_SCRIPT_PATH" 

The <set_enviroment> tag, is still supported inside <package> tag sets, but 
when defined at the xml root level, it will locate dependencies included in the installed 
tool shed repository.  Of course, the above tool_dependencies.xml file could of course also 
include entries for tool dependencies that are packages, For example:

<?xml version="1.0"?>
     <set_environment version="1.0">
         <environment_variable name="R_SCRIPT_PATH" 
     <package name="R" version="2.15.1">
         <install version="1.0">
                 <action type="shell_command">./configure 
                 <action type="shell_command">make</action>
                 <action type="set_environment">
                     <environment_variable name="PATH" 
You need a FORTRAN compiler or perhaps f2c in addition to a C compiler to build 

These tool dependency definitions are handled as described in the following 
section of the tool shed wiki:

So in order for the dependencies to be handled when the repository is installed, they must 
be defined in at least one of the <requirement> tag sets in at least 1 tool config in 
the repository.  So, the <requirements> tag set in the deseq.xml tool config file 
will look something like this (there are more requirement tags defined here than in the 
tool_dependencies.xml fiel above, but you should get the idea).

         <requirement type="set_environment">R_SCRIPT_PATH</requirement>
         <requirement type="package" version="2.15.1">R</requirement>
         <requirement type="package" version="2.10">Bioconductor</requirement>
         <requirement type="package" version="1.8.3">DESeq</requirement>
         <requirement type="package" version="1.24.0">aroma.light</requirement>
         <requirement type="package" version="0.20-6">lattice</requirement>

The <command> tag set in the deseq.xml tool config is also slightly altered.  
Here is the way it looks before using this new approach:

<command interpreter="python">
 Rscript ${GALAXY_DATA_INDEX_DIR}/deseq.R $counts $column_types 
$comparison $top_table $diagnostic_html "$diagnostic_html.files_path" 

To use this new feature, the command string now uses the R_SCRIPT_PATH 
environment variable ( notice the required backslash to escape the $ )

<command interpreter="python"> Rscript \$R_SCRIPT_PATH/deseq.R $counts $column_types $comparison $top_table 
$diagnostic_html "$diagnostic_html.files_path" "$"

When installed from the tool shed, a tool dependency object named R_SCRIPT_PATH 
will be created and associated with the installed repository.  The dependency 
will have a pointer to the file that is created to set the value of the 
R_SCRIPT_PATH environment variable.

Let me know if you bump into any issues in getting this working for your tools.


Greg Von Kuster

On Sep 12, 2012, at 1:00 PM, David Hoover wrote:

Are there any environment variables that are honored by toolshed installed 
tools?  I tried creating a tool that uses ${GALAXY_DATA_INDEX_DIR} or 
$GALAXY_HOME, then uploaded it the test toolshed, then installed it 
automatically.  Neither of these resolved to what I expected.  I don't want to 
hard-code the path in the xml tool file, but rather have a default location for 
other executables and jar files.  How should this best be done?

David Hoover
Helix Systems Staff
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

Reply via email to