diff trinity.xml @ 29:d5e8807a407d draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/trinity commit 9f23ced8d1f5a7ddf96e5f6cb608f3de8fc76250"
author iuc
date Thu, 04 Nov 2021 21:36:57 +0000
parents 48636f857c4b
children 3772d9a10f27
line wrap: on
line diff
--- a/trinity.xml	Fri Sep 10 22:46:16 2021 +0000
+++ b/trinity.xml	Thu Nov 04 21:36:57 2021 +0000
@@ -1,10 +1,13 @@
-<tool id="trinity" name="Trinity" version="@WRAPPER_VERSION@+galaxy1">
+<tool id="trinity" name="Trinity" version="@WRAPPER_VERSION@+galaxy2">
     <description>de novo assembly of RNA-Seq data</description>
     <expand macro="bio_tools"/>
     <macros>
         <import>macros.xml</import>
     </macros>
-    <expand macro="requirements" />
+    <expand macro="requirements">
+        <requirement type="package" version="8.32">coreutils</requirement>
+        <requirement type="package" version="3.2.3">rsync</requirement>
+    </expand>
     <command detect_errors="aggressive"><![CDATA[
         if [ -z "\$GALAXY_MEMORY_MB" ] ; then
             GALAXY_MEMORY_GB=1 ;
@@ -14,7 +17,9 @@
 
         if [ ! -z "\$TRINITY_SCRATCH_DIR" ] ; then
             workdir=`pwd` ;
-            cd "\$TRINITY_SCRATCH_DIR" ;
+            scratchfolder=\$(mktemp -d -p "\$TRINITY_SCRATCH_DIR");
+            emptyfolder=\$(mktemp -d -p "\$TRINITY_SCRATCH_DIR");
+            cd "\$scratchfolder" ;
         fi ;
 
         #if $additional_params.guided.is_guided == "yes":
@@ -146,9 +151,15 @@
 
         &&
 
+        ## Trinity can create millions of files in the same directory, so the cleaning task makes use of rsync
+        ## for ensuring better performances.
+        ## see: https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html
         if [ ! -z "\$TRINITY_SCRATCH_DIR" ] ; then
             mkdir -p "\$workdir/trinity_out_dir";
             cp -p trinity_out_dir/Trinity* "\$workdir/trinity_out_dir";
+            cd "\$TRINITY_SCRATCH_DIR";
+            rsync -a --delete "\$emptyfolder/" "\$scratchfolder/";
+            rmdir "\$emptyfolder" "\$scratchfolder/";
             cd "\$workdir";
         fi ;