diff make.contigs.xml @ 1:2de7963eb3ba draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mothur commit ea40e3d84e7850eb4226d6c85f709dcad18d4ba9
author iuc
date Thu, 18 May 2017 18:19:45 -0400
parents d9268e6b2ea0
children 4cf175b57289
line wrap: on
line diff
--- a/make.contigs.xml	Fri Jun 24 16:37:19 2016 -0400
+++ b/make.contigs.xml	Thu May 18 18:19:45 2017 -0400
@@ -4,20 +4,37 @@
         <import>macros.xml</import>
     </macros>
     <expand macro="requirements"/>
+    <expand macro="stdio"/>
     <expand macro="version_command"/>
-    <command detect_errors="aggressive"><![CDATA[
-        ## create symlinks to input datasets
-        ln -s "$ffastq" ffastq.dat &&
-        ln -s "$rfastq" rfastq.dat &&
+    <command><![CDATA[
+        @SHELL_OPTIONS@
+
+        ## Symlinks creation or On the fly creation of a combo file
+        #if $input_type.type == 'list_collection'
+            #for $pair in $input_type.list_paired_collection:
+                echo -e "${pair.name}\t${pair.forward}\t${pair.reverse}" >> combo_fastq.dat &&
+            #end for
+        #elif $input_type.type == 'simple_collection'
+            ln -s '$input_type.paired_collection.forward' ffastq.dat &&
+            ln -s '$input_type.paired_collection.reverse' rfastq.dat &&
+        #else
+            ln -s '$input_type.forward_fastq' ffastq.dat &&
+            ln -s '$input_type.reverse_fastq' rfastq.dat &&
+        #end if
+
         #if $oligo.add == "yes":
-            ln -s "$oligo.oligos" oligo.oligos.dat &&
-            ln -s "$oligo.findex" oligo.findex.dat &&
-            ln -s "$oligo.rindex" oligo.rindex.dat &&
+            ln -s '$oligo.oligos' oligo.oligos.dat &&
+            ln -s '$oligo.findex' oligo.findex.dat &&
+            ln -s '$oligo.rindex' oligo.rindex.dat &&
         #end if
 
         echo 'make.contigs(
-            ffastq=ffastq.dat,
-            rfastq=rfastq.dat,
+            #if $input_type.type == 'list_collection':
+                file=combo_fastq.dat,
+            #else:
+                ffastq=ffastq.dat,
+                rfastq=rfastq.dat,
+            #end if
             align=$align,
             #if $oligo.add == "yes":
                 oligos=oligo.oligos.dat,
@@ -39,10 +56,26 @@
         )'
         | sed 's/ //g'  ## mothur trips over whitespace
         | mothur
+        | tee mothur.out.log
     ]]></command>
     <inputs>
-        <param name="ffastq" type="data" format="fastq" label="ffastq - Forward Fastq Sequence file"/>
-        <param name="rfastq" type="data" format="fastq" label="rfastq - Reverse Fastq Sequence file"/>
+        <conditional name="input_type">
+            <param name="type" type="select" label="Select a way to provide forward and reverse fastq files ?" help="">
+                <option value="regular" selected="true">Two simple fastq files (forward and reverse)</option>
+                <option value="simple_collection">One pair (paired collection)</option>
+                <option value="list_collection">Multiple pairs - Combo mode (list:paired collection)</option>
+            </param>
+            <when value="regular">
+                <param name="forward_fastq" type="data" format="fastq" label="Forward reads"/>
+                <param name="reverse_fastq" type="data" format="fastq" label="Reverse reads"/>
+            </when>
+            <when value="simple_collection">
+                <param name="paired_collection" type="data_collection" format="fastq" collection_type="paired" label="Fastq pair (collection)" help="Dataset collection made from a single pair of fastq files (forward + reverse)"/>
+            </when>
+            <when value="list_collection">
+                <param name="list_paired_collection" type="data_collection" format="fastq" collection_type="list:paired" label="Fastq pairs (collection)" help="Dataset collection made from multiple pairs of fastq files" />
+            </when>
+        </conditional>
         <param name="align" type="select" label="align - Select a pairwise alignment method" help="">
             <option value="needleman" selected="true">needleman (default) </option>
             <option value="gotoh">gotoh</option>
@@ -55,7 +88,8 @@
             </param>
             <when value="no"/>
             <when value="yes">
-                <param name="oligos" type="data" format="mothur.oligos" optional="true" label="oligos - barcodes and primers" help="a file that can contain the sequences of the forward and reverse primers and barcodes and their sample identifier. Each line of the oligos file can start with the key words &quot;forward&quot;, &quot;reverse&quot; and &quot;barcode&quot; or it can start with a &quot;#&quot; to tell mothur to ignore that line of the oligos file"/>
+                <param name="oligos" type="data" format="mothur.oligos" optional="true" label="oligos - barcodes and primers"
+                    help="a file that can contain the sequences of the forward and reverse primers and barcodes and their sample identifier. Each line of the oligos file can start with the key words &quot;forward&quot;, &quot;reverse&quot; and &quot;barcode&quot; or it can start with a &quot;#&quot; to tell mothur to ignore that line of the oligos file"/>
                 <param name="bdiffs" type="integer" value="0" min="0" label="bdiffs - number of differences to allow in the barcode (default 0)"/>
                 <param name="pdiffs" type="integer" value="0" min="0" label="pdiffs - number of differences to allow in the primer (default 0)"/>
                 <param name="tdiffs" type="integer" value="0" min="0" label="tdiffs - total number of differences to allow in primer and barcode (default 0)"/>
@@ -70,24 +104,55 @@
     </inputs>
     <outputs>
         <expand macro="logfile-output"/>
-        <data name="fasta" format="fasta" from_work_dir="ffastq*.trim.*.fasta" label="${tool.name} on ${on_string}: trim.contigs.fasta"/>
-        <data name="qual" format="qual" from_work_dir="ffastq*.trim.*.qual" label="${tool.name} on ${on_string}: trim.contigs.qual"/>
-        <data name="scrapfasta" format="fasta" from_work_dir="ffastq*.scrap.*.fasta" label="${tool.name} on ${on_string}: scrap.contigs.fasta"/>
-        <data name="scrapqual" format="qual" from_work_dir="ffastq*.scrap.*.qual" label="${tool.name} on ${on_string}: scrap.contigs.qual"/>
-        <data name="report" format="txt" from_work_dir="ffastq*.contigs.report" label="${tool.name} on ${on_string}: report"/>
+        <data name="fasta" format="fasta" from_work_dir="*fastq.trim.*.fasta" label="${tool.name} on ${on_string}: trim.contigs.fasta"/>
+        <data name="qual" format="qual" from_work_dir="*fastq*.trim.*.qual" label="${tool.name} on ${on_string}: trim.contigs.qual"/>
+        <data name="scrapfasta" format="fasta" from_work_dir="*fastq*.scrap.*.fasta" label="${tool.name} on ${on_string}: scrap.contigs.fasta"/>
+        <data name="scrapqual" format="qual" from_work_dir="*fastq*.scrap.*.qual" label="${tool.name} on ${on_string}: scrap.contigs.qual"/>
+        <data name="report" format="txt" from_work_dir="*fastq*.contigs.report" label="${tool.name} on ${on_string}: report"/>
+        <data name="group" format="mothur.groups" from_work_dir="*fastq*.groups" label="${tool.name} on ${on_string}: group file">
+            <filter>input_type['type'] == 'list_collection'</filter>
+        </data>
     </outputs>
     <tests>
+        <!-- Test with two regular files as input -->
         <test>
-            <param name="ffastq" value="Mock_S280_L001_R1_001_small.fastq"/>
-            <param name="rfastq" value="Mock_S280_L001_R2_001_small.fastq"/>
+            <conditional name="input_type">
+                <param name="type" value="regular"/>
+                <param name="forward_fastq" value="Mock_S280_L001_R1_001_small.fastq" ftype="fastq"/>
+                <param name="reverse_fastq" value="Mock_S280_L001_R2_001_small.fastq" ftype="fastq"/>
+            </conditional>
             <output name="fasta" file="Mock_S280_L001_R1_001_small.trim.contigs.fasta" ftype="fasta"/>
             <output name="qual" file="Mock_S280_L001_R1_001_small.trim.contigs.qual" ftype="qual"/>
             <output name="report" file="Mock_S280_L001_R1_001_small.contigs.report" ftype="txt"/>
             <expand macro="logfile-test"/>
         </test>
+        <!-- Test with a simple paired collection as input -->
         <test>
-            <param name="ffastq" value="Mock_S280_L001_R1_001_small.fastq"/>
-            <param name="rfastq" value="Mock_S280_L001_R2_001_small.fastq"/>
+            <conditional name="input_type">
+                <param name="type" value="simple_collection"/>
+                <param name="paired_collection">
+                    <collection type="paired">
+                        <element name="forward" value="Mock_S280_L001_R1_001_small.fastq" />
+                        <element name="reverse" value="Mock_S280_L001_R2_001_small.fastq" />
+                    </collection>
+                </param>
+            </conditional>
+            <output name="fasta" file="Mock_S280_L001_R1_001_small.trim.contigs.fasta" ftype="fasta"/>
+            <output name="qual" file="Mock_S280_L001_R1_001_small.trim.contigs.qual" ftype="qual"/>
+            <output name="report" file="Mock_S280_L001_R1_001_small.contigs.report" ftype="txt"/>
+            <expand macro="logfile-test"/>
+        </test>
+        <!-- Test with a simple paired collection as input + extra parameters specified -->
+        <test>
+            <conditional name="input_type">
+                <param name="type" value="simple_collection"/>
+                <param name="paired_collection">
+                    <collection type="paired">
+                        <element name="forward" value="Mock_S280_L001_R1_001_small.fastq" />
+                        <element name="reverse" value="Mock_S280_L001_R2_001_small.fastq" />
+                    </collection>
+                </param>
+            </conditional>
             <param name="align" value="gotoh"/>
             <param name="match" value="2"/>
             <param name="mismatch" value="-2"/>
@@ -98,17 +163,44 @@
             <output name="report" md5="5274725ef45890fd6da4650d5d536173" ftype="txt"/>
             <expand macro="logfile-test"/>
         </test>
+        <!-- Test with a list:paired collection as input -->
+        <test>
+            <conditional name="input_type">
+                <param name="type" value="list_collection"/>
+                <param name="list_paired_collection">
+                    <collection type="list:paired">
+                        <element name="Pair1">
+                            <collection type="paired">
+                                <element name="forward" value="Mock_S280_L001_R1_001_small.fastq" />
+                                <element name="reverse" value="Mock_S280_L001_R2_001_small.fastq" />
+                            </collection>
+                        </element>
+                        <element name="Pair2">
+                            <collection type="paired">
+                                <element name="forward" value="Mock_S280_L001_R1_001_small.fastq" />
+                                <element name="reverse" value="Mock_S280_L001_R2_001_small.fastq" />
+                            </collection>
+                        </element>
+                    </collection>
+                </param>
+            </conditional>
+            <output name="fasta" md5="dab69a0e36f718b55d8defad26ec469b" ftype="fasta"/>
+            <output name="qual" md5="cdba5409e4f87e3cd093a4e51084d616" ftype="qual"/>
+            <output name="report" md5="80b992abd7e4d6a5e89fa70011ef2384" ftype="txt"/>
+            <output name="group" md5="2be2adb030c4fc001bfac7e1172b40e1" ftype="mothur.groups"/>
+            <expand macro="logfile-test"/>
+        </test>
     </tests>
     <help>
 <![CDATA[
 
 @MOTHUR_OVERVIEW@
 
-**Command Documenation**
+**Command Documentation**
 
 The make.contigs_ command reads a forward fastq file and a reverse fastq file and outputs new fasta and quality files.
 
-.. _make.contigs: http://www.mothur.org/wiki/Make.contigs
+.. _make.contigs: https://www.mothur.org/wiki/Make.contigs
 
 v.1.27.0: Updated to use Mothur 1.33. Added findex and rindex parmaeters, optionally used with the oligos file.
 ]]>