diff dada2_filterAndTrim.xml @ 6:34e55239e68b draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dada2 commit ea6c9c638e742c097b0ef294161eeea447c09e06
author iuc
date Fri, 30 Jun 2023 07:56:47 +0000
parents 23fc35093b11
children 7434cc396c7b
line wrap: on
line diff
--- a/dada2_filterAndTrim.xml	Fri Jul 02 20:12:35 2021 +0000
+++ b/dada2_filterAndTrim.xml	Fri Jun 30 07:56:47 2023 +0000
@@ -3,6 +3,7 @@
     <macros>
         <import>macros.xml</import>
     </macros>
+    <expand macro="bio_tools"/>
     <expand macro="requirements"/>
     <expand macro="stdio"/>
     <expand macro="version_command"/>
@@ -11,6 +12,11 @@
     ]]></command>
     <configfiles>
         <configfile name="dada2_script"><![CDATA[
+#if $paired_cond.paired_select == "paired"
+    #set $compress_output = str($paired_cond.reads.forward.ext.endswith('gz')).upper()
+#else
+    #set $compress_output = str($paired_cond.reads.ext.endswith('gz')).upper()
+#end if
 truncQ <- c($trim.truncQ)
 truncLen <- c($trim.truncLen)
 trimLeft <- c($trim.trimLeft)
@@ -75,7 +81,7 @@
 
 library(dada2, quietly=T)
 
-ftout <- filterAndTrim(fwd, filt.fwd, rev, filt.rev,  compress = TRUE,
+ftout <- filterAndTrim(fwd, filt.fwd, rev, filt.rev,  compress = $compress_output,
     truncQ = truncQ, truncLen = truncLen, trimLeft = trimLeft, trimRight = trimRight, maxLen = maxLen,
     minLen = minLen, maxN = maxN, minQ = minQ, maxEE = maxEE, rm.lowcomplex = $rmlowcomplex,
     rm.phix = $rmPhiX, orient.fwd = orientFwd)
@@ -110,10 +116,10 @@
         <param name="output_statistics" truevalue="TRUE" falsevalue="FALSE" type="boolean" checked="true" label="Output statistics" help="Create extra table with the number of reads pre and post filtering" />
     </inputs>
     <outputs>
-        <collection name="paired_output" type="paired" format_source="reads['forward']">
+        <collection name="paired_output" type="paired" format_source="reads['forward']" label="${tool.name} on ${on_string}: Paired reads" >
             <filter>paired_cond['paired_select'] == "paired"</filter>
         </collection>
-        <data name="output_single" format_source="reads" >
+        <data name="output_single" format_source="reads" label="${tool.name} on ${on_string}: Reads" >
             <filter>paired_cond['paired_select'] == "single"</filter>
         </data>
         <data name="output_fwd" format_source="reads" label="${tool.name} on ${on_string}: Forward reads" >
@@ -224,6 +230,28 @@
             <param name="output_statistics" value="FALSE" />
             <output_collection name="paired_output" type="paired" count="2"/>
         </test>
+        <!-- paired data in paired collection with uncompressed input -->
+        <test expect_num_outputs="4">
+            <conditional name="paired_cond">
+                <param name="paired_select" value="paired"/>
+                <param name="reads">
+                    <collection type="paired">
+                        <element name="forward" value="F3D0_S188_L001_R1_001.fastq" ftype="fastqsanger"/>
+                        <element name="reverse" value="F3D0_S188_L001_R2_001.fastq" ftype="fastqsanger"/>
+                    </collection>
+                </param>
+            </conditional>
+            <output_collection name="paired_output" type="paired" count="2">
+                <element name="forward" value="filterAndTrim_F3D0_R1.fq" ftype="fastqsanger" />
+                <element name="reverse" value="filterAndTrim_F3D0_R2.fq" ftype="fastqsanger" />
+            </output_collection>
+            <output name="outtab" value="F3D0_S188_L001_R1_001.tab" ftype="tabular" lines_diff="2">
+                <assert_contents>
+                    <has_text text="745" />
+                    <has_text text="750" />
+                </assert_contents>
+            </output>
+        </test>
 
         <!-- test failure in case all reads are filtered -->
         <test expect_exit_code="1" expect_failure="true">