changeset 19:cee61b3fcf78 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/trinity commit 5098e1bf7037e204f24fa1cbf7c3749bf0779550
author iuc
date Mon, 22 Jan 2018 11:26:29 -0500
parents d3b1249af60c
children 171b827eadf2
files README.rst trinity.xml
diffstat 2 files changed, 23 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/README.rst	Tue Dec 19 04:21:46 2017 -0500
+++ b/README.rst	Mon Jan 22 11:26:29 2018 -0500
@@ -9,7 +9,7 @@
 By default, this tool is configured to limit the memory consumption to 1G.
 You might need to lower this limit if the machine(s) executing the jobs have less memory available.
 If you have a lot of reads to assemble and a machine with enough memory, you can increase it.
-In both cases, you can set the TRINITY_MAX_MEMORY environmental variable in the destination section of the job_conf.xml file::
+In both cases, you can set the GALAXY_MEMORY_MB environmental variable in the destination section of the job_conf.xml file::
 
     <?xml version="1.0"?>
     <!-- A sample job config that explicitly configures job running the way it is configured by default (if there is no explicit config). -->
@@ -22,7 +22,7 @@
         </handlers>
         <destinations>
             <destination id="local" runner="local">
-                <env id="TRINITY_MAX_MEMORY">1G</env>
+                <env id="GALAXY_MEMORY_MB">1G</env>
             </destination>
         </destinations>
     </job_conf>
--- a/trinity.xml	Tue Dec 19 04:21:46 2017 -0500
+++ b/trinity.xml	Mon Jan 22 11:26:29 2018 -0500
@@ -5,6 +5,17 @@
     </macros>
     <expand macro="requirements" />
     <command detect_errors="aggressive"><![CDATA[
+        if [ -z "\$GALAXY_MEMORY_MB" ] ; then
+            GALAXY_MEMORY_GB=1 ;
+        else
+            GALAXY_MEMORY_GB=\$((GALAXY_MEMORY_MB / 1024)) ;
+        fi ;
+
+        if [ ! -z "\$TRINITY_SCRATCH_DIR" ] ; then
+            workdir=`pwd` ;
+            cd "\$TRINITY_SCRATCH_DIR" ;
+        fi ;
+
         #if $additional_params.guided.is_guided == "yes":
             ln -s '${$additional_params.guided.genome_guided_bam}' 'localbam.bam' &&
             ln -s '${$additional_params.guided.genome_guided_bam.metadata.bam_index}' 'localbam.bam.bai' &&
@@ -84,9 +95,18 @@
         #end if
 
         ## CPU and butterfly options.
-        --CPU \${GALAXY_SLOTS:-4} --max_memory \${TRINITY_MAX_MEMORY:-1G} --bflyHeapSpaceMax \${TRINITY_MAX_MEMORY:-1G} --bfly_opts '-V 10 --stderr'
+        --CPU \${GALAXY_SLOTS:-4} --max_memory \${GALAXY_MEMORY_GB:-1}G --bflyHeapSpaceMax \${GALAXY_MEMORY_GB:-1}G --bfly_opts '-V 10 --stderr'
 
         ## > $trinity_log 2>&1
+
+        &&
+
+        if [ ! -z "\$TRINITY_SCRATCH_DIR" ] ; then
+            mkdir -p "\$workdir/trinity_out_dir";
+            cp -p trinity_out_dir/Trinity* "\$workdir/trinity_out_dir";
+            cd "\$workdir";
+        fi ;
+
     ]]></command>
     <inputs>
         <conditional name="inputs">