For Power-Users‎ > ‎

4. Wrapping a tool in FACE-IT

This section will go through the steps required to add an application. The application we'll be working with is called "clim_anomaly".
  1. SSH into as the galaxy user. If you need access, please send a request to the faceit mailing list.

  2. Every tool needs a unique directory for each available version. Create a directory for your tool in /mnt/galaxyTools:

       $ mkdir /mnt/galaxyTools/clim_anomaly
       $ mkdir /mnt/galaxyTools/clim_anomaly/1.0.0

  3. Every tool should have a default version. Run the following command in the clim_anomaly directory to a default symlink:

       $ ln -s 1.0.0 default

  4. Copy your tools into the /mnt/galaxyTools/clim_anomaly/1.0.0 directory.

  5. Every tool needs an script. The script adds your application directory to $PATH. It also ensures libraries are available to your application. The clim_anomaly example uses Java, and therefore needs to set $CLASSPATH. Here is the new /mnt/galaxyTools/clim_anomaly/1.0/ file:

       $ cat /mnt/galaxyTools/clim_anomaly/1.0.0/
       export PATH=/mnt/galaxyTools/clim_anomaly/1.0.0:$PATH
       export CLASSPATH=/mnt/galaxyTools/clim_anomaly/1.0.0:$CLASSPATH

  6. Next, create a directory for your Galaxy wrapper. The wrapper directories are located in 

       $ mkdir 



  7.  Create a Galaxy wrapper in your Galaxy wrapper directory. If you haven't already, please take a few minutes to read about how to do this from the Galaxy documentation.

  8. Add requirements to the Galaxy wrapper. This will tell Galaxy to grab the tools from the /mnt/galaxyTools directory you created. Example:

        <requirement type="package">clim_anomaly</requirement>
        <requirement type="package">R</requirement>

    Every application will at least need to require itself. Some scripts will have additional requirements, like in this case, where clim_anomaly requires R.

  9. The command line in your wrapper should always assume that the executable you're running is available in your path. Here is the full wrapper:

    <tool id="clim_anomaly" name="Plot Climate Scenarios Anomaly">
    <description>Climate Anomaly for Scenarios</description>
    <requirement type="package">clim_anomaly</requirement>
    <requirement type="package">R</requirement>
    <command> $futureacebdata $baseacebdata $climate_variable $pngoutput</command>
    <param name="futureacebdata" type="data" format="json" label="Input future Survey Data" />
    <param name="baseacebdata" type="data" format="json" label="Input baseline Survey Data" />
    <param name="climate_variable" type="select" label="Climate Variable">
    <option value="TMAX">Maximum Temperature (TMAX)</option>
    <option value="TMIN">Minimum Temperature (TMIN)</option>
    <option value="SRAD">Solar Radiation (SRAD)</option>
    <option value="RAIN">Precipitation (PRCP)</option>
    <data format="png" name="pngoutput" label="Climate Scenario Anamoly"/>

  10. Edit /opt/galaxy/tool_conf.xml and add a reference to the new wrapper you just created. More information about this is included in the Galaxy documentation. We wanted our tool to be created in a new section of tools, so we added the following lines:

    <section id="ria" name="RIA">
       <tool file="clim_anomaly/clim_anomaly.xml" />
Restart galaxy by running 'sudo /etc/init.d/galaxy restart' and you should see your tool available.