changeset 3:9838eed606ad draft default tip

planemo upload for repository https://github.com/TGAC/earlham-galaxytools/tree/master/tools/export_to_cluster/ commit 68b62fd9a9d5586ccd539779873af17124b7dbb5
author earlhaminst
date Wed, 09 May 2018 05:52:40 -0400
parents b97775e9fe06
children
files README.rst export_to_cluster.py export_to_cluster.xml
diffstat 3 files changed, 26 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.rst	Wed May 09 05:52:40 2018 -0400
@@ -0,0 +1,17 @@
+Installation
+------------
+
+After installing the ``export_to_cluster`` tool, you need to setup an environment variable to specify the directory where users are expected to save their files. One way to do that is:
+
+1) create a directory called ``EXPORT_DIR_PREFIX`` in your tool dependencies directory (which by default is ``database/dependencies/``, but can be changed in your Galaxy config file)
+2) in this directory, create a file called ``env.sh`` with a content similar to the following template::
+
+       EXPORT_DIR_PREFIX=/PATH/WHERE/TO/SAVE/FILES; export EXPORT_DIR_PREFIX
+
+3) create a symlink called ``default`` inside the ``EXPORT_DIR_PREFIX`` directory pointing to the same directory, e.g.::
+
+       $ cd TOOL_DEPENDENCIES_DIR/EXPORT_DIR_PREFIX/
+       $ ln -s . default
+
+Alternatively, you could define the ``EXPORT_DIR_PREFIX`` environment variable in your ``config/job_conf.xml`` file for the destination where the ``export_to_cluster`` tool is going to run (for an example, see ``_JAVA_OPTIONS`` in ``config/job_conf.xml.sample_advanced``), but this would define the environment variable also for all the other tools that use that destination (normally not a problem, but worth to mention).
+
--- a/export_to_cluster.py	Fri Mar 24 12:20:48 2017 -0400
+++ b/export_to_cluster.py	Wed May 09 05:52:40 2018 -0400
@@ -24,11 +24,11 @@
 real_export_dir = os.path.realpath(options.export_dir)
 dir_prefix = options.dir_prefix.rstrip(os.sep)
 if not real_export_dir.startswith(dir_prefix):
-    raise Exception("%s must be a subdirectory of %s" % (options.export_dir, dir_prefix))
+    raise Exception("'%s' must be a subdirectory of '%s'" % (options.export_dir, dir_prefix))
 if not os.path.exists(real_export_dir):
-    raise Exception("%s does not exist or it is not accessible by the Galaxy user" % options.export_dir)
+    raise Exception("'%s' directory does not exist or it is not accessible by the Galaxy user" % options.export_dir)
 if not os.path.isdir(real_export_dir):
-    raise Exception("%s is not a directory" % options.export_dir)
+    raise Exception("'%s' is not a directory" % options.export_dir)
 
 dataset_paths = args[::3]
 dataset_names = args[1::3]
--- a/export_to_cluster.xml	Fri Mar 24 12:20:48 2017 -0400
+++ b/export_to_cluster.xml	Wed May 09 05:52:40 2018 -0400
@@ -1,16 +1,14 @@
-<tool id="export_to_cluster" name="Export datasets to cluster" version="0.0.1">
+<tool id="export_to_cluster" name="Export datasets to cluster" version="0.0.2">
     <requirements>
         <requirement type="set_environment">EXPORT_DIR_PREFIX</requirement>
     </requirements>
-    <command detect_errors="aggressive">
-<![CDATA[
+    <command detect_errors="aggressive"><![CDATA[
 python '$__tool_directory__/export_to_cluster.py' -d '$export_dir' -p "\$EXPORT_DIR_PREFIX"
 #for $d in $datasets
-    '${d}' '${d.hid}: ${d.name}' '${d.ext}'
+    '${d}' '${d.hid}: ${d.element_identifier}' '${d.ext}'
 #end for
 > '$log'
-]]>
-    </command>
+    ]]></command>
     <inputs>
         <param name="datasets" type="data" format="data" multiple="true" label="Datasets to export" />
         <param name="export_dir" type="text" value="" label="Directory where to export the datasets" help="Must be writable by the Galaxy user">
@@ -23,8 +21,8 @@
     </outputs>
     <tests>
     </tests>
-    <help>
+    <help><![CDATA[
 Simple tool to copy datasets to a directory on the cluster.
-    </help>
+    ]]></help>
     <citations/>
 </tool>