diff cutadapt.xml @ 11:8665bcc8b847 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cutadapt commit 07c4e473990f522bbe8254ddeded47ed5f3b2fe4
author iuc
date Mon, 05 Mar 2018 11:02:48 -0500
parents 01d94df2e32a
children 78e1cf88d133
line wrap: on
line diff
--- a/cutadapt.xml	Tue May 26 16:02:19 2015 -0400
+++ b/cutadapt.xml	Mon Mar 05 11:02:48 2018 -0500
@@ -1,462 +1,582 @@
-<tool id="cutadapt" name="Cutadapt" version="1.6">
+<tool id="cutadapt" name="Cutadapt" version="1.16">
     <description>Remove adapter sequences from Fastq/Fasta</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
     <requirements>
-        <requirement type="package" version="1.6">cutadapt</requirement>
+        <requirement type="package" version="1.16">cutadapt</requirement>
     </requirements>
 
-    <stdio>
-        <exit_code range="1"   level="fatal"   description="IOError, FormatError, or Interrupt" />
-        <exit_code range="2"   level="fatal"   description="Invalid options specified" />
-        <exit_code range="3:"   level="fatal"   description="Unknown error" />
-    </stdio>
-
     <version_command>cutadapt --version</version_command>
 
-    <command>cutadapt
-        #if $input.extension.startswith( "fastq"):
-                --format=fastq
-            #if $input.extension == "fastqillumina":
-                --quality-base=64
-            #end if
-            #if $input.extension == "fastqsolexa":
-                --quality-base=64
+    <command detect_errors="exit_code"><![CDATA[
+
+        ## Link in the input and output files, so Cutadapt can tell their type
+
+        #set compressed="False"
+        #set format = "fastq"
+
+        #if str($library.type) == 'paired':
+
+            #if $library.input_1.is_of_type("fastq.gz", "fastqsanger.gz"):
+                #set read1 = "input_f.fastq.gz"
+                #set compressed = "GZ"
+                #set out1 = "out1.gz"
+            #else if $library.input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                #set read1 = "input_f.fastq.bz2"
+                #set compressed = "BZ2"
+                #set out1 = "out1.bz2"
+            #else if $library.input_1.is_of_type('fasta'):
+                #set format = "fasta"
+                #set read1 = "input_f.fasta"
+                #set out1 = "out1.fa"
+            #else:
+                #set read1 = "input_f.fastq"
+                #set out1 = "out1.fq"
             #end if
-        #else
-        --format=$input.extension
-        #end if
-        #for $a in $adapters
-            #if $a.adapter_source.adapter_source_list == 'prebuilt':
-                --adapter="${a.adapter_source.adapter.fields.name}"='${a.adapter_source.adapter}'
-            #else if str($a.adapter_source.adapter_name) != "":
-                --adapter='${a.adapter_source.adapter_name}'='${a.adapter_source.adapter}'
-            #else
-                --adapter='${a.adapter_source.adapter}'
+            ln -f -s '${library.input_1}' ${read1} &&
+
+            #if $library.input_2.is_of_type("fastq.gz", "fastqsanger.gz"):
+                #set read2 = "input_r.fastq.gz"
+                #set compressed = "GZ"
+                #set out2 = "out2.gz"
+            #else if $library.input_2.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                #set read2 = "input_r.fastq.bz2"
+                #set compressed = "BZ2"
+                #set out2 = "out2.bz2"
+            #else if $library.input_2.is_of_type('fasta'):
+                #set read2 = "input_r.fasta"
+                #set out2 = "out2.fa"
+                #set format = "fasta"
+            #else:
+                #set read2 = "input_r.fastq"
+                #set out2 = "out2.fq"
+            #end if
+            ln -f -s '${library.input_2}' ${read2} &&
+
+
+        #else if str($library.type) == 'paired_collection':
+
+            #if $library.input_1.forward.is_of_type("fastq.gz", "fastqsanger.gz"):
+                #set read1 = "input_f.fastq.gz"
+                #set compressed = "GZ"
+                #set out1 = "out1.gz"
+            #else if $library.input_1.forward.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                #set read1 = "input_f.fastq.bz2"
+                #set compressed = "BZ2"
+                #set out1 = "out1.bz2"
+            #else if $library.input_1.forward.is_of_type('fasta'):
+                #set format = "fasta"
+                #set read1 = "input_f.fasta"
+                #set out1 = "out1.fa"
+            #else:
+                #set read1 = "input_f.fastq"
+                #set out1 = "out1.fq"
             #end if
-        #end for
-        #for $aa in $anywhere_adapters
-            #if $aa.anywhere_adapter_source.anywhere_adapter_source_list == 'prebuilt':
-                --anywhere="${aa.anywhere_adapter_source.anywhere_adapter.fields.name}"='${aa.anywhere_adapter_source.anywhere_adapter}'
-            #else if str($aa.anywhere_adapter_source.anywhere_adapter_name) != "":
-                --anywhere='${aa.anywhere_adapter_source.anywhere_adapter_name}'='${aa.anywhere_adapter_source.anywhere_adapter}'
-            #else
-                --anywhere='${aa.anywhere_adapter_source.anywhere_adapter}'
+            ln -s '${library.input_1.forward}' ${read1} &&
+
+            #if $library.input_1.reverse.is_of_type("fastq.gz", "fastqsanger.gz"):
+                #set read2 = "input_r.fastq.gz"
+                #set compressed = "GZ"
+                #set out1 = "out2.gz"
+            #else if $library.input_1.reverse.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                #set read2 = "input_r.fastq.bz2"
+                #set compressed = "BZ2"
+                #set out2 = "out2.bz2"
+            #else if $library.input_1.reverse.is_of_type("fasta"):
+                #set format = "fasta"
+                #set read2 = "input_r.fasta"
+                #set out2 = "out2.fa"
+            #else:
+                #set read2 = "input_r.fastq"
+                #set out2 = "out2.fq"
             #end if
-        #end for
-        #for $fa in $front_adapters
-            #if $fa.front_adapter_source.front_adapter_source_list == 'prebuilt':
-                --front="${fa.front_adapter_source.front_adapter.fields.name}"='${fa.front_adapter_source.front_adapter}'
-            #else if str($fa.front_adapter_source.front_adapter_name) != "":
-                --front='${fa.front_adapter_source.front_adapter_name}'='${fa.front_adapter_source.front_adapter}'
-            #else
-                --front='${fa.front_adapter_source.front_adapter}'
+            ln -s '${library.input_1.reverse}' ${read2} &&
+
+        #else:
+            #if $library.input_1.is_of_type("fastq.gz", "fastqsanger.gz"):
+                #set read1 = "input_f.fastq.gz"
+                #set compressed = "GZ"
+                #set out1 = "out1.gz"
+            #else if $library.input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"):
+                #set read1 = "input_f.fastq.bz2"
+                #set compressed = "BZ2"
+                #set out1 = "out1.bz2"
+            #else if $library.input_1.is_of_type('fasta'):
+                #set format = "fasta"
+                #set read1 = "input_f.fasta"
+                #set out1 = "out1.fa"
+            #else:
+                #set read1 = "input_f.fastq"
+                #set out1 = "out1.fq"
             #end if
-        #end for
-        --error-rate=$error_rate
-        --times=$count
-        --overlap=$overlap
-        $no_indels
-        $match_read_wildcards
+            ln -f -s '${library.input_1}' ${read1} &&
+        #end if
+
+
+        ## Run Cutadapt
+
+        cutadapt
+
+        -j \${GALAXY_SLOTS:-4}
+
+        --format=$format
+
+       #if str( $library.type ) == "single":
+            @read1_options@
+            --output='$out1'
+        #else:
+            @read1_options@
+            @read2_options@
+            --output='$out1'
+            --paired-output='$out2'
+        #end if
 
-        #if str( $output_filtering_options.output_filtering) == "filter":
-            $output_filtering_options.discard
-            $output_filtering_options.discard_untrimmed
-            $output_filtering_options.no_trim
-            $output_filtering_options.mask_adapter
-            #if str($output_filtering_options.min) != '0':
-                --minimum-length=$output_filtering_options.min
-            #end if
-            #if str($output_filtering_options.max) != '0':
-                --maximum-length=$output_filtering_options.max
+        --error-rate=$adapter_options.error_rate
+        --times=$adapter_options.count
+        --overlap=$adapter_options.overlap
+        $adapter_options.no_indels
+        $adapter_options.match_read_wildcards
+
+
+        $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
+        #if str($filter_options.max) != '0':
+            --maximum-length=$filter_options.max
+        #end if
+        #if $filter_options.max_n:
+            --max-n=$filter_options.max_n
+        #end if
+        #if str( $library.type ) != "single":
+            #if $filter_options.pair_filter:
+                --pair-filter=$filter_options.pair_filter
             #end if
         #end if
 
-        --output='$output'
 
-        #if $paired_end.paired_end_boolean:
-            --paired-output='$paired_output'
+        #if str($read_mod_options.quality_cutoff) != '0':
+           --quality-cutoff=$read_mod_options.quality_cutoff
+        #end if
+        #if str($read_mod_options.nextseq_trim) != '0':
+            --nextseq-trim=$read_mod_options.nextseq_trim
+        #end if
+        $read_mod_options.trim_n
+        #if $read_mod_options.prefix != '':
+            --prefix="$read_mod_options.prefix"
+        #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 != '':
+            --length-tag="$read_mod_options.length_tag"
         #end if
 
-        #if str( $output_params.output_type ) == "additional":
-            #if $output_params.rest_file:
-                --rest-file=$rest_output
-            #end if
-            #if $output_params.wildcard_file:
-                --wildcard-file=$wild_output
-            #end if
-            #if $output_params.too_short_file:
-                --too-short-output=$too_short_output
-            #end if
-            #if $output_params.too_long_file:
-                --too-long-output=$too_long_output
-            #end if
-            #if $output_params.untrimmed_file:
-                --untrimmed-output=$untrimmed_output
-                #if $paired_end.paired_end_boolean:
-                    --untrimmed-paired-output=$untrimmed_paired_output
-                #end if
-            #end if
-            #if $output_params.info_file:
-                --info-file=$info_file
-            #end if
-
-        #end if
-
-        #if str( $read_modification_params.read_modification) == "modify":
-            #if str($read_modification_params.quality_cutoff) != '0':
-               --quality-cutoff=$read_modification_params.quality_cutoff
-            #end if
-            #if str($read_modification_params.cut) != '0':
-               --cut=$read_modification_params.cut
-            #end if
-            #if $read_modification_params.prefix != '':
-                --prefix="$read_modification_params.prefix"
-            #end if
-            #if $read_modification_params.suffix != '':
-                --suffix="$read_modification_params.suffix"
-            #end if
-            #if $read_modification_params.length_tag != '':
-                --length-tag="$read_modification_params.length_tag"
-            #end if
-            $read_modification_params.zero_cap
-        #end if
-
-        '$input'
-
-        #if $paired_end.paired_end_boolean:
-            '$input2'
+        #if str( $library.type ) == "single":
+            '${read1}'
+        #else:
+            '${read1}'
+            '${read2}'
         #end if
 
-        > $report
-    </command>
-    
-    <inputs>
-        <param format="fastq, fastqsanger, fastqillumina, fastqsolexa, fasta" name="input" type="data" optional="false" label="Fastq file to trim" length="100"/>
-        <conditional name="paired_end">
-            <param name="paired_end_boolean" type="boolean" value="false" label="Track Paired Reads" help="This option will keep a second file synchronized if you use one of the filtering options that discards reads. It will NOT trim adapters off of the second read. You must run Cutadapt a second time on the output of the first run to trim adapters from both reads (see Cutadapt documentation for details)." />
-            <when value="true">
-                <param format="fastq, fastqsanger, fastqillumina, fastqsolexa, fasta" name="input2" type="data" optional="false" label="Paired fastq file (NOT trimmed)" length="100"/>
-            </when>
-            <when value="false" />
-        </conditional>
-
-        <repeat name="adapters" title="3' Adapters" help="Sequence of an adapter that was ligated to the 3' end.  The adapter itself and anything that follows is trimmed.">
-            <conditional name="adapter_source">
-                <param name="adapter_source_list" type="select" label="Source" >
-                    <option value="prebuilt" selected="true">Standard (select from the list below)</option>
-                    <option value="user">Enter custom sequence</option>
-                </param>
+        #if $output_options.report:
+            > report.txt
+        #end if
 
-                <when value="user">
-                    <param name="adapter_name" size="30" label="Enter custom 3' adapter name (Optional)" type="text" value="" />
-                    <param name="adapter" size="30" label="Enter custom 3' adapter sequence" type="text" value="AATTGGCC" />
-                </when>
+    ]]></command>
 
-                <when value="prebuilt">
-                    <param name="adapter" type="select" label="Choose 3' adapter">
-                        <options from_file="cutadapt_adapters.txt">
-                            <column name="name" index="1"/>
-                            <column name="value" index="0"/>
-                        </options>
-                    </param>
-                </when>
-            </conditional>
-        </repeat>
-
-        <repeat name="anywhere_adapters" title="5' or 3' (Anywhere) Adapters" help="Sequence of an adapter that was ligated to the 5' or 3' end.  If the adapter is found within the read or overlapping the 3' end of the read, the behavior is the same as for the -a option. If the adapter overlaps the 5' end (beginning of the read), the initial portion of the read matching the adapter is trimmed, but anything that follows is kept. If multiple -a or -b options are given, only the best matching adapter is trimmed.">
-            <conditional name="anywhere_adapter_source">
-                <param name="anywhere_adapter_source_list" type="select" label="Source">
-                    <option value="prebuilt" selected="true">Standard (select from the list below)</option>
-                    <option value="user">Enter custom sequence</option>
-                </param>
+    <inputs>
 
-                <when value="user">
-                    <param name="anywhere_adapter_name" size="30" label="Enter custom 5' or 3' adapter name (Optional)" type="text" value="" />
-                    <param name="anywhere_adapter" size="30" label="Enter custom 5' or 3' adapter sequence" type="text" value="AATTGGCC" />
-                </when>
-                <when value="prebuilt">
-                    <param name="anywhere_adapter" type="select" label="Choose 5' or 3' adapter">
-                        <options from_file="cutadapt_adapters.txt">
-                            <column name="name" index="1"/>
-                            <column name="value" index="0"/>
-                        </options>
-                    </param>
-                </when>
-            </conditional>
-        </repeat>
-
-        <repeat name="front_adapters" title="5' (Front) Adapters" help="Sequence of an adapter that was ligated to the 5' end.  If the adapter sequence starts with the character '^', the adapter is 'anchored'. An anchored adapter must appear in its entirety at the 5' end of the read (it is a prefix of the read). A non-anchored adapter may appear partially at the 5' end, or it may occur within the read. If it is found within a read, the sequence preceding the adapter is also trimmed. In all cases the adapter itself is trimmed.">
-            <conditional name="front_adapter_source">
-                <param name="front_adapter_source_list" type="select" label="Source">
-                    <option value="prebuilt" selected="true">Standard (select from the list below)</option>
-                    <option value="user">Enter custom sequence</option>
-                </param>
+        <!-- Reads -->
+        <conditional name="library">
+            <param name="type" type="select" label="Single-end or Paired-end reads?">
+                <option value="single">Single-end</option>
+                <option value="paired">Paired-end</option>
+                <option value="paired_collection">Paired-end Collection</option>
+            </param>
 
-                <when value="user">
-                    <param name="front_adapter_name" size="30" label="Enter custom 5' adapter name (Optional)" type="text" value="" />
-                    <param name="front_adapter" size="30" label="Enter custom 5' adapter sequence" type="text" value="AATTGGCC" />
-                </when>
-                <when value="prebuilt">
-                    <param name="front_adapter" type="select" label="Choose 5' adapter">
-                        <options from_file="cutadapt_adapters.txt">
-                            <column name="name" index="1"/>
-                            <column name="value" index="0"/>
-                        </options>
-                    </param>
-                </when>
-            </conditional>
-        </repeat>
+            <when value="single">
+                <param name="input_1" format="fastq.gz,fastq,fastqsanger,fastqsanger.gz,fastqsanger.bz2,fasta" type="data" label="FASTQ/A file" help="Should be of datatype &quot;fastq.gz&quot; or &quot;fasta&quot;" />
+                <expand macro="single_end_options" />
+            </when>
 
-        <param name="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" 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" 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" 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="boolean" value="false" truevalue="--match-read-wildcards" falsevalue="" label="Match Read Wildcards" help="Allow 'N's in the read as matches to the adapter." />
+            <when value="paired">
+                <param name="input_1" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2,fasta" type="data" label="FASTQ/A file #1" help="Should be of datatype &quot;fastq.gz&quot;or &quot;fasta&quot;" />
+                <param name="input_2" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2,fasta" type="data" label="FASTQ/A file #2" help="Should be of datatype &quot;fastq.gz&quot;or &quot;fasta&quot;" />
+                <expand macro="paired_end_options" />
+            </when>
 
-        <conditional name="output_filtering_options">
-            <param name="output_filtering" type="select" label="Output filtering options" help="Options for filtering processed reads by those that contain the adapter or by minimum or maximum length">
-                <option value="default">Default (no filtering)</option>
-                <option value="filter">Set Filters</option>
-            </param>
-            <when value="default" />
-            <when value="filter">
-                <param name="discard" type="boolean" value="false" truevalue="--discard" 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" type="boolean" value="false" truevalue="--discard-untrimmed" falsevalue="" label="Discard Untrimmed Reads" help="Discard reads that do not contain the adapter." />
-                <param name="min" 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" 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" 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" type="boolean" value="false" truevalue="--mask-adapter" falsevalue="" label="Mask Adapters" help="Mask adapter bases with 'N' instead of trimming them (default: trim adapters)." />
+            <when value="paired_collection">
+                <param name="input_1" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2,fasta" type="data_collection" collection_type="paired" label="Paired Collection" help="Should be of datatype &quot;fastq.gz&quot; or &quot;fasta&quot;" />
+                <expand macro="paired_end_options" />
             </when>
         </conditional>
 
-        <conditional name="output_params">
-            <param name="output_type" type="select" label="Additional output options" help="By default all reads will be put in the same file.  However, reads with adapters matching in the middle, unmatched reads, and too-short reads can be saved in separate files.">
-                <option value="default">Default</option>
-                <option value="additional">Additional output files</option>
+        <!-- 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" 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." />
+        </section>
+
+        <!-- Filter Options -->
+        <section name="filter_options" title="Filter Options">
+            <param name="discard" argument="--discard-trimmed" type="boolean" value="False" truevalue="--discard" 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="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>
+                <option value="both">both</option>
             </param>
-            <when value="default" />
-            <when value="additional">
-                <param name="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" 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" 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" 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" 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" 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)"/>
-            </when>
-        </conditional>
+        </section>
 
-        <conditional name="read_modification_params">
-            <param name="read_modification" type="select" label="Additional modifications to reads" help="Various options to trim reads based on quality, modify read names and quality scores">
-                <option value="none">No Read Modifications</option>
-                <option value="modify">Set Modification Options</option>
+        <!-- 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.">
+                <sanitizer>
+                    <valid initial="string.digits"><add value="," /></valid>
+                </sanitizer>
             </param>
-            <when value="none" />
-            <when value="modify">
-                <param name="cut" type="integer" optional="true" value="0" label="Cut bases from reads before adapter trimming" help="Remove bases from the beginning or end of each read before trimming adapters. If positive, the bases are removed from the beginning of each read. If negative, the bases are removed from the end of each read." />
-                <param name="quality_cutoff" type="integer" min="0" optional="true" value="0" label="Quality cutoff" help="Trim low-quality ends from reads before adapter removal. The algorithm is the same as the one used by BWA (Subtract CUTOFF from all qualities; compute partial sums from all indices to the end of the sequence; cut sequence at the index at which the sum is minimal). Value of 0 means no quality trimming." />
-                <param name="prefix" label="Prefix" type="text" help="Add this prefix to read names" />
-                <param name="suffix" label="Suffix" type="text" help="Add this suffix to read names" />
-                <param name="strip_suffix" label="Strip suffix" type="text" help="Remove this suffix from read names if present." />
-                <param name="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 name="zero_cap" type="boolean" value="false" label="Change negative quality values to zero (0)" truevalue="--zero-cap" falsevalue="" help="Workaround to avoid segmentation faults in BWA" />
-            </when>
-        </conditional>
+            <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'." />
+        </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."/>
+            <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)"/>
+        </section>
+
     </inputs>
 
     <outputs>
-        <data format="txt" name="report" label="${tool.name} on ${on_string} (Report)" />
-        <data format_source="input" name="output" metadata_source="input" label="${tool.name} on ${on_string} (Reads)"/>
-        <data format_source="input" name="paired_output" metadata_source="input" label="${tool.name} on ${on_string} (Paired Reads)" >
-            <filter>(paired_end['paired_end_boolean'] is True)</filter>
+        <data name="out1" format_source="input_1" metadata_source="input_1" from_work_dir="out1*" label="${tool.name} on ${on_string}: Read 1 Output"/>
+        <data name="out2" format_source="input_2" metadata_source="input_2" from_work_dir="out2*" label="${tool.name} on ${on_string}: Read 2 Output" >
+            <filter>(library['type'] == 'paired' or library['type'] == 'paired_collection')</filter>
+        </data>
+
+        <data name="report" format="txt" from_work_dir="report.txt" label="${tool.name} on ${on_string}: Report">
+            <filter>(output_options['report'] is True)</filter>
         </data>
-        <data format_source="input" name="rest_output" metadata_source="input" label="${tool.name} on ${on_string} (Rest of Reads)" >
-            <filter>(output_params['output_type'] == "additional")</filter>
-            <filter>(output_params['rest_file'] is True)</filter>
+
+        <data  name="info_file" format_source="txt" metadata_source="input_1" label="${tool.name} on ${on_string}: Info File" >
+            <filter>(output_options['info_file'] is True)</filter>
         </data>
-        <data format_source="txt" name="wild_output" metadata_source="input" label="${tool.name} on ${on_string} (Wildcard File)" >
-            <filter>(output_params['output_type'] == "additional")</filter>
-            <filter>(output_params['wildcard_file'] is True)</filter>
+
+        <data name="rest_output" format_source="input_1" metadata_source="input_1" label="${tool.name} on ${on_string}: Rest of Reads (R1 only)" >
+            <filter>(output_options['rest_file'] is True)</filter>
         </data>
-        <data format_source="input" name="too_short_output" metadata_source="input" label="${tool.name} on ${on_string} (Too Short Reads)" >
-            <filter>(output_params['output_type'] == "additional")</filter>
-            <filter>(output_params['too_short_file'] is True)</filter>
+
+        <data name="wild_output" format_source="txt" metadata_source="input_1" label="${tool.name} on ${on_string}: Wildcard File" >
+            <filter>(output_options['wildcard_file'] is True)</filter>
         </data>
-        <data format_source="input" name="too_long_output" metadata_source="input" label="${tool.name} on ${on_string} (Too Long Reads)" >
-            <filter>(output_params['output_type'] == "additional")</filter>
-            <filter>(output_params['too_long_file'] is True)</filter>
+
+        <data name="untrimmed_output" format_source="input_1" metadata_source="input_1" label="${tool.name} on ${on_string}: Untrimmed Read 1" >
+            <filter>(output_options['untrimmed_file'] is True)</filter>
         </data>
-        <data format_source="input" name="untrimmed_output" metadata_source="input" label="${tool.name} on ${on_string} (Untrimmed Reads)" >
-            <filter>(output_params['output_type'] == "additional")</filter>
-            <filter>(output_params['untrimmed_file'] is True)</filter>
+        <data name="untrimmed_paired_output" format_source="input_2" metadata_source="input_2" 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>
+        </data>
+
+        <data name="too_short_output" format_source="input_1" metadata_source="input_1" label="${tool.name} on ${on_string}: Too Short Read 1" >
+            <filter>(output_options['too_short_file'] is True)</filter>
         </data>
-        <data format_source="input" name="untrimmed_paired_output" metadata_source="input" label="${tool.name} on ${on_string} (Untrimmed Paired Reads)" >
-            <filter>(paired_end['paired_end_boolean'] is True)</filter>
-            <filter>(output_params['output_type'] == "additional")</filter>
-            <filter>(output_params['untrimmed_file'] is True)</filter>
+        <data name="too_short_paired_output" format_source="input_2" metadata_source="input_2" 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>
         </data>
-        <data format_source="txt" name="info_file" metadata_source="input" label="${tool.name} on ${on_string} (Info File)" >
-            <filter>(output_params['output_type'] == "additional")</filter>
-            <filter>(output_params['info_file'] is True)</filter>
+
+        <data name="too_long_output" format_source="input_1" metadata_source="input_1" label="${tool.name} on ${on_string}: Too Long Read 1" >
+            <filter>(output_options['too_long_file'] is True)</filter>
+        </data>
+        <data name="too_long_paired_output" format_source="input_2" metadata_source="input_2" 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>
         </data>
     </outputs>
 
     <tests>
+        <!-- Ensure fastq works -->
         <test>
-            <param name="input" value="cutadapt_small.fastq" ftype="fastqsanger"/>
-            <param name="anywhere_adapter_source_list" value="user"/>
-            <param name="anywhere_adapter" value="TTAGACATATCTCCGTCG"/>
-            <param name="output_filtering" value="default"/>
-            <param name="read_modification" value="none"/>
-            <param name="output_type" value="default"/>
-            <output name="output" file="cutadapt_small.out"/>
+            <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"/>
+            <output name="out1" file="cutadapt_small.out"/>
+        </test>
+        <!-- Ensure single end fastq.gz works -->
+        <test>
+            <param name="type" value="single" />
+            <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"/>
+            <output name="out1" decompress="True" file="cutadapt_out1.fq.gz"/>
         </test>
+        <!-- Ensure paired end fastq.gz works -->
         <test>
-            <param name="input" value="cutadapt_small.fastq" ftype="fastqsanger"/>
+            <param name="type" value="paired" />
+            <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1.fq.gz" />
+            <param name="input_2" ftype="fastq.gz" value="bwa-mem-fastq2.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"/>
+            <output name="out1" decompress="True" file="cutadapt_out1.fq.gz"/>
+            <output name="out2" decompress="True" file="cutadapt_out2.fq.gz"/>
+        </test>
+        <!-- Ensure built-in adapters work -->
+        <test>
+            <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"/>
+            <output name="out1" file="cutadapt_builtin.out"/>
+        </test>
+        <!-- Ensure discard file output works -->
+        <test>
+            <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
             <param name="adapter_source_list" value="user"/>
             <param name="adapter" value="TTAGACATATCTCCGTCG"/>
             <param name="output_filtering" value="filter"/>
-            <param name="discard" value="true"/>
+            <param name="discard" value="True"/>
             <param name="read_modification" value="none"/>
             <param name="output_type" value="default"/>
-            <output name="output" file="cutadapt_discard.out"/>
+            <output name="out1" file="cutadapt_discard.out"/>
         </test>
+        <!-- Ensure rest file output works -->
         <test>
-            <param name="input" value="cutadapt_rest.fa" ftype="fasta"/>
+            <param name="input_1" ftype="fasta" value="cutadapt_rest.fa" />
             <param name="adapter_source_list" value="user"/>
-            <param name="adapter" value="ADAPTER"/>
+            <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"/>
-            <output name="output" file="cutadapt_rest.out"/>
+            <param name="rest_file" value="True"/>
+            <output name="out1" file="cutadapt_rest.out"/>
             <output name="rest_output" file="cutadapt_rest2.out"/>
         </test>
+        <!-- Ensure nextseq-trim option works -->
+        <test>
+            <param name="type" value="single" />
+            <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="read_modification" value="modify"/>
+            <param name="nextseq_trim" value="20" />
+            <output name="out1" decompress="True" file="cutadapt_nextseq_out.fq.gz"/>
+        </test>
+        <!-- Ensure Report and Info file output work -->
+        <test>
+            <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"/>
+            <param name="report" value="True" />
+            <param name="info_file" value="True" />
+            <output name="out1" value="cutadapt_small.out"/>
+            <output name="report">
+                <assert_contents>
+                    <has_text text="Summary"/>
+                </assert_contents>
+            </output>
+            <output name="info_file" value="cutadapt_info_out.txt"/>
+        </test>
     </tests>
 
-    <help>
-Summary
--------
-This tool removes adapter sequences from DNA high-throughput
-sequencing data. This is usually necessary when the read length of the
-machine is longer than the molecule that is sequenced, such as in
-microRNA data.
+    <help><![CDATA[
+
+.. class:: infomark
+
+**What it does**
+
+-------------------
+
+**Cutadapt** finds and removes adapter sequences, primers, poly-A tails and other types of unwanted sequence from your high-throughput sequencing reads.
+
+Cleaning your data in this way is often required: Reads from small-RNA sequencing contain the 3’ sequencing adapter because the read is longer than the molecule that is sequenced, such as in microRNA, or CRISPR data, or Poly-A tails that are useful for pulling out RNA from your sample but often you don’t want them to be in your reads.
+
+Cutadapt_ helps with these trimming tasks by finding the adapter or primer sequences in an error-tolerant way. It can also modify and filter reads in various ways. Cutadapt searches for the adapter in all reads and removes it when it finds it. Unless you use a filtering option, all reads that were present in the input file will also be present in the output file, some of them trimmed, some of them not. Even reads that were trimmed entirely (because the adapter was found in the very beginning) are output. All of this can be changed with options in the tool form above.
+
+The tool is based on the **Open Source** Cutadapt_ tool. See the complete `Cutadapt documentation`_ for additional details. If you use Cutadapt, please cite *Marcel, 2011* under **Citations** below.
+
+-------------------
+
+**Inputs**
+
+-------------------
 
-The tool is based on the opensource `cutadapt 
-&lt;http://code.google.com/p/cutadapt/>`_ tool. See the `complete cutadapt
-documentation &lt;https://cutadapt.readthedocs.org/en/latest/index.html>`_ for additional details.
+Input files for Cutadapt need to be:
+
+- FASTQ.GZ, FASTQ.BZ2, FASTQ or FASTA
+
+To trim an adapter, input the ADAPTER sequence e.g. AACCGGTT (with the characters: **$**, **^**, **...**, if anchored or linked).
 
------
+    =============================================   ===================
+    **Option**                                      **Sequence**
+    ---------------------------------------------   -------------------
+    3’ (End) Adapter                                ADAPTER
+    Anchored 3’ Adapter                             ADAPTER$
 
-Algorithm
----------
+    5’ (Front) Adapter                              ADAPTER
+    Anchored 5’ Adapter                             ^ADAPTER
+
+    5’ or 3’ (Both possible)                        ADAPTER
 
-cutadapt uses a simple semi-global alignment algorithm, without any special optimizations.
-For speed, the algorithm is implemented as a Python extension module in ``calignmodule.c``.
+    Linked Adapter - 3' (End) only                  ADAPTER1...ADAPTER2
+    Non-anchored Linked Adapter - 5' (Front) only   ADAPTER1...ADAPTER2
+    =============================================   ===================
+
+Below is an illustration of the allowed adapter locations relative to the read and depending on the adapter type:
+
+.. image:: $PATH_TO_IMAGES/adapters.svg
 
 
-Partial adapter matches
------------------------
+-------------------
+
+*Example: Illumina TruSeq Adapters*
 
-Cutadapt correctly deals with partial adapter matches. As an example, suppose
-your adapter sequence is ``ADAPTER`` (specified via 3' Adapters parameter).
-If you have these input sequences::
+-------------------
 
-    MYSEQUENCEADAPTER
-    MYSEQUENCEADAP
-    MYSEQUENCEADAPTERSOMETHINGELSE
+If you have reads containing Illumina TruSeq adapters, for example, follow these steps.
 
-All of them will be trimmed to ``MYSEQUENCE``. If the sequence starts with an
-adapter, like this::
 
-    ADAPTERSOMETHING
+For Single-end reads as well as the first reads of Paired-end data:
 
-It will be empty after trimming.
+**Read 1**
 
-When the allowed error rate is sufficiently high, errors in
-the adapter sequence are allowed. For example, ``ADABTER`` (1 mismatch), ``ADAPTR`` (1 deletion),
-and ``ADAPPTER`` (1 insertion) will all be recognized if the error rate is set to 0.15.
+In the **3' (End) Adapters** option above, insert A + the “TruSeq Indexed Adapter” prefix that is common to all Indexed Adapter sequences, e.g insert:
+
+AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC
 
 
-Anchoring 5' adapters
----------------------
+For the second reads of Paired-end data:
+
+**Read 2**
 
-If you specify a 5' (Front) adapter, the adapter may overlap the beginning of the read or
-occur anywhere whithin it. If it appears withing the read, the sequence that precedes it
-will also be trimmed in addition to the adapter. For example when the adapter sequence is
-``ADAPTER``::
+In the **3' (End) Adapters** option above, insert the reverse complement of the “TruSeq Universal Adapter”:
+
+AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT
+
+The adapter sequences can be found in the document `Illumina TruSeq Adapters De-Mystified`_.
 
-    HELLOADAPTERTHERE
-    APTERTHERE
+-----------
+
+**Outputs**
+
+-----------
 
-will both be trimmed to ``THERE``. To avoid this, you can prefix the adapter with the character
-``^``. This will restrict the search, forcing the adapter to be a prefix of the read. With
-the adapter sequence set to ``^ADAPTER``, only reads like this will be trimmed::
+- Trimmed reads
 
-    ADAPTERHELLO
+Optionally, under **Output Options** you can choose to output
+
+    * Report
+    * Info file
 
 
-Allowing adapters anywhere
---------------------------
+**Report**
+
+Cutadapt can output per-adapter statistics if you select to output the report above.
+
+Example:
 
-Cutadapt assumes that any adapter specified via the 3' Adapter parameter
-was ligated to the 3\' end of the sequence. This is the correct assumption for
-at least the SOLiD and Illumina small RNA protocols and probably others.
-The assumption is enforced by the alignment algorithm, which only finds the adapter
-when its starting position is within the read. In other words, the 5' base of
-the adapter must appear within the read. The adapter and all bases following
-it are removed.
+        *This is cutadapt 1.16 with Python 3.6.4*
 
-If, on the other hand, your adapter can also be ligated to the 5' end (on
-purpose or by accident), you should tell cutadapt so by using the Anywhere Adapter
-parameter. It will then use a slightly different alignment algorithm
-(so-called semiglobal alignment), which allows any type of overlap between the
-adapter and the sequence. In particular, the adapter may appear only partially
-in the beginning of the read, like this::
+        *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).*
 
-    PTERMYSEQUENCE
+        *=== Summary ===*
 
-The decision which part of the read to remove is made as follows: If there is at
-least one base before the found adapter, then the adapter is considered to be
-a 3' adapter and the adapter itself and everything following it is removed.
-Otherwise, the adapter is considered to be a 5' adapter and it is removed from
-the read.
+        * Total reads processed:                       3*
+        * Reads with adapters:                         0 (0.0%)*
+        * Reads written (passing filters):             3 (100.0%)*
 
-Here are some examples, which may make this clearer (left: read, right: trimmed
-read)::
+        * Total basepairs processed:           102 bp*
+        * Total written (filtered):            102 bp (100.0%)*
 
-    MYSEQUENCEADAPTER -> MYSEQUENCE (3' adapter)
-    MADAPTER -> M (3' adapter)
-    ADAPTERMYSEQUENCE -> MYSEQUENCE (5' adapter)
-    PTERMYSEQUENCE -> MYSEQUENCE (5' adapter)
+        *=== Adapter 1 ===*
 
-The regular algorithm (3' Adapter) would trim the first two examples in the same way,
-but trim the third to an empty sequence and trim the fourth not at all.
+        *Sequence: AGATCGGAAGAGC; Type: regular 3'; Length: 13; Trimmed: 0 times.*
 
 
-Format of the info file
------------------------
-The info file contains information about the found adapters. The output is a tab-separated text file. Each line corresponds to one read of the input file. The fields are:
+**Info file**
+
+The info file contains information about the found adapters. The output is a tab-separated text file. Each line corresponds to one read of the input file.
+
+Columns contain the following data:
 
-1. Read name
-2. Number of errors
-3. 0-based start coordinate of the adapter match
-4. 0-based end coordinate of the adapter match
-5. Sequence of the read to the left of the adapter match (can be empty)
-6. Sequence of the read that was matched to the adapter
-7. Sequence of the read to the right of the adapter match (can be empty)
-8. Name of the found adapter.
+    * **1st**:   Read name
+    * **2nd**:   Number of errors
+    * **3rd**:   0-based start coordinate of the adapter match
+    * **4th**:   0-based end coordinate of the adapter match
+    * **5th**:   Sequence of the read to the left of the adapter match (can be empty)
+    * **6th**:   Sequence of the read that was matched to the adapter
+    * **7th**:   Sequence of the read to the right of the adapter match (can be empty)
+    * **8th**:   Name of the found adapter
+    * **9th**:   Quality values corresponding to sequence left of the adapter match (can be empty)
+    * **10th**:  Quality values corresponding to sequence matched to the adapter (can be empty)
+    * **11th**:  Quality values corresponding to sequence to the right of the adapter (can be empty)
 
-The concatenation of the fields 5-7 yields the full read sequence. In column 8, adapters without a name are numbered starting from 1.
+The concatenation of columns 5-7 yields the full read sequence. Column 8 identifies the found adapter. Adapters without a name are numbered starting from 1. Fields 9-11 are empty if quality values are not available. Concatenating them yields the full sequence of quality values.
 
 If no adapter was found, the format is as follows:
 
-1. Read name
-2. The value -1
-3. The read sequence
+     #. Read name
+     #. The value -1
+     #. The read sequence
+     #. Quality values
+
+When parsing the file, be aware that additional columns may be added in the future. Note also that some fields can be empty, resulting in consecutive tabs within a line.
+
+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.
+
+--------------------
+
+**More Information**
+
+--------------------
 
-When parsing that file, be aware that additional columns may be added in the future. Note also that some fields can be empty, resulting in consecutive tabs within a line. Also, in the current version, when the *Match times* option is set to a value other than 1 (the default value), multiple lines are written to the info file for each read.
+See the excellent `Cutadapt documentation`_
+
+.. _Cutadapt: https://cutadapt.readthedocs.io/en/stable/
+.. _`Cutadapt documentation`: https://cutadapt.readthedocs.io/en/latest/index.html
+.. _`Illumina TruSeq Adapters De-Mystified`: http://tucf-genomics.tufts.edu/documents/protocols/TUCF_Understanding_Illumina_TruSeq_Adapters.pdf
+
 
-.. _cutadapt: http://code.google.com/p/cutadapt/
-    </help>
+--------------------
+
+**Galaxy Wrapper Development**
+
+--------------------
+
+Author: Lance Parsons <lparsons@princeton.edu>
+
+    ]]></help>
 
     <citations>
         <citation type="bibtex">