diff cutadapt.xml @ 16:8f1df515eb87 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cutadapt commit 034c93600ce3279644d05f3675b4820ef7180851
author iuc
date Thu, 01 Nov 2018 19:19:11 -0400
parents 660cffd8d92a
children 52ef1be47553
line wrap: on
line diff
--- a/cutadapt.xml	Mon Aug 06 08:34:03 2018 -0400
+++ b/cutadapt.xml	Thu Nov 01 19:19:11 2018 -0400
@@ -1,4 +1,4 @@
-<tool id="cutadapt" name="Cutadapt" version="1.16.3" profile="17.09">
+<tool id="cutadapt" name="Cutadapt" version="1.16.4" profile="17.09">
     <description>Remove adapter sequences from Fastq/Fasta</description>
     <macros>
         <import>macros.xml</import>
@@ -68,6 +68,10 @@
 
 ## Run Cutadapt
 
+#if $output_options.multiple_output:
+    mkdir split &&
+#end if
+
 cutadapt
 
 ## cutadapt (up to version 1.16) can't be run in multicore mode with these options
@@ -77,7 +81,11 @@
 
 #if str( $library.type ) == "single":
     @read1_options@
-    --output='$out1'
+    #if $output_options.multiple_output:
+        --output='split/{name}.fastq'
+    #else:
+        --output='$out1'
+    #end if
 #else:
     @read1_options@
     @read2_options@
@@ -90,12 +98,11 @@
 --overlap=$adapter_options.overlap
 $adapter_options.no_indels
 $adapter_options.match_read_wildcards
-
+$adapter_options.no_trim
+$adapter_options.mask_adapter
 
 $filter_options.discard
 $filter_options.discard_untrimmed
-$filter_options.no_trim
-$filter_options.mask_adapter
 #if str($filter_options.min) != '0':
     --minimum-length=$filter_options.min
 #end if
@@ -175,7 +182,13 @@
             <param name="no_indels" argument="--no-indels" type="boolean" value="False" truevalue="--no-indels" falsevalue="" label="Do not allow indels (Use ONLY with anchored 5' (front) adapters)." help="Do not allow indels in the alignments. That is, allow only mismatches. This option is currently only supported for anchored 5' adapters ('^ADAPTER') (default: both mismatches and indels are allowed)." />
             <param name="count" argument="--times" type="integer" min="1" value="1" label="Match times" help="Try to remove adapters at most COUNT times. Useful when an adapter gets appended multiple times." />
             <param name="overlap" argument="--overlap" type="integer" min="1" value="3" label="Minimum overlap length" help="Minimum overlap length. If the overlap between the adapter and the sequence is shorter than LENGTH, the read is not modified. This reduces the number of bases trimmed purely due to short random adapter matches." />
-            <param name="match_read_wildcards" argument="--match-read-wildcards" type="boolean" value="False" truevalue="--match-read-wildcards" falsevalue="" label="Match Read Wildcards" help="Allow 'N's in the read as matches to the adapter." />
+            <param name="match_read_wildcards" type="select"  label="Match Wildcards" help="Allow 'N's as matches. Default: In the adapters but not in the reads">
+                <option value=" " selected="True">In the adapters but not in the reads</option>
+                <option value="--match-read-wildcards">In the adapters and in the reads</option>
+                <option value="--no-match-adapter-wildcards">Nowhere</option>
+            </param>
+            <param name="no_trim" argument="--no-trim" type="boolean" value="False" truevalue="--no-trim" falsevalue="" label="Do not trim adapters" help="Match and redirect reads to output/untrimmed-output as usual, but don't remove the adapters (default: trim the adapters)." />
+            <param name="mask_adapter" argument="--mask-adapter" type="boolean" value="False" truevalue="--mask-adapter" falsevalue="" label="Mask Adapters" help="Mask adapter bases with 'N' instead of trimming them (default: trim adapters)." />
         </section>
 
         <!-- Filter Options -->
@@ -184,8 +197,6 @@
             <param name="discard_untrimmed" argument="--discard_untrimmed" type="boolean" value="False" truevalue="--discard-untrimmed" falsevalue="" label="Discard Untrimmed Reads" help="Discard reads that do not contain the adapter." />
             <param name="min" argument="--minimum-length" type="integer" min="0" optional="True" value="0" label="Minimum length" help="Discard trimmed reads that are shorter than LENGTH.  Reads that are too short even before adapter removal are also discarded. In colorspace, an initial primer is not counted. Value of 0 means no minimum length." />
             <param name="max" argument="--maximum-length" type="integer" min="0" optional="True" value="0" label="Maximum length" help="Discard trimmed reads that are longer than LENGTH.  Reads that are too long even before adapter removal are also discarded. In colorspace, an initial primer is not counted. Value of 0 means no maximum length." />
-            <param name="no_trim" argument="--no-trim" type="boolean" value="False" truevalue="--no-trim" falsevalue="" label="Do not trim adapters" help="Match and redirect reads to output/untrimmed-output as usual, but don't remove the adapters (default: trim the adapters)." />
-            <param name="mask_adapter" argument="--mask-adapter" type="boolean" value="False" truevalue="--mask-adapter" falsevalue="" label="Mask Adapters" help="Mask adapter bases with 'N' instead of trimming them (default: trim adapters)." />
             <param name="max_n" argument="--max-n" type="float" min="0" optional="True" label="Max N" help="Discard reads with more than this number of 'N' bases. A number between 0 and 1 is interpreted as a fraction of the read length." />
             <param name="pair_filter" argument="--pair-filter" type="select" optional="True" label="Pair filter" help="Which of the reads in a paired-end read have to match the filtering criterion in order for the pair to be filtered. Default: any">
                 <option value="any" selected="True">any</option>
@@ -218,6 +229,7 @@
             <param name="too_short_file" argument="--too-short-output" type="boolean" value="False" label="Too Short Reads" help="Write reads that are too short (according to minimum length specified) to a file. (default: discard reads)"/>
             <param name="too_long_file" argument="--too-long-output" type="boolean" value="False" label="Too Long Reads" help="Write reads that are too long (according to maximum length specified) to a file. (default: discard reads)"/>
             <param name="untrimmed_file" argument="--untrimmed-output" type="boolean" value="False" label="Untrimmed Reads" help="Write reads that do not contain the adapter to a separate file, instead of writing them to the regular output file.  (default: output to same file as trimmed)"/>
+            <param name="multiple_output" argument="" type="boolean" value="False" label="Multiple output" help="Create a separate file for each adapter trimmed  (default: all trimmed reads are in a single file)"/>
         </section>
 
     </inputs>
@@ -277,6 +289,12 @@
             <filter>(output_options['too_long_file'] is True)</filter>
             <expand macro="inherit_format_2" />
         </data>
+
+        <collection name="split_output" type="list" format_source="input" label="${tool.name} on ${on_string}: Split outputs">
+            <discover_datasets pattern="__designation_and_ext__" directory="split" visible="false"   />
+            <filter>(output_options['multiple_output'] is True)</filter>
+        </collection>
+
     </outputs>
 
     <tests>
@@ -381,6 +399,48 @@
             </output>
             <output name="info_file" value="cutadapt_info_out.txt" ftype="txt"/>
         </test>
+
+
+        <test>
+            <conditional name="library">
+                <param name="type" value="single" />
+                <param name="input_1" ftype="fastq" value="cutadapt_in_split.fastq" />
+                <section name="r1" >
+                    <repeat name="front_adapters">
+                        <conditional name="front_adapter_source">
+                            <param name="front_adapter_source_list" value="user"/>
+                            <param name="front_adapter_name" value="A1" />
+                            <param name="front_adapter" value="^GTCGGTAA" />
+                        </conditional>
+                    </repeat>
+                    <repeat name="front_adapters">
+                        <conditional name="front_adapter_source">
+                            <param name="front_adapter_source_list" value="user"/>
+                            <param name="front_adapter_name" value="A2" />
+                            <param name="front_adapter" value="^AGGTCACT" />
+                        </conditional>
+                    </repeat>
+                </section>
+            </conditional>
+            <param name="report" value="True" />
+            <param name="info_file" value="False" />
+            <param name="multiple_output" value="True" />
+            <output_collection name="split_output" type="list" count="3">
+                   <element name="A1" value="A1.fastq" ftype="fastq">
+                   </element>
+                   <element name="A2" value="A2.fastq" ftype="fastq">
+                   </element>
+                   <element name="unknown" value="unknown.fastq" ftype="fastq">
+                   </element>
+             </output_collection>
+            <output name="report">
+                <assert_contents>
+                    <has_text text="Summary"/>
+                </assert_contents>
+            </output>
+        </test>
+
+
     </tests>
 
     <help><![CDATA[