diff recentrifuge.xml @ 1:fe733f05c2f8 draft

planemo upload for repository https://github.com/mesocentre-clermont-auvergne/galaxy-tools/tree/master/tools/recentrifuge commit 9142693589056424fb64869b69dbc08b179f57ee
author iuc
date Fri, 26 Aug 2022 10:57:30 +0000
parents 09b7b0b2e2c2
children b5407cc2bf51
line wrap: on
line diff
--- a/recentrifuge.xml	Mon Jun 27 11:03:22 2022 +0000
+++ b/recentrifuge.xml	Fri Aug 26 10:57:30 2022 +0000
@@ -7,10 +7,28 @@
     <macros>
         <import>macro.xml</import>
     </macros>
+    <expand macro='edam'/>
     <expand macro='xrefs'/>
     <expand macro="requirements" />
     <expand macro="version_command" />
     <command detect_errors="aggressive"><![CDATA[
+      #import re
+      #*======================================
+            Make a dir with all input files
+      ======================================*#
+        mkdir input_dir &&
+        #for $input in $input_file
+            #set input_identifier = re.sub('[^\s\w\-]', '_', str($input.element_identifier))
+            #if $file_type.filetype == "centrifuge"
+                ln -s '$input' 'input_dir/${input_identifier}.out' &&
+            #else if $file_type.filetype == "clark"
+                ln -s '$input' 'input_dir/${input_identifier}.csv' &&
+            #else if $file_type.filetype == "kraken"
+                ln -s '$input' 'input_dir/${input_identifier}.krk' &&
+            #else
+                ln -s '$input' 'input_dir/$input_identifier' &&
+            #end if
+        #end for
         #*======================================
                   database input
         ======================================*#
@@ -19,23 +37,25 @@
         #*======================================
                   Recentrifuge input file
         ======================================*#
+
         #if $file_type.filetype == "centrifuge"
-            -f '$input_file'
+            -f input_dir
+            #set $default_scoring = 'SHEL'
+        #else if $file_type.filetype == "kraken"
+            -k input_dir
+            #set $default_scoring = 'KRAKEN'
+        #else if $file_type.filetype == "clark"
+            -r input_dir
             #set $default_scoring = 'SHEL'
         #else if $file_type.filetype == "lmat"
-            -l '$input_file'
+            -l input_dir
             #set $default_scoring = 'LMAT'
-        #else if $file_type.filetype == "clark"
-            -r '$input_file'
-            #set $default_scoring = 'SHEL'
-        #else if $file_type.filetype == "kraken"
-            -k '$input_file'
-            #set $default_scoring = 'KRAKEN'
         #else if $file_type.filetype == "generic"
-            -g '$input_file'
+            -g input_dir
             --format '$file_type.format'
             #set $default_scoring = 'GENERIC'
         #end if
+
         #*======================================
                   Output options
         ======================================*#
@@ -83,12 +103,12 @@
         #*======================================
                   Log file output
         ======================================*#
-        &> $logfile
+        | tee "$logfile"
         ]]>
     </command>
     <inputs>
         <!-- INPUT FILES -->
-        <param name="input_file" type="data" format="tabular" label="Select taxonomy file tabular formated"/>
+        <param name="input_file" type="data" format="tabular" multiple="true" optional="false" label="Select taxonomy file tabular formated"/>
         <conditional name="file_type">
             <param name="filetype" type="select" display="radio" label="Type of input file (Centrifuge, CLARK, Generic, Kraken, LMAT)" help="(-f, -r, -g, -k, -l)">
                 <option value="centrifuge">Centrifuge</option>
@@ -126,6 +146,7 @@
                 <option value="TSV" >TSV</option>
             </param>
             <param argument="--nohtml" type="boolean" truevalue="--nohtml" falsevalue="" label="Suppress saving the HTML output file" help="remove html output"/>
+            <param name="no_logfile" type="boolean" truevalue="True" falsevalue="False" label="Remove the log file"/>
         </section>
     <!-- ADVANCED OPTIONS -->
         <section name="advanced_option" title="Coarse tuning of algorithm parameters">
@@ -184,7 +205,9 @@
         <data name="html_report" format="html" from_work_dir="output.rcf.html" label="${tool.name} on ${on_string}: html report">
             <filter> output_option['nohtml'] == False</filter>
         </data>
-        <data name="logfile" format="txt" label="${tool.name} on ${on_string}: log file"/>
+        <data name="logfile" format="txt" label="${tool.name} on ${on_string}: log file">
+            <filter> output_option['no_logfile'] == False </filter>
+        </data>
         <data name="data_csv" format="tabular" from_work_dir="output.rcf.data.csv" label="${tool.name} on ${on_string}: data.csv">
             <filter> output_option['extra']  == 'CSV' </filter>
         </data>
@@ -270,6 +293,29 @@
             <output name="stat_tsv" file="kraken_test/test3_rcf.stat.tsv" lines_diff="2"/>
             <output name="logfile" file="kraken_test/test3_tsv.log" lines_diff="12"/>
         </test>
+        <test expect_num_outputs="3"> <!-- Test sumarized output TEST_4 -->
+            <section name="database">
+                <param name="database_name" value="test-db-2022"/>
+            </section>
+            <param name="input_file" value="centrifuge_test/centrifuge.out,centrifuge_test/centrifuge_1.out,centrifuge_test/centrifuge_2.out"/>
+            <conditional name="file_type">
+                <param name="filetype" value="centrifuge"/>
+            </conditional>
+            <section name="output_option" >
+                <param name="extra" value="TSV"/>
+                <param name="no_logfile" value="True"/>
+            </section>
+            <section name="advanced_option">
+                <param name="scoring" value="LENGTH"/>
+            </section>
+            <section name="more_advanced_option">
+                <param name="summary" value="ADD"/>
+                <param name="strain" value="true"/>
+            </section>
+            <output name="data_tsv" file="centrifuge_test/test4_rcf.data.tsv" lines_diff="2"/>
+            <output name="stat_tsv" file="centrifuge_test/test4_rcf.stat.tsv" lines_diff="2"/>
+            <output name="html_report" file="centrifuge_test/test4_tsv.html" lines_diff="12"/>
+        </test>
     </tests>
   <help><![CDATA[
 **What it does**