changeset 24:288f97432497 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cutadapt commit b26a2d90a1c70476fd2de33cd9fd739100f54fcf"
author iuc
date Wed, 02 Jun 2021 22:47:34 +0000
parents c4b82dce8335
children 4e5056fefd88
files cutadapt.xml macros.xml test-data/A1.fastq.gz test-data/A2.fastq.gz test-data/bwa-mem-fastq1_assimetric.fq.gz test-data/bwa-mem-fastq2_assimetric.fq.gz test-data/cutadapt_action_lowercase.out test-data/cutadapt_action_mask.out test-data/cutadapt_action_none.out test-data/cutadapt_action_retain.out test-data/cutadapt_builtin_internal_adapter.out test-data/cutadapt_nextseq_out.fq.gz test-data/cutadapt_out1.fq.gz test-data/cutadapt_out1_internal_adapter.fq.gz test-data/cutadapt_out1_max_length.fq.gz test-data/cutadapt_out1_max_min_01.fq.gz test-data/cutadapt_out1_max_min_02.fq.gz test-data/cutadapt_out1_min_length.fq.gz test-data/cutadapt_out2.fq.gz test-data/cutadapt_out2_internal_adapter.fq.gz test-data/cutadapt_out2_max_length.fq.gz test-data/cutadapt_out2_max_min_01.fq.gz test-data/cutadapt_out2_max_min_02.fq.gz test-data/cutadapt_out2_min_length.fq.gz test-data/cutadapt_revcomp.out test-data/cutadapt_shorten_3prime.out test-data/cutadapt_shorten_5prime.out test-data/cutadapt_shorten_expected_errors.out test-data/cutadapt_shorten_internal_adapters.out test-data/cutadapt_small_cut.out test-data/cutadapt_small_rename.out test-data/cutadapt_trimmed.out.gz test-data/cutadapt_untrimmed.out.gz test-data/unknown.fastq.gz
diffstat 34 files changed, 685 insertions(+), 184 deletions(-) [+]
line wrap: on
line diff
--- a/cutadapt.xml	Fri Apr 30 10:13:37 2021 +0000
+++ b/cutadapt.xml	Wed Jun 02 22:47:34 2021 +0000
@@ -1,12 +1,11 @@
-<tool id="cutadapt" name="Cutadapt" version="1.16.9" profile="17.09">
-    <description>Remove adapter sequences from Fastq/Fasta</description>
+<tool id="cutadapt" name="Cutadapt" version="@TOOL_VERSION@+@GALAXY_TOOL_VERSION@" profile="20.01">
+    <description>Remove adapter sequences from FASTQ/FASTA</description>
     <macros>
         <import>macros.xml</import>
     </macros>
-    <requirements>
-        <requirement type="package" version="1.16">cutadapt</requirement>
-    </requirements>
-
+    <expand macro='edam_ontology' />
+    <expand macro='requirements' />
+    <expand macro='xrefs'/>
     <version_command>cutadapt --version</version_command>
 
     <command detect_errors="exit_code"><![CDATA[
@@ -18,20 +17,20 @@
 #set paired = False
 #set library_type = str($library.type)
 #if $library_type == 'paired':
-#set paired = True
-#set read1 = re.sub('[^\w\-\s]', '_', str($library.input_1.element_identifier))
-#set read2 = re.sub('[^\w\-\s]', '_', str($library.input_2.element_identifier))
-#set input_1 = $library.input_1
-#set input_2 = $library.input_2
+    #set paired = True
+    #set read1 = re.sub('[^\w\-\s]', '_', str($library.input_1.element_identifier))
+    #set read2 = re.sub('[^\w\-\s]', '_', str($library.input_2.element_identifier))
+    #set input_1 = $library.input_1
+    #set input_2 = $library.input_2
 #else if $library_type == 'paired_collection'
-#set paired = True
-#set input_1 = $library.input_1.forward
-#set input_2 = $library.input_1.reverse
-#set read1 = re.sub('[^\w\-\s]', '_', str($library.input_1.name)) + "_1"
-#set read2 = re.sub('[^\w\-\s]', '_', str($library.input_1.name)) + "_2"
+    #set paired = True
+    #set input_1 = $library.input_1.forward
+    #set input_2 = $library.input_1.reverse
+    #set read1 = re.sub('[^\w\-\s]', '_', str($library.input_1.name)) + "_1"
+    #set read2 = re.sub('[^\w\-\s]', '_', str($library.input_1.name)) + "_2"
 #else
-#set input_1 = $library.input_1
-#set read1 = re.sub('[^\w\-\s]', '_', str($library.input_1.element_identifier))
+    #set input_1 = $library.input_1
+    #set read1 = re.sub('[^\w\-\s]', '_', str($library.input_1.element_identifier))
 #end if
 
 #if $input_1.is_of_type("fastq.gz", "fastqsanger.gz"):
@@ -72,20 +71,17 @@
 
 ## Run Cutadapt
 
-#if $output_options.multiple_output:
+#if 'multiple_output' in $output_selector:
     mkdir split &&
 #end if
 
 cutadapt
 
-## cutadapt (up to version 1.16) can't be run in multicore mode with these options
-#if not any(($output_options.info_file, $output_options.rest_file, $output_options.wildcard_file, $output_options.too_short_file, $output_options.too_long_file, $output_options.untrimmed_file))
-     -j \${GALAXY_SLOTS:-1}
-#end if
+-j=\${GALAXY_SLOTS:-4}
 
 #if str( $library.type ) == "single":
     @read1_options@
-    #if $output_options.multiple_output:
+    #if 'multiple_output' in $output_selector:
         --output='split/{name}.${input_1.ext}'
     #else:
         --output='$out1'
@@ -103,20 +99,25 @@
 #end if
 
 --error-rate=$adapter_options.error_rate
---times=$adapter_options.count
+--times=$adapter_options.times
 --overlap=$adapter_options.overlap
 $adapter_options.no_indels
 $adapter_options.match_read_wildcards
-$adapter_options.no_trim
-$adapter_options.mask_adapter
+--action=$adapter_options.action
+$adapter_options.revcomp
 
-$filter_options.discard
+$filter_options.discard_trimmed
 $filter_options.discard_untrimmed
-#if str($filter_options.min):
-    --minimum-length=$filter_options.min
+
+#if str($filter_options.minimum_length) and str($filter_options.length_R2_options.length_R2_status) == 'True':
+    --minimum-length=$filter_options.minimum_length:$filter_options.length_R2_options.R2_minimum
+#else if str($filter_options.minimum_length):
+    --minimum-length=$filter_options.minimum_length
 #end if
-#if str($filter_options.max):
-    --maximum-length=$filter_options.max
+#if str($filter_options.maximum_length) and str($filter_options.length_R2_options.length_R2_status) == 'True':
+    --maximum-length=$filter_options.maximum_length:$filter_options.length_R2_options.R2_maximum
+#else if str($filter_options.maximum_length):
+    --maximum-length=$filter_options.maximum_length
 #end if
 #if str($filter_options.max_n):
     --max-n=$filter_options.max_n
@@ -126,6 +127,9 @@
         --pair-filter=$filter_options.pair_filter
     #end if
 #end if
+#if str($filter_options.max_expected_errors):
+    --max-expected-errors=$filter_options.max_expected_errors
+#end if
 
 
 #if str($read_mod_options.quality_cutoff) != '0':
@@ -135,25 +139,31 @@
     --nextseq-trim=$read_mod_options.nextseq_trim
 #end if
 $read_mod_options.trim_n
-#if $read_mod_options.prefix != '':
-    --prefix='$read_mod_options.prefix'
+#if str($read_mod_options.shorten_options.shorten_values) == 'True':
+    #if str($read_mod_options.shorten_options.shorten_end) == '3prime'
+        --length=$read_mod_options.shorten_options.length
+    #else
+        --length=-$read_mod_options.shorten_options.length
+    #end if
 #end if
-#if $read_mod_options.suffix != '':
-    --suffix='$read_mod_options.suffix'
-#end if
-#if str($read_mod_options.length) != '0':
-    --length=$read_mod_options.length
-#end if
-#if $read_mod_options.length_tag != '':
+#if str($read_mod_options.length_tag) != '':
     --length-tag='$read_mod_options.length_tag'
 #end if
+#if str($read_mod_options.cut) != '0':
+    --cut=$read_mod_options.cut
+#end if
+#if str($read_mod_options.rename) != '':
+    --rename='$read_mod_options.rename'
+#end if
+$read_mod_options.zero_cap
+
 
 '${read1}'
 #if $paired:
     '${read2}'
 #end if
 
-#if $output_options.report:
+#if 'report' in $output_selector:
     > report.txt
 #end if
     ]]></command>
@@ -187,128 +197,190 @@
 
         <!-- Adapter Options -->
         <section name="adapter_options" title="Adapter Options">
-            <param name="error_rate" argument="--error-rate" type="float" min="0" max="1" value="0.1" label="Maximum error rate" help="Maximum allowed error rate (no. of errors divided by the length of the matching region)." />
-            <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" type="select"  label="Match Wildcards" help="Allow 'N's as matches. Default: In the adapters but not in the reads">
+            <param name="action" type="select" label="What to do if a match is found">
+                <option value="trim" selected="True">Trim: trim adapter and upstream or downstream sequence</option>
+                <option value="retain">Retain: the read is trimmed, but the adapter sequence is not removed</option>
+                <option value="mask">Mask: mask adapters with 'N' characters instead of trimming them</option>
+                <option value="lowercase">Lowercase: convert to lowercase</option>
+                <option value="none">None: leave unchanged</option>
+            </param>
+            <param name="internal" type="select" label="Disallow internal adaptor ocurrences" help="The non-internal 5’ and 3’ adapter types disallow internal occurrences of the adapter sequence. The adapter must always be at one of the ends of the read, but partial occurrences are also ok.">
+                <option value="X">Enabled</option>
+                <option value="" selected="True">Disabled</option>
+            </param>
+            <param argument="--error-rate" type="float" min="0" max="1" value="0.1" label="Maximum error rate" help="Maximum allowed error rate (no. of errors divided by the length of the matching region)." />
+            <param 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 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 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" 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)." />
+            <param argument="--revcomp" type="boolean" value="False" truevalue="--revcomp" falsevalue="" label="Look for adapters in the reverse complement" help="Check both the read and its reverse complement for adapter matches. If match is on reverse-complemented version, output that one. Default: check only read." />
         </section>
 
         <!-- Filter Options -->
         <section name="filter_options" title="Filter Options">
-            <param name="discard" argument="--discard-trimmed" type="boolean" value="False" truevalue="--discard-trimmed" falsevalue="" label="Discard Trimmed Reads" help="Discard reads that contain the adapter instead of trimming them. Use the 'Minimum overlap length' option in order to avoid throwing away too many randomly matching reads!" />
-            <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="" 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." />
-            <param name="max" argument="--maximum-length" type="integer" min="0" optional="True" value="" 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." />
-            <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>
-                <option value="both">both</option>
+            <param argument="--discard-trimmed" type="boolean" value="False" truevalue="--discard-trimmed" falsevalue="" label="Discard Trimmed Reads" help="Discard reads that contain the adapter instead of trimming them. Use the 'Minimum overlap length' option in order to avoid throwing away too many randomly matching reads!" />
+            <param 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 argument="--minimum-length" type="integer" min="0" optional="True" value="" label="Minimum length (R1)" help="Discard trimmed reads that are shorter than LENGTH.  Reads that are too short even before adapter removal are also discarded." />
+            <param argument="--maximum-length" type="integer" min="0" optional="True" value="" label="Maximum length (R1)" help="Discard trimmed reads that are longer than LENGTH.  Reads that are too long even before adapter removal are also discarded." />
+            <conditional name="length_R2_options">
+                <param name="length_R2_status" type="select" label="Specify a minimum/maximum length for reverse reads (R2)" help="When trimming paired-end reads, the minimum/maximum lengths for R1 and R2 can be specified separately. If not provided, the same minimum length applies to both reads.">
+                    <option value="True">Enabled</option>
+                    <option value="False" selected="True">Disabled</option>
+                </param>
+                <when value="True">
+                    <param name="R2_minimum" type="integer" min="0" value="" optional="True" label="Minimum length (R2)" />
+                    <param name="R2_maximum" type="integer" min="0" value="" optional="True" label="Maximum length (R2)" />
+                </when>
+                <when value="False">
+                </when>
+            </conditional>   
+            <param 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 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: a read pair is discarded (or redirected) if one of the reads (R1 or R2) fulfills the filtering criterion. </option>
+                <option value="both">Both: filtering criteria must apply to both reads in order for a read pair to be discarded. </option>
+                <option value="first">First: will make a decision about the read pair by inspecting whether the filtering criterion applies to the first read, ignoring the second read.</option>
+
             </param>
+            <param argument="--max-expected-errors" type="integer" min="0" optional="True" value="" label="Max expected errors" help="Discard reads whose expected number of errors (computed from quality values) exceeds this value." />
+            <param argument="--discard-cassava" type="boolean" truevalue="--discard-cassava" falsevalue="" checked="False" label="Discard CASAVA filtering" help="Discard reads that did not pass CASAVA filtering (header has :Y:)." />
         </section>
 
         <!-- Read Modification Options -->
         <section name="read_mod_options" title="Read Modification Options">
-            <param name="quality_cutoff" argument="--quality-cutoff" type="text" value="0" label="Quality cutoff" help=" Trim low-quality bases from 5' and/or 3' ends of each read before adapter removal. Applied to both reads if data is paired. If one value is given, only the 3' end is trimmed. If two comma-separated cutoffs are given, the 5' end is trimmed with the first cutoff, the 3' end with the second.">
+            <param argument="--quality-cutoff" type="text" value="0" label="Quality cutoff" help=" Trim low-quality bases from 5' and/or 3' ends of each read before adapter removal. Applied to both reads if data is paired. If one value is given, only the 3' end is trimmed. If two comma-separated cutoffs are given, the 5' end is trimmed with the first cutoff, the 3' end with the second.">
                 <sanitizer>
                     <valid initial="string.digits"><add value="," /></valid>
                 </sanitizer>
+                <validator type="regex">[0-9,]+</validator>
             </param>
-            <param name="nextseq_trim" argument="--nextseq-trim" type="integer" value="0" label="NextSeq trimming" help="Experimental option for quality trimming of NextSeq data. This is necessary because that machine cannot distinguish between G and reaching the end of the fragment (it encodes G as ‘black’). This option works like regular quality trimming (where one would use -q 20 instead), except that the qualities of G bases are ignored." />
-            <param name="trim_n" argument="--trim-n" type="boolean" truevalue="--trim-n" falsevalue="" checked="False" label="Trim Ns" help="Trim N's on ends of reads." />
-            <param name="prefix" argument="--prefix" label="Prefix" type="text" help="Add this prefix to read names" />
-            <param name="suffix" argument="--suffix" label="Suffix" type="text" help="Add this suffix to read names" />
-            <param name="strip_suffix" argument="--strip-suffix" label="Strip suffix" type="text" help="Remove this suffix from read names if present." />
-            <param name="length" argument="--length" type="integer" value="0" label="Length" help="Shorten reads to this length. This modification is applied after adapter trimming." />
-            <param name="length_tag" argument="--length-tag" label="Length Tag" type="text" help="Search for TAG followed by a decimal number in the name of the read (description/comment field of the FASTA or FASTQ file). Replace the decimal number with the correct length of the trimmed read. For example, use --length-tag 'length=' to search for fields like 'length=123'." />
+            <param argument="--nextseq-trim" type="integer" value="0" label="NextSeq trimming" help="Experimental option for quality trimming of NextSeq data. This is necessary because that machine cannot distinguish between G and reaching the end of the fragment (it encodes G as ‘black’). This option works like regular quality trimming (where one would use -q 20 instead), except that the qualities of G bases are ignored." />
+            <param argument="--trim-n" type="boolean" truevalue="--trim-n" falsevalue="" checked="False" label="Trim Ns" help="Trim N's on ends of reads." />
+            <param argument="--strip-suffix" label="Strip suffix" type="text" help="Remove this suffix from read names if present." />
+            <conditional name="shorten_options">
+                <param name="shorten_values" type="select" label="Shortening reads to a fixed length" help="If you want to remove a fixed number of bases from each read, use the –cut option instead.">
+                    <option value="True">Enabled</option>
+                    <option value="False" selected="True">Disabled</option>
+                </param>
+                <when value="True">
+                    <param argument="--length" type="integer" value="0" label="Length" help="Shorten reads to this length. This modification is applied after adapter trimming." />
+                    <param name="shorten_end" type="select" label="End at which to apply the slice">
+                        <option value="3prime">3' ends</option>
+                        <option value="5prime">5' ends</option>
+                    </param>
+                </when>
+                <when value="False">
+                </when>
+            </conditional>
+            <param argument="--length-tag" label="Length tag" type="text" optional="True" help="Search for TAG followed by a decimal number in the name of the read (description/comment field of the FASTA or FASTQ file). Replace the decimal number with the correct length of the trimmed read. For example, use --length-tag 'length=' to search for fields like 'length=123'." >
+                <sanitizer invalid_char="">
+                    <valid initial="string.letters,string.digits">
+                        <add value="/" />
+                        <add value="+" />
+                        <add value="-" />
+                        <add value="=" />
+                        <add value=" " />
+                        <add value="_" />
+                    </valid>
+                </sanitizer>
+                <validator type="regex">[A-Za-z0-9 =-_/+]+</validator>
+            </param>
+            <param argument="--rename" label="Rename reads" type="text" optional="True" help="This option can be used to rename both single-end and paired-end reads. ">
+                <sanitizer invalid_char="">
+                    <valid initial="string.letters,string.digits">
+                        <add value="{" />
+                        <add value="}" />
+                        <add value="_" />
+                        <add value="=" />
+                        <add value=" " />
+                    </valid>
+                </sanitizer>
+                <validator type="regex">[A-Za-z0-9 {}=_]+</validator>
+            </param>
+            <param argument="--cut" label="Remove a fixed number of bases" type="integer" value="0" help="This option allows to unconditionally remove bases from the beginning or end of each read. If the given length is positive, the bases are removed from the beginning of each read. If it is negative, the bases are removed from the end." />
+            <param argument="--zero-cap" type="boolean" truevalue="--zero-cap" falsevalue="" checked="False" label="Change negative quality values to zero" />
         </section>
 
         <!-- Output Options -->
-        <section name="output_options" title="Output Options">
-            <param name="report" type="boolean" value="False" label="Report" help="Cutadapt's per-adapter statistics. You can use this file with MultiQC."/>
-            <param name="info_file" argument="--info-file" type="boolean" value="False" label="Info File" help="Write information about each read and its adapter matches to a file."/>
-            <param name="rest_file" argument="--rest-file" type="boolean" value="False" label="Rest of Read" help="When the adapter matches in the middle of a read, write the rest (after the adapter) into a file."/>
-            <param name="wildcard_file" argument="--wildcard-file" type="boolean" value="False" label="Wildcard File" help="When the adapter has wildcard bases ('N's) write adapter bases matching wildcard positions to file."/>
-            <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>
-
+        <param name="output_selector" type="select" multiple="True" display="checkboxes" label="Outputs selector">
+            <option value="report">Report: Cutadapt's per-adapter statistics. You can use this file with MultiQC.</option>
+            <option value="info_file">Info file: write information about each read and its adapter matches.</option>
+            <option value="rest_file">Rest of read: when the adapter matches in the middle of a read, write the rest (after the adapter).</option>
+            <option value="wildcard_file">Wildcard file: when the adapter has wildcard bases (Ns) write adapter bases matching wildcard positions.</option>
+            <option value="too_short_file">Too short reads: write reads that are too short according to minimum length specified (default: discard reads).</option>
+            <option value="too_long_file">Too long reads: write reads that are too long (according to maximum length specified)</option>
+            <option value="untrimmed_file">Untrimmed reads: 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)</option>
+            <option value="multiple_output">Multiple output: create a separate file for each adapter trimmed (default: all trimmed reads are in a single file)</option>
+        </param>
     </inputs>
 
     <outputs>
         <data name="out1" format="fastqsanger" metadata_source="input_1" from_work_dir="out1*" label="${tool.name} on ${on_string}: Read 1 Output">
-            <filter>(output_options['multiple_output'] is False and library['type'] != 'paired_collection')</filter>
+            <filter>library['type'] != 'paired_collection' and 'multiple_output' not in output_selector</filter>
             <expand macro="inherit_format_1" />
         </data>
+
         <data name="out2" format="fastqsanger" metadata_source="input_2" from_work_dir="out2*" label="${tool.name} on ${on_string}: Read 2 Output" >
-            <filter>(output_options['multiple_output'] is False and library['type'] == 'paired')</filter>
+            <filter>library['type'] == 'paired' and 'multiple_output' not in output_selector</filter>
             <expand macro="inherit_format_2" />
         </data>
 
         <collection name="out_pairs" type="paired" format_source="input_1" label="${tool.name} on ${on_string}: Reads">
-            <filter>(output_options['multiple_output'] is False and library['type'] == 'paired_collection')</filter>
+            <filter>library['type'] == 'paired_collection' and 'multiple_output' not in output_selector</filter>
         </collection>
-
+        
         <data name="report" format="txt" from_work_dir="report.txt" label="${tool.name} on ${on_string}: Report">
-            <filter>(output_options['report'] is True)</filter>
+            <filter>output_selector and 'report' in output_selector</filter>
         </data>
-
         <data  name="info_file" format="txt" metadata_source="input_1" label="${tool.name} on ${on_string}: Info File" >
-            <filter>(output_options['info_file'] is True)</filter>
+            <filter>output_selector and 'info_file' in output_selector</filter>
         </data>
 
         <data name="rest_output" format="fastqsanger" metadata_source="input_1" from_work_dir="rest_output*" label="${tool.name} on ${on_string}: Rest of Reads (R1 only)" >
-            <filter>(output_options['rest_file'] is True)</filter>
+            <filter>output_selector and 'rest_file' in output_selector</filter>
             <expand macro="inherit_format_1" />
         </data>
 
         <data name="wild_output" format="txt" metadata_source="input_1" from_work_dir="wild_output*" label="${tool.name} on ${on_string}: Wildcard File" >
-            <filter>(output_options['wildcard_file'] is True)</filter>
+            <filter>output_selector and 'wildcard_file' in output_selector</filter>
         </data>
 
         <data name="untrimmed_output" format="fastqsanger" metadata_source="input_1" from_work_dir="untrimmed_output*" label="${tool.name} on ${on_string}: Untrimmed Read 1" >
-            <filter>(output_options['untrimmed_file'] is True)</filter>
+            <filter>output_selector and 'untrimmed_file' in output_selector</filter>
             <expand macro="inherit_format_1" />
         </data>
         <data name="untrimmed_paired_output" format="fastqsanger" metadata_source="input_2" from_work_dir="untrimmed_paired_output*" label="${tool.name} on ${on_string}: Untrimmed Read 2" >
-            <filter>(library['type'] == 'paired' or library['type'] == 'paired_collection')</filter>
-            <filter>(output_options['untrimmed_file'] is True)</filter>
+            <filter>library['type'] == 'paired' or library['type'] == 'paired_collection'</filter>
+            <filter>output_selector and 'untrimmed_file' in output_selector </filter>
             <expand macro="inherit_format_2" />
         </data>
 
         <data name="too_short_output" format="fastqsanger" metadata_source="input_1" from_work_dir="too_short_output*" label="${tool.name} on ${on_string}: Too Short Read 1" >
-            <filter>(output_options['too_short_file'] is True)</filter>
+            <filter>output_selector and 'too_short_file' in output_selector</filter>
             <expand macro="inherit_format_1" />
         </data>
         <data name="too_short_paired_output" format="fastqsanger" metadata_source="input_2" from_work_dir="too_short_paired_output*" label="${tool.name} on ${on_string}: Too Short Read 2" >
-            <filter>(library['type'] == 'paired' or library['type'] == 'paired_collection')</filter>
-            <filter>(output_options['too_short_file'] is True)</filter>
+            <filter>library['type'] == 'paired' or library['type'] == 'paired_collection'</filter>
+            <filter>output_selector and 'too_short_file' in output_selector</filter>
             <expand macro="inherit_format_2" />
         </data>
-
         <data name="too_long_output" format="fastqsanger" metadata_source="input_1" from_work_dir="too_long_output*" label="${tool.name} on ${on_string}: Too Long Read 1" >
-            <filter>(output_options['too_long_file'] is True)</filter>
+            <filter>output_selector and 'too_long_file' in output_selector</filter>
             <expand macro="inherit_format_1" />
         </data>
         <data name="too_long_paired_output" format="fastqsanger" metadata_source="input_2" from_work_dir="too_long_paired_output*" label="${tool.name} on ${on_string}: Too Long Read 2" >
-            <filter>(library['type'] == 'paired' or library['type'] == 'paired_collection')</filter>
-            <filter>(output_options['too_long_file'] is True)</filter>
+            <filter>library['type'] == 'paired' or library['type'] == 'paired_collection'</filter>
+            <filter>output_selector and 'too_long_file' in output_selector</filter>
             <expand macro="inherit_format_2" />
         </data>
 
         <collection name="split_output" type="list" label="${tool.name} on ${on_string}: Split outputs"  >
             <discover_datasets pattern="(?P&lt;designation&gt;.+)\.(?P&lt;ext&gt;fastq.*)" directory="split" />
-            <filter>(output_options['multiple_output'] is True)</filter>
+            <filter>output_selector and 'multiple_output' in output_selector</filter>
         </collection>
-
     </outputs>
 
     <tests>
@@ -381,10 +453,9 @@
             <param name="adapter" value="TTAGACATATCTCCGTCG"/>
             <param name="output_filtering" value="filter"/>
             <section name="filter_options">
-                <param name="discard" value="True"/>
+                <param name="discard_trimmed" value="True"/>
             </section>
             <param name="read_modification" value="none"/>
-            <param name="output_type" value="default"/>
             <output name="out1" file="cutadapt_discard.out" ftype="fastq"/>
             <assert_command>
                 <has_text text="--discard-trimmed"/>
@@ -397,8 +468,7 @@
             <param name="adapter" value="AAAGATG"/>
             <param name="output_filtering" value="default"/>
             <param name="read_modification" value="none"/>
-            <param name="output_type" value="additional"/>
-            <param name="rest_file" value="True"/>
+            <param name="output_selector" value="rest_file"/>
             <output name="out1" file="cutadapt_rest.out" ftype="fasta"/>
             <output name="rest_output" file="cutadapt_rest2.out" ftype="fasta"/>
         </test>
@@ -418,8 +488,7 @@
             <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
             <param name="adapter_source_list" value="user"/>
             <param name="adapter" value="AGATCGGAAGAGC"/>
-            <param name="report" value="True" />
-            <param name="info_file" value="True" />
+            <param name="output_selector" value="report,info_file" />
             <output name="out1" value="cutadapt_small.out" ftype="fastq"/>
             <output name="report">
                 <assert_contents>
@@ -451,9 +520,7 @@
                     </repeat>
                 </section>
             </conditional>
-            <param name="report" value="False" />
-            <param name="info_file" value="False" />
-            <param name="multiple_output" value="True" />
+            <param name="output_selector" value="multiple_output" />
             <output_collection name="split_output" type="list" count="3">
                    <element name="A1" value="A1.fastq" ftype="fastq">
                    </element>
@@ -477,9 +544,7 @@
                     </repeat>
                 </section>
             </conditional>
-            <param name="report" value="False" />
-            <param name="info_file" value="False" />
-            <param name="multiple_output" value="True" />
+            <param name="output_selector" value="multiple_output" />
             <output_collection name="split_output" type="list" count="3">
                    <element name="A1"  decompress="True" file="A1.fastq.gz" ftype="fastq.gz">
                    </element>
@@ -496,7 +561,7 @@
             <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
             <param name="adapter_source_list" value="user"/>
             <param name="adapter" value="AAAT"/>
-            <param name="untrimmed_file" value="True" />
+            <param name="output_selector" value="untrimmed_file" />
             <output name="out1" file="cutadapt_trimmed.out" ftype="fastq"/>
             <output name="untrimmed_output" file="cutadapt_untrimmed.out" ftype="fastq"/>
         </test>
@@ -506,7 +571,7 @@
             <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1.fq.gz" />
             <param name="adapter_source_list" value="user"/>
             <param name="adapter" value="AGATCGGAAGAGC"/>
-            <param name="untrimmed_file" value="True" />
+            <param name="output_selector" value="untrimmed_file" />
             <output name="out1" decompress="True" file="cutadapt_trimmed.out.gz" ftype="fastq.gz"/>
             <!-- 
                 Do not use the decompress option for this assertion, since it does NOT test that the file is compressed
@@ -527,19 +592,280 @@
             <param name="adapter2" value="AGATCGGAAGAGC"/>
             <section name="filter_options">
                 <param name="discard_untrimmed" value="true"/>
-                <param name="min" value="1"/>
-                <param name="max" value="1000"/>
+                <param name="minimun_length" value="1"/>
+                <param name="maximum_length" value="1000"/>
                 <param name="max_n" value="0"/>
                 <param name="pair_filter" value="both"/>
             </section>
             <assert_command>
                 <has_text text="--discard-untrimmed"/>
-                <has_text text="--minimum-length=1"/>
                 <has_text text="--maximum-length=1000"/>
                 <has_text text="--max-n=0"/>
                 <has_text text="--pair-filter=both"/>
             </assert_command>
         </test>
+        <!-- Test cut option -->
+        <test expect_num_outputs="1">
+            <param name="type" value="single" />
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="AGATCGGAAGAGC"/>
+             <section name="read_mod_options">
+                <param name="cut" value="5"/>
+            </section>
+            <output name="out1" file="cutadapt_small_cut.out" ftype="fastq"/>
+        </test>
+        <!-- Test rename options -->
+        <test expect_num_outputs="1">
+            <param name="type" value="single" />
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="AGATCGGAAGAGC"/>
+            <section name="read_mod_options">
+                <param name="cut" value="5"/>
+                <param name="rename" value="{id} barcode={cut_prefix}"/>
+            </section>
+            <output name="out1" file="cutadapt_small_rename.out" ftype="fastq">
+                <assert_contents>
+                    <has_text text="@prefix:1_13_1259/1 barcode=AGCCG"/>
+                </assert_contents>
+            </output>
+        </test>
+        <!-- Test action options -->
+        <test expect_num_outputs="1">
+            <param name="type" value="single" />
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="CGTCCGAANTAG"/>
+            <section name="adapter_options">
+                <param name="action" value="retain"/>
+            </section>
+            <output name="out1" file="cutadapt_action_retain.out" ftype="fastq"/>
+        </test>
+           <test expect_num_outputs="1">
+            <param name="type" value="single" />
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="CGTCCGAANTAG"/>
+            <section name="adapter_options">
+                <param name="action" value="mask"/>
+            </section>
+            <output name="out1" file="cutadapt_action_mask.out" ftype="fastq"/>
+        </test>
+        <test expect_num_outputs="1">
+            <param name="type" value="single" />
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="CGTCCGAANTAG"/>
+            <section name="adapter_options">
+                <param name="action" value="lowercase"/>
+            </section>
+            <output name="out1" file="cutadapt_action_lowercase.out" ftype="fastq"/>
+        </test>
+        <test expect_num_outputs="1">
+            <param name="type" value="single" />
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="CGTCCGAANTAG"/>
+            <section name="adapter_options">
+                <param name="action" value="none"/>
+            </section>
+            <output name="out1" file="cutadapt_action_none.out" ftype="fastq"/>
+        </test>
+        <!-- Test revcomp options -->
+        <test expect_num_outputs="1">
+            <param name="type" value="single" />
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="TAAACAGATTAGT"/>
+            <section name="adapter_options">
+                <param name="revcomp" value="true"/>
+            </section>
+            <output name="out1" file="cutadapt_revcomp.out" ftype="fastq"/>
+        </test>
+        <!-- Test minimum lenghth paired-reads -->
+        <test expect_num_outputs="2">
+            <param name="type" value="paired" />
+            <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1_assimetric.fq.gz" />
+            <param name="input_2" ftype="fastq.gz" value="bwa-mem-fastq2_assimetric.fq.gz" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="ATCTGGTTCC"/>
+            <param name="adapter_source_list2" value="user"/>
+            <param name="adapter2" value="CTACAAG"/>
+            <section name="filter_options">
+                <param name="minimum_length" value="30"/>
+                <param name="pair_filter" value="both"/>
+                <conditional name="length_R2_options">
+                    <param name="length_R2_status" value="True"/>
+                    <param name="R2_minimum" value="10"/>
+                </conditional>
+            </section>
+            <output name="out1" decompress="True" file="cutadapt_out1_min_length.fq.gz" ftype="fastq.gz"/>
+            <output name="out2" decompress="True" file="cutadapt_out2_min_length.fq.gz" ftype="fastq.gz"/>
+            <assert_command>
+                <has_text text="--minimum-length=30:10"/>
+                <has_text text="--pair-filter=both"/>
+            </assert_command>
+        </test>
+        <!-- Test maximum lenghth paired-reads -->
+        <test expect_num_outputs="2">
+            <param name="type" value="paired" />
+            <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1_assimetric.fq.gz" />
+            <param name="input_2" ftype="fastq.gz" value="bwa-mem-fastq2_assimetric.fq.gz" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="AGATCGGAAGAGC"/>
+            <param name="adapter_source_list2" value="user"/>
+            <param name="adapter2" value="AGATCGGAAGAGC"/>
+            <section name="filter_options">
+                <param name="pair_filter" value="both"/>
+                <param name="maximum_length" value="50"/>
+                <conditional name="length_R2_options">
+                    <param name="length_R2_status" value="True"/>
+                    <param name="R2_maximum" value="30"/>
+                </conditional>
+            </section>
+            <output name="out1" decompress="True" file="cutadapt_out1_max_length.fq.gz" ftype="fastq.gz"/>
+            <output name="out2" decompress="True" file="cutadapt_out2_max_length.fq.gz" ftype="fastq.gz"/>
+            <assert_command>
+                <has_text text="--maximum-length=50:30"/>
+                <has_text text="--pair-filter=both"/>
+            </assert_command>
+        </test>
+        <!-- Test combination maximum and minimum length paired reads -->
+        <test expect_num_outputs="2">
+            <param name="type" value="paired" />
+            <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1_assimetric.fq.gz" />
+            <param name="input_2" ftype="fastq.gz" value="bwa-mem-fastq2_assimetric.fq.gz" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="AGATCGGAAGAGC"/>
+            <param name="adapter_source_list2" value="user"/>
+            <param name="adapter2" value="AGATCGGAAGAGC"/>
+            <section name="filter_options">
+                <param name="pair_filter" value="both"/>
+                <param name="minimum_length" value="10"/>
+                <param name="maximum_length" value="50"/>
+                <conditional name="length_R2_options">
+                    <param name="length_R2_status" value="True"/>
+                    <param name="R2_maximum" value="30"/>
+                </conditional>
+            </section>
+            <output name="out1" decompress="True" file="cutadapt_out1_max_min_01.fq.gz" ftype="fastq.gz"/>
+            <output name="out2" decompress="True" file="cutadapt_out2_max_min_01.fq.gz" ftype="fastq.gz"/>
+            <assert_command>
+                <has_text text="--minimum-length=10:"/>
+                <has_text text="--maximum-length=50:30"/>
+                <has_text text="--pair-filter=both"/>
+            </assert_command>
+        </test>
+        <test expect_num_outputs="2">
+            <param name="type" value="paired" />
+            <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1_assimetric.fq.gz" />
+            <param name="input_2" ftype="fastq.gz" value="bwa-mem-fastq2_assimetric.fq.gz" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="AGATCGGAAGAGC"/>
+            <param name="adapter_source_list2" value="user"/>
+            <param name="adapter2" value="AGATCGGAAGAGC"/>
+            <section name="filter_options">
+                <param name="pair_filter" value="both"/>
+                <param name="minimum_length" value="10"/>
+                <param name="maximum_length" value="50"/>
+                <conditional name="length_R2_options">
+                    <param name="length_R2_status" value="True"/>
+                    <param name="R2_minimum" value="10"/>
+                </conditional>
+            </section>
+            <output name="out1" decompress="True" file="cutadapt_out1_max_min_02.fq.gz" ftype="fastq.gz"/>
+            <output name="out2" decompress="True" file="cutadapt_out2_max_min_02.fq.gz" ftype="fastq.gz"/>
+            <assert_command>
+                <has_text text="--minimum-length=10:10"/>
+                <has_text text="--maximum-length=50:"/>
+                <has_text text="--pair-filter=both"/>
+            </assert_command>
+        </test>
+        <!-- Test length options -->
+        <test expect_num_outputs="1">
+            <param name="type" value="single" />
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="AGCCGCTANGACG"/>
+            <section name="read_mod_options">
+                <conditional name="shorten_options">
+                    <param name="shorten_values" value="True"/>
+                    <param name="shorten_end" value="3prime"/>
+                    <param name="length" value="10"/>
+                </conditional>
+            </section>
+            <output name="out1" file="cutadapt_shorten_3prime.out" ftype="fastq"/>
+        </test>
+        <test expect_num_outputs="1">
+            <param name="type" value="single" />
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="AGCCGCTANGACG"/>
+            <section name="read_mod_options">
+                <conditional name="shorten_options">
+                    <param name="shorten_values" value="True"/>
+                    <param name="shorten_end" value="5prime"/>
+                    <param name="length" value="10"/>
+                </conditional>
+            </section>
+            <output name="out1" file="cutadapt_shorten_5prime.out" ftype="fastq"/>
+        </test>
+        <!-- Test max expected errors options -->
+        <test expect_num_outputs="1">
+            <param name="type" value="single" />
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="AGCGGCTTAGACG"/>
+            <section name="filter_options">
+                <param name="max_expected_errors" value="10"/>
+            </section>
+            <output name="out1" file="cutadapt_shorten_expected_errors.out" ftype="fastq"/>
+        </test>
+        <!-- Test disallow internal adaptors option -->
+        <test expect_num_outputs="1">
+            <param name="type" value="single" />
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="GAANTAGCTACCAC"/>
+            <section name="adapter_options">
+                <param name="internal" value="X"/>
+            </section>
+            <output name="out1" file="cutadapt_shorten_internal_adapters.out" ftype="fastq"/>
+            <assert_command>
+                <has_text text="GAANTAGCTACCACX"/>
+            </assert_command>
+        </test>
+        <test expect_num_outputs="2">
+            <param name="type" value="paired" />
+            <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1_assimetric.fq.gz" />
+            <param name="input_2" ftype="fastq.gz" value="bwa-mem-fastq2_assimetric.fq.gz" />
+            <param name="adapter_source_list" value="user"/>
+            <param name="adapter" value="AGATCGGAAGAGC"/>
+            <param name="adapter_source_list2" value="user"/>
+            <param name="adapter2" value="AGATCGGAAGAGC"/>
+            <section name="adapter_options">
+                <param name="internal" value="X"/>
+            </section>
+            <output name="out1" decompress="True" file="cutadapt_out1_internal_adapter.fq.gz" ftype="fastq.gz"/>
+            <output name="out2" decompress="True" file="cutadapt_out2_internal_adapter.fq.gz" ftype="fastq.gz"/>
+            <assert_command>
+                <has_text text="AGATCGGAAGAGCX"/>
+            </assert_command>
+        </test>
+        <test expect_num_outputs="1">
+            <param name="type" value="single" />
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
+            <param name="adapter_source_list" value="builtin"/>
+            <param name="adapter" value="TGTAGGCC"/>
+            <section name="adapter_options">
+                <param name="internal" value="X"/>
+            </section>
+            <output name="out1" file="cutadapt_builtin_internal_adapter.out" ftype="fastq"/>
+            <assert_command>
+                <has_text text="TGTAGGCCX"/>
+            </assert_command>
+        </test>
     </tests>
 
     <help><![CDATA[
@@ -638,25 +964,30 @@
 
 Example:
 
-        *This is cutadapt 1.16 with Python 3.6.4*
+    ::
+        
+        This is cutadapt 3.4 with Python 3.9.2
 
-        *Command line parameters: -j 1 --format=fastq -a AGATCGGAAGAGC --info-file=/tmp/tmpX0DlY1/files/000/dataset_21.dat --output=out1.fq --error-rate=0.1 --times=1 --overlap=3 input_f.fastq*
-        *Running on 1 core*
-        *Trimming 1 adapter with at most 10.0% errors in single-end mode ...*
-        *Finished in 0.00 s (1426 us/read; 0.04 M reads/minute).*
+        Command line parameters: -j=1 -a AGATCGGAAGAGC -A AGATCGGAAGAGC --output=out1.fq.gz --paired-output=out2.fq.gz --error-rate=0.1 --times=1 
+        --overlap=3 --action=trim --minimum-length=30:40 --pair-filter=both --cut=0 bwa-mem-fastq1_assimetric_fq_gz.fq.gz bwa-mem-fastq2_assimetric_fq_gz.fq.gz
+        
+        Processing reads on 1 core in paired-end mode ...
+        Finished in 0.01 s (129 µs/read; 0.46 M reads/minute).
 
-        *=== Summary ===*
+        === Summary ===
 
-        * Total reads processed:                       3*
-        * Reads with adapters:                         0 (0.0%)*
-        * Reads written (passing filters):             3 (100.0%)*
+        Total read pairs processed:                 99
+        Read 1 with adapter:                       2 (2.0%)
+        Read 2 with adapter:                       4 (4.0%)
+        Pairs that were too short:                   3 (3.0%)
+        Pairs written (passing filters):            96 (97.0%)
 
-        * Total basepairs processed:           102 bp*
-        * Total written (filtered):            102 bp (100.0%)*
-
-        *=== Adapter 1 ===*
-
-        *Sequence: AGATCGGAAGAGC; Type: regular 3'; Length: 13; Trimmed: 0 times.*
+        Total basepairs processed:        48,291 bp
+        Read 1:        24,147 bp
+        Read 2:        24,144 bp
+        Total written (filtered):         48,171 bp (99.8%)
+        Read 1:        24,090 bp
+        Read 2:        24,081 bp
 
 
 **Info file**
@@ -690,6 +1021,30 @@
 
 If the --times option is used and greater than 1, each read can appear more than once in the info file. There will be one line for each found adapter, all with identical read names. Only for the first of those lines will the concatenation of columns 5-7 be identical to the original read sequence (and accordingly for columns 9-11). For subsequent lines, the shown sequence are the ones that were used in subsequent rounds of adapter trimming, that is, they get successively shorter.
 
+
+--------------------
+
+**Rename Reads**
+
+--------------------
+
+
+The --rename option expects a template string such as {id} extra_info {adapter_name} as a parameter. It can contain regular text and placeholders that consist of a name enclosed in curly braces ({placeholdername}).
+
+The read name will be set to the template string in which the placeholders are replaced with the actual values relevant for the current read.
+
+The following placeholders are currently available for single-end reads:
+
+        * {header} – the full, unchanged header
+        * {id} – the read ID, that is, the part of the header before the first whitespace
+        * {comment} – the part of the header after the whitespace following the ID
+        * {adapter_name} – the name of adapter that was found in this read or no_adapter if there was none adapter match. If you use --times to do multiple rounds of adapter matching, this is the name of the last found adapter.
+        * {cut_prefix} – the prefix removed by the --cut (or -u) option (that is, when used with a positive length argument)
+        * {cut_suffix} – the suffix removed by the --cut (or -u) option (that is, when used with a negative length argument)
+
+If the --rename option is used with paired-end data, the template is applied separately to both R1 and R2. That is, for R1, the placeholders are replaced with values from R1, and for R2, the placeholders are replaced with values from R2. For example, {comment} becomes R1’s comment in R1 and it becomes R2’s comment in R2.
+
+
 --------------------
 
 **More Information**
@@ -712,27 +1067,5 @@
 Author: Lance Parsons <lparsons@princeton.edu>
 
     ]]></help>
-
-    <citations>
-        <citation type="bibtex">
-@article{marcel_cutadapt_2011,
-	title = {Cutadapt removes adapter sequences from high-throughput sequencing reads},
-	volume = {17},
-	copyright = {Authors who publish with this journal agree to the following terms:     Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a  Creative Commons Attribution License  that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.   Authors  are able to enter into separate, additional contractual arrangements  for the non-exclusive distribution of the journal's published version of  the work (e.g., post it to an institutional repository or publish it in  a book), with an acknowledgement of its initial publication in this  journal.   Authors are permitted and encouraged to post their  work online (e.g., in institutional repositories or on their website)  prior to and during the submission process, as it can lead to productive  exchanges, as well as earlier and greater citation of published work  (See  The Effect of Open Access ).},
-	url = {http://journal.embnet.org/index.php/embnetjournal/article/view/200},
-	abstract = {When small RNA is sequenced on current sequencing machines, the resulting reads are usually longer than the RNA and therefore contain parts of the 3' adapter. That adapter must be found and removed error-tolerantly from each read before read mapping. Previous solutions are either hard to use or do not offer required features, in particular support for color space data. As an easy to use alternative, we developed the command-line tool cutadapt, which supports 454, Illumina and SOLiD (color space) data, offers two adapter trimming algorithms, and has other useful features.
-
-Cutadapt, including its MIT-licensed source code, is available for download at http://code.google.com/p/cutadapt/},
-	number = {1},
-	urldate = {2011-08-02},
-	journal = {EMBnet.journal},
-	author = {Marcel, Martin},
-	year = {2011},
-	note = {When small RNA is sequenced on current sequencing machines, the resulting reads are usually longer than the RNA and therefore contain parts of the 3' adapter. That adapter must be found and removed error-tolerantly from each read before read mapping. Previous solutions are either hard to use or do not offer required features, in particular support for color space data. As an easy to use alternative, we developed the command-line tool cutadapt, which supports 454, Illumina and SOLiD (color space) data, offers two adapter trimming algorithms, and has other useful features.   Cutadapt, including its MIT-licensed source code, is available for download at  http://code.google.com/p/cutadapt/},
-	keywords = {Adapter removal;, fastq, MicroRNA, Sequencing, Small RNA, software},
-	file = {Cutadapt removes adapter sequences from high-throughput sequencing reads | Martin | EMBnet.journal:/Users/lparsons/Library/Application Support/Firefox/Profiles/thd2t4je.default/zotero/storage/ZXZT4PSE/200.html:text/html}
-}
-        </citation>
-    </citations>
-
+    <expand macro="citations" />
 </tool>
--- a/macros.xml	Fri Apr 30 10:13:37 2021 +0000
+++ b/macros.xml	Wed Jun 02 22:47:34 2021 +0000
@@ -1,18 +1,42 @@
 <macros>
-
+    <token name="@TOOL_VERSION@">3.4</token>
+    <token name="@GALAXY_TOOL_VERSION@">galaxy0</token>
+    <xml name="edam_ontology">
+        <edam_topics>                                                                                  
+            <edam_topic>topic_0632</edam_topic>
+        </edam_topics>
+        <edam_operations>
+            <edam_operation>operation_0231</edam_operation>
+        </edam_operations>
+    </xml>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="@TOOL_VERSION@">cutadapt</requirement>
+        </requirements>
+    </xml>
+    <xml name="citations">
+        <citations>
+            <citation type="doi">10.14806/ej.17.1.200</citation>
+        </citations>
+    </xml>
+    <xml name="xrefs">
+        <xrefs>
+            <xref type='bio.tools'>cutadapt</xref>
+        </xrefs>
+    </xml>
      <token name="@read1_options@"><![CDATA[
 
         ## Read1 trimming
 
         #for $a in $library.r1.adapters
             #if $a.adapter_source.adapter_source_list == 'builtin':
-                -a '${a.adapter_source.adapter.fields.name}'='${a.adapter_source.adapter}'
+                -a '${a.adapter_source.adapter.fields.name}'='${a.adapter_source.adapter}${adapter_options.internal}'
             #else if $a.adapter_source.adapter_source_list == 'file':
-                -a file:'${a.adapter_source.adapter_file}'
+                -a file:'${a.adapter_source.adapter_file}${adapter_options.internal}'
             #else if str($a.adapter_source.adapter_name) != "":
-                -a '${a.adapter_source.adapter_name}'='${a.adapter_source.adapter}'
+                -a '${a.adapter_source.adapter_name}'='${a.adapter_source.adapter}${adapter_options.internal}'
             #else
-                -a '${a.adapter_source.adapter}'
+                -a '${a.adapter_source.adapter}${adapter_options.internal}'
             #end if
         #end for
         #for $aa in $library.r1.anywhere_adapters
@@ -28,13 +52,13 @@
         #end for
         #for $fa in $library.r1.front_adapters
             #if $fa.front_adapter_source.front_adapter_source_list == 'builtin':
-                -g '${fa.front_adapter_source.front_adapter.fields.name}'='${fa.front_adapter_source.front_adapter}'
+                -g '${fa.front_adapter_source.front_adapter.fields.name}'='${adapter_options.internal}${fa.front_adapter_source.front_adapter}'
             #else if $fa.front_adapter_source.front_adapter_source_list == 'file':
-                -g file:'${fa.front_adapter_source.front_adapter_file}'
+                -g file:'${adapter_options.internal}${fa.front_adapter_source.front_adapter_file}'
             #else if str($fa.front_adapter_source.front_adapter_name) != "":
-                -g '${fa.front_adapter_source.front_adapter_name}'='${fa.front_adapter_source.front_adapter}'
+                -g '${fa.front_adapter_source.front_adapter_name}'='${adapter_options.internal}${fa.front_adapter_source.front_adapter}'
             #else
-                -g '${fa.front_adapter_source.front_adapter}'
+                -g '${adapter_options.internal}${fa.front_adapter_source.front_adapter}'
             #end if
         #end for
 
@@ -44,22 +68,22 @@
 
         ## Additional Outputs
 
-        #if $output_options.info_file:
+        #if 'info_file' in $output_selector:
             --info-file=$info_file
         #end if
-        #if $output_options.rest_file:
+        #if 'rest_file' in $output_selector:
             --rest-file='${rest_output}'
         #end if
-        #if $output_options.wildcard_file:
+        #if 'wildcard_file' in $output_selector:
             --wildcard-file='${wild_output}'
         #end if
-        #if $output_options.too_short_file:
+        #if 'too_short_file' in $output_selector:
             --too-short-output='${too_short_output}'
         #end if
-        #if $output_options.too_long_file:
+        #if 'too_long_file' in $output_selector:
             --too-long-output='${too_long_output}'
         #end if
-        #if $output_options.untrimmed_file:
+        #if 'untrimmed_file' in $output_selector:
             --untrimmed-output='${untrimmed_output}'
         #end if
 
@@ -71,13 +95,13 @@
 
         #for $a in $library.r2.adapters2
             #if $a.adapter_source2.adapter_source_list2 == 'builtin':
-                -A '${a.adapter_source2.adapter2.fields.name}'='${a.adapter_source2.adapter2}'
+                -A '${a.adapter_source2.adapter2.fields.name}'='${a.adapter_source2.adapter2}${adapter_options.internal}'
             #else if $a.adapter_source2.adapter_source_list2 == 'file':
-                -A file:'${a.adapter_source2.adapter_file2}'
+                -A file:'${a.adapter_source2.adapter_file2}${adapter_options.internal}'
             #else if str($a.adapter_source2.adapter_name2) != "":
-                -A '${a.adapter_source2.adapter_name2}'='${a.adapter_source2.adapter2}'
+                -A '${a.adapter_source2.adapter_name2}'='${a.adapter_source2.adapter2}${adapter_options.internal}'
             #else
-                -A '${a.adapter_source2.adapter2}'
+                -A '${a.adapter_source2.adapter2}${adapter_options.internal}'
             #end if
         #end for
         #for $aa in $library.r2.anywhere_adapters2
@@ -93,13 +117,13 @@
         #end for
         #for $fa in $library.r2.front_adapters2
             #if $fa.front_adapter_source2.front_adapter_source_list2 == 'builtin':
-                -G '${fa.front_adapter_source2.front_adapter2.fields.name}'='${fa.front_adapter_source2.front_adapter2}'
+                -G '${fa.front_adapter_source2.front_adapter2.fields.name}'='${adapter_options.internal}${fa.front_adapter_source2.front_adapter2}'
             #else if $fa.front_adapter_source2.front_adapter_source_list2  == 'file':
-                -G file:'${fa.front_adapter_source2.front_adapter_file2}'
+                -G file:'${adapter_options.internal}${fa.front_adapter_source2.front_adapter_file2}'
             #else if str($fa.front_adapter_source2.front_adapter_name2) != "":
-                -G '${fa.front_adapter_source2.front_adapter_name2}'='${fa.front_adapter_source2.front_adapter2}'
+                -G '${fa.front_adapter_source2.front_adapter_name2}'='${adapter_options.internal}${fa.front_adapter_source2.front_adapter2}'
             #else
-                -G '${fa.front_adapter_source2.front_adapter2}'
+                -G '${adapter_options.internal}${fa.front_adapter_source2.front_adapter2}'
             #end if
         #end for
 
@@ -109,13 +133,13 @@
 
         ## Additional Outputs - Read 2
 
-        #if $output_options.too_short_file:
+        #if 'too_short_file' in $output_selector:
             --too-short-paired-output='${too_short_paired_output}'
         #end if
-        #if $output_options.too_long_file:
+        #if 'too_long_file' in $output_selector:
             --too-long-paired-output='${too_long_paired_output}'
         #end if
-        #if $output_options.untrimmed_file:
+        #if 'untrimmed_file' in $output_selector:
             --untrimmed-paired-output='${untrimmed_paired_output}'
         #end if
 
@@ -181,7 +205,7 @@
                         <param name="adapter_source_list" type="select" label="Source" >
                             <option value="builtin" selected="True">Standard (select from the list below)</option>
                             <option value="user">Enter custom sequence</option>
-                            <option value="file">File From History</option>
+                            <option value="file">File from history</option>
                         </param>
 
                         <when value="user">
@@ -204,7 +228,7 @@
                         <param name="front_adapter_source_list" type="select" label="Source">
                             <option value="builtin" selected="True">Standard (select from the list below)</option>
                             <option value="user">Enter custom sequence</option>
-                            <option value="file">File From History</option>
+                            <option value="file">File from history</option>
                         </param>
 
                         <when value="user">
@@ -225,7 +249,7 @@
                         <param name="anywhere_adapter_source_list" type="select" label="Source">
                             <option value="builtin" selected="True">Standard (select from the list below)</option>
                             <option value="user">Enter custom sequence</option>
-                            <option value="file">File From History</option>
+                            <option value="file">File from history</option>
                         </param>
 
                         <when value="user">
@@ -260,7 +284,7 @@
                         <param name="adapter_source_list2" type="select" label="Source" >
                             <option value="builtin" selected="True">Standard (select from the list below)</option>
                             <option value="user">Enter custom sequence</option>
-                            <option value="file">File From History</option>
+                            <option value="file">File from history</option>
                         </param>
 
                         <when value="user">
@@ -282,7 +306,7 @@
                         <param name="front_adapter_source_list2" type="select" label="Source">
                             <option value="builtin" selected="True">Standard (select from the list below)</option>
                             <option value="user">Enter custom sequence</option>
-                            <option value="file">File From History</option>
+                            <option value="file">File from history</option>
                         </param>
 
                         <when value="user">
@@ -303,7 +327,7 @@
                         <param name="anywhere_adapter_source_list2" type="select" label="Source">
                             <option value="builtin" selected="True">Standard (select from the list below)</option>
                             <option value="user">Enter custom sequence</option>
-                            <option value="file">File From History</option>
+                            <option value="file">File from history</option>
                         </param>
 
                         <when value="user">
Binary file test-data/A1.fastq.gz has changed
Binary file test-data/A2.fastq.gz has changed
Binary file test-data/bwa-mem-fastq1_assimetric.fq.gz has changed
Binary file test-data/bwa-mem-fastq2_assimetric.fq.gz has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cutadapt_action_lowercase.out	Wed Jun 02 22:47:34 2021 +0000
@@ -0,0 +1,12 @@
+@prefix:1_13_573/1
+cgtccgaantagctaccaccctgattagacaaat
++
+)3%)&&&&!.1&(6:<'67..*,:75)'77&&&5
+@prefix:1_13_1259/1
+AGCCGCTANGACGGGTTGGCCCTTAGACGTATCT
++
+;<:&:A;A!9<<<,7:<=3=;:<&<?<?8<;=<&
+@prefix:1_13_1440/1
+CAAGATCTNCCCTGCCACATTGCCCTAGTTAAAC
++
+<=A:A=57!7<';<6?5;;6:+:=)71>70<,=:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cutadapt_action_mask.out	Wed Jun 02 22:47:34 2021 +0000
@@ -0,0 +1,12 @@
+@prefix:1_13_573/1
+NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
++
+)3%)&&&&!.1&(6:<'67..*,:75)'77&&&5
+@prefix:1_13_1259/1
+AGCCGCTANGACGGGTTGGCCCTTAGACGTATCT
++
+;<:&:A;A!9<<<,7:<=3=;:<&<?<?8<;=<&
+@prefix:1_13_1440/1
+CAAGATCTNCCCTGCCACATTGCCCTAGTTAAAC
++
+<=A:A=57!7<';<6?5;;6:+:=)71>70<,=:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cutadapt_action_none.out	Wed Jun 02 22:47:34 2021 +0000
@@ -0,0 +1,12 @@
+@prefix:1_13_573/1
+CGTCCGAANTAGCTACCACCCTGATTAGACAAAT
++
+)3%)&&&&!.1&(6:<'67..*,:75)'77&&&5
+@prefix:1_13_1259/1
+AGCCGCTANGACGGGTTGGCCCTTAGACGTATCT
++
+;<:&:A;A!9<<<,7:<=3=;:<&<?<?8<;=<&
+@prefix:1_13_1440/1
+CAAGATCTNCCCTGCCACATTGCCCTAGTTAAAC
++
+<=A:A=57!7<';<6?5;;6:+:=)71>70<,=:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cutadapt_action_retain.out	Wed Jun 02 22:47:34 2021 +0000
@@ -0,0 +1,12 @@
+@prefix:1_13_573/1
+CGTCCGAANTAG
++
+)3%)&&&&!.1&
+@prefix:1_13_1259/1
+AGCCGCTANGACGGGTTGGCCCTTAGACGTATCT
++
+;<:&:A;A!9<<<,7:<=3=;:<&<?<?8<;=<&
+@prefix:1_13_1440/1
+CAAGATCTNCCCTGCCACATTGCCCTAGTTAAAC
++
+<=A:A=57!7<';<6?5;;6:+:=)71>70<,=:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cutadapt_builtin_internal_adapter.out	Wed Jun 02 22:47:34 2021 +0000
@@ -0,0 +1,12 @@
+@prefix:1_13_573/1
+CGTCCGAANTAGCTACCACCCTGATTAGACAAAT
++
+)3%)&&&&!.1&(6:<'67..*,:75)'77&&&5
+@prefix:1_13_1259/1
+AGCCGCTANGACGGGTTGGCCCTTAGACGTATCT
++
+;<:&:A;A!9<<<,7:<=3=;:<&<?<?8<;=<&
+@prefix:1_13_1440/1
+CAAGATCTNCCCTGCCACATTGCCCTAGTTAAAC
++
+<=A:A=57!7<';<6?5;;6:+:=)71>70<,=:
Binary file test-data/cutadapt_nextseq_out.fq.gz has changed
Binary file test-data/cutadapt_out1.fq.gz has changed
Binary file test-data/cutadapt_out1_internal_adapter.fq.gz has changed
Binary file test-data/cutadapt_out1_max_length.fq.gz has changed
Binary file test-data/cutadapt_out1_max_min_01.fq.gz has changed
Binary file test-data/cutadapt_out1_max_min_02.fq.gz has changed
Binary file test-data/cutadapt_out1_min_length.fq.gz has changed
Binary file test-data/cutadapt_out2.fq.gz has changed
Binary file test-data/cutadapt_out2_internal_adapter.fq.gz has changed
Binary file test-data/cutadapt_out2_max_length.fq.gz has changed
Binary file test-data/cutadapt_out2_max_min_01.fq.gz has changed
Binary file test-data/cutadapt_out2_max_min_02.fq.gz has changed
Binary file test-data/cutadapt_out2_min_length.fq.gz has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cutadapt_revcomp.out	Wed Jun 02 22:47:34 2021 +0000
@@ -0,0 +1,12 @@
+@prefix:1_13_573/1
+CGTCCGAANTAGCTACCACCCTGATTAGACAAAT
++
+)3%)&&&&!.1&(6:<'67..*,:75)'77&&&5
+@prefix:1_13_1259/1
+AGCCGCTANGACGGGTTGGCCCTTAGACGTATCT
++
+;<:&:A;A!9<<<,7:<=3=;:<&<?<?8<;=<&
+@prefix:1_13_1440/1
+CAAGATCTNCCCTGCCACATTGCCCTAGT
++
+<=A:A=57!7<';<6?5;;6:+:=)71>7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cutadapt_shorten_3prime.out	Wed Jun 02 22:47:34 2021 +0000
@@ -0,0 +1,12 @@
+@prefix:1_13_573/1
+CGTCCGAANT
++
+)3%)&&&&!.
+@prefix:1_13_1259/1
+
++
+
+@prefix:1_13_1440/1
+CAAGATCTNC
++
+<=A:A=57!7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cutadapt_shorten_5prime.out	Wed Jun 02 22:47:34 2021 +0000
@@ -0,0 +1,12 @@
+@prefix:1_13_573/1
+TTAGACAAAT
++
+75)'77&&&5
+@prefix:1_13_1259/1
+
++
+
+@prefix:1_13_1440/1
+CTAGTTAAAC
++
+)71>70<,=:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cutadapt_shorten_expected_errors.out	Wed Jun 02 22:47:34 2021 +0000
@@ -0,0 +1,12 @@
+@prefix:1_13_573/1
+CGTCCGAANTAGCTACCACCCTGATTAGACAAAT
++
+)3%)&&&&!.1&(6:<'67..*,:75)'77&&&5
+@prefix:1_13_1259/1
+AGCCGCTANGACGGGTTGGCCCTTAGACGTATCT
++
+;<:&:A;A!9<<<,7:<=3=;:<&<?<?8<;=<&
+@prefix:1_13_1440/1
+CAAGATCTNCCCTGCCACATTGCCCTAGTTAAAC
++
+<=A:A=57!7<';<6?5;;6:+:=)71>70<,=:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cutadapt_shorten_internal_adapters.out	Wed Jun 02 22:47:34 2021 +0000
@@ -0,0 +1,12 @@
+@prefix:1_13_573/1
+CGTCCGAANTAGCTACCACCCTGATTAGACAAAT
++
+)3%)&&&&!.1&(6:<'67..*,:75)'77&&&5
+@prefix:1_13_1259/1
+AGCCGCTANGACGGGTTGGCCCTTAGACGTATCT
++
+;<:&:A;A!9<<<,7:<=3=;:<&<?<?8<;=<&
+@prefix:1_13_1440/1
+CAAGATCTNCCCTGCCACATTGCCCTAGTTAAAC
++
+<=A:A=57!7<';<6?5;;6:+:=)71>70<,=:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cutadapt_small_cut.out	Wed Jun 02 22:47:34 2021 +0000
@@ -0,0 +1,12 @@
+@prefix:1_13_573/1
+GAANTAGCTACCACCCTGATTAGACAAAT
++
+&&&!.1&(6:<'67..*,:75)'77&&&5
+@prefix:1_13_1259/1
+CTANGACGGGTTGGCCCTTAGACGTATCT
++
+A;A!9<<<,7:<=3=;:<&<?<?8<;=<&
+@prefix:1_13_1440/1
+TCTNCCCTGCCACATTGCCCTAGTTAAAC
++
+=57!7<';<6?5;;6:+:=)71>70<,=:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cutadapt_small_rename.out	Wed Jun 02 22:47:34 2021 +0000
@@ -0,0 +1,12 @@
+@prefix:1_13_573/1 barcode=CGTCC
+GAANTAGCTACCACCCTGATTAGACAAAT
++
+&&&!.1&(6:<'67..*,:75)'77&&&5
+@prefix:1_13_1259/1 barcode=AGCCG
+CTANGACGGGTTGGCCCTTAGACGTATCT
++
+A;A!9<<<,7:<=3=;:<&<?<?8<;=<&
+@prefix:1_13_1440/1 barcode=CAAGA
+TCTNCCCTGCCACATTGCCCTAGTTAAAC
++
+=57!7<';<6?5;;6:+:=)71>70<,=:
Binary file test-data/cutadapt_trimmed.out.gz has changed
Binary file test-data/cutadapt_untrimmed.out.gz has changed
Binary file test-data/unknown.fastq.gz has changed