diff trinity.xml @ 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
line wrap: on
line diff
--- 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">