comparison cutadapt/cutadapt.xml @ 1:b4479aea41df draft

Uploaded
author jackcurragh
date Wed, 13 Apr 2022 09:38:42 +0000
parents
children 2767f70dfbd3
comparison
equal deleted inserted replaced
0:60b449221e6a 1:b4479aea41df
1 <tool id="cutadapt" name="Cutadapt" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01">
2 <description>Remove adapter sequences from FASTQ/FASTA</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro='edam_ontology' />
7 <expand macro='xrefs'/>
8 <expand macro='requirements' />
9 <version_command>cutadapt --version</version_command>
10
11 <command detect_errors="exit_code"><![CDATA[
12 ## Link in the input and output files, so Cutadapt can tell their type
13
14 #import re
15 #set read1 = "input_f"
16 #set read2 = "input_r"
17 #set paired = False
18 #set library_type = str($library.type)
19 #if $library_type == 'paired':
20 #set paired = True
21 #set read1 = re.sub('[^\w\-\s]', '_', str($library.input_1.element_identifier))
22 #set read2 = re.sub('[^\w\-\s]', '_', str($library.input_2.element_identifier))
23 #set input_1 = $library.input_1
24 #set input_2 = $library.input_2
25 #else if $library_type == 'paired_collection'
26 #set paired = True
27 #set input_1 = $library.input_1.forward
28 #set input_2 = $library.input_1.reverse
29 #set read1 = re.sub('[^\w\-\s]', '_', str($library.input_1.name)) + "_1"
30 #set read2 = re.sub('[^\w\-\s]', '_', str($library.input_1.name)) + "_2"
31 #else
32 #set input_1 = $library.input_1
33 #set read1 = re.sub('[^\w\-\s]', '_', str($library.input_1.element_identifier))
34 #end if
35
36 #if $input_1.is_of_type("fastq.gz", "fastqsanger.gz"):
37 #set ext = ".fq.gz"
38 #else if $input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"):
39 #set ext = ".fq.bz2"
40 #else if $input_1.is_of_type('fasta'):
41 #set ext = ".fa"
42 #else:
43 #set ext = ".fq"
44 #end if
45 #set read1 = $read1 + $ext
46 #set out1 = "out1" + $ext
47 #set rest_output = "rest_output" + $ext
48 #set wild_output = "wild_output" + $ext
49 #set too_short_output = "too_short_output" + $ext
50 #set too_long_output = "too_long_output" + $ext
51 #set untrimmed_output = "untrimmed_output" + $ext
52 ln -f -s '${input_1}' '$read1' &&
53
54 #if $paired:
55 #if $input_2.is_of_type("fastq.gz", "fastqsanger.gz"):
56 #set ext2 = ".fq.gz"
57 #else if $input_2.is_of_type("fastq.bz2", "fastqsanger.bz2"):
58 #set ext2 = ".fq.gz"
59 #else if $input_2.is_of_type('fasta'):
60 #set ext2 = ".fa"
61 #else:
62 #set ext2 = ".fq"
63 #end if
64 #set read2 = $read2 + $ext2
65 #set out2 = "out2" + $ext2
66 #set too_short_paired_output = "too_short_paired_output" + $ext2
67 #set too_long_paired_output = "too_long_paired_output" + $ext2
68 #set untrimmed_paired_output = "untrimmed_paired_output" + $ext2
69 ln -f -s '${input_2}' '$read2' &&
70 #end if
71
72 ## Run Cutadapt
73
74 #if 'multiple_output' in $output_selector:
75 mkdir split &&
76 #end if
77
78 cutadapt
79
80 -j=\${GALAXY_SLOTS:-4}
81
82 #if 'json_stats' in $output_selector:
83 --json stats.json
84 #end if
85
86 #if str( $library.type ) == "single":
87 @read1_options@
88 #if 'multiple_output' in $output_selector:
89 --output='split/{name}.${input_1.ext}'
90 #else:
91 --output='$out1'
92 #end if
93 #else:
94 @read1_options@
95 @read2_options@
96 --output='$out1'
97 --paired-output='$out2'
98 #end if
99
100 --error-rate=$adapter_options.error_rate
101 --times=$adapter_options.times
102 --overlap=$adapter_options.overlap
103 $adapter_options.no_indels
104 $adapter_options.match_read_wildcards
105 --action=$adapter_options.action
106 $adapter_options.revcomp
107
108 $filter_options.discard_trimmed
109 $filter_options.discard_untrimmed
110
111 #if str($filter_options.minimum_length) and str($filter_options.length_R2_options.length_R2_status) == 'True':
112 --minimum-length=$filter_options.minimum_length:$filter_options.length_R2_options.R2_minimum
113 #else if str($filter_options.minimum_length):
114 --minimum-length=$filter_options.minimum_length
115 #end if
116 #if str($filter_options.maximum_length) and str($filter_options.length_R2_options.length_R2_status) == 'True':
117 --maximum-length=$filter_options.maximum_length:$filter_options.length_R2_options.R2_maximum
118 #else if str($filter_options.maximum_length):
119 --maximum-length=$filter_options.maximum_length
120 #end if
121 #if str($filter_options.max_n):
122 --max-n=$filter_options.max_n
123 #end if
124 #if str( $library.type ) != "single":
125 #if $filter_options.pair_filter:
126 --pair-filter=$filter_options.pair_filter
127 #end if
128 #end if
129 #if str($filter_options.max_expected_errors):
130 --max-expected-errors=$filter_options.max_expected_errors
131 #end if
132 $filter_options.discard_cassava
133
134 #if str($read_mod_options.quality_cutoff) != '0':
135 --quality-cutoff=$read_mod_options.quality_cutoff
136 #end if
137 #if str($read_mod_options.nextseq_trim) != '0':
138 --nextseq-trim=$read_mod_options.nextseq_trim
139 #end if
140 $read_mod_options.trim_n
141 #if $read_mod_options.strip_suffix != ''
142 --strip-suffix $read_mod_options.strip_suffix
143 #end if
144 #if str($read_mod_options.shorten_options.shorten_values) == 'True':
145 #if str($read_mod_options.shorten_options.shorten_end) == '3prime'
146 --length=$read_mod_options.shorten_options.length
147 #else
148 --length=-$read_mod_options.shorten_options.length
149 #end if
150 #end if
151 #if str($read_mod_options.length_tag) != '':
152 --length-tag='$read_mod_options.length_tag'
153 #end if
154 #if str($read_mod_options.rename) != '':
155 --rename='$read_mod_options.rename'
156 #end if
157 $read_mod_options.zero_cap
158
159
160 '${read1}'
161 #if $paired:
162 '${read2}'
163 #if $library.r2.quality_cutoff2:
164 -Q=$library.r2.quality_cutoff2
165 #end if
166 #end if
167
168 #if 'report' in $output_selector:
169 > report.txt
170 #end if
171 ]]></command>
172 <inputs>
173
174 <!-- Reads -->
175 <conditional name="library">
176 <param name="type" type="select" label="Single-end or Paired-end reads?">
177 <option value="single">Single-end</option>
178 <option value="paired">Paired-end</option>
179 <option value="paired_collection">Paired-end Collection</option>
180 </param>
181
182 <when value="single">
183 <param name="input_1" format="@FASTQ_TYPES@" type="data" label="FASTQ/A file" help="Should be of datatype &quot;fastq.gz&quot; or &quot;fasta&quot;" />
184 <expand macro="single_end_options" />
185 </when>
186
187 <when value="paired">
188 <param name="input_1" format="@FASTQ_TYPES@" type="data" label="FASTQ/A file #1" help="Should be of datatype &quot;fastq.gz&quot;or &quot;fasta&quot;" />
189 <param name="input_2" format="@FASTQ_TYPES@" type="data" label="FASTQ/A file #2" help="Should be of datatype &quot;fastq.gz&quot;or &quot;fasta&quot;" />
190 <expand macro="paired_end_options" />
191 </when>
192
193 <when value="paired_collection">
194 <param name="input_1" format="@FASTQ_TYPES@" type="data_collection" collection_type="paired" label="Paired Collection" help="Should be of datatype &quot;fastq.gz&quot; or &quot;fasta&quot;" />
195 <expand macro="paired_end_options" />
196 </when>
197
198 </conditional>
199
200 <!-- Adapter Options -->
201 <section name="adapter_options" title="Adapter Options">
202 <param name="action" type="select" label="What to do if a match is found">
203 <option value="trim" selected="True">Trim: trim adapter and upstream or downstream sequence</option>
204 <option value="retain">Retain: the read is trimmed, but the adapter sequence is not removed</option>
205 <option value="mask">Mask: mask adapters with 'N' characters instead of trimming them</option>
206 <option value="lowercase">Lowercase: convert to lowercase</option>
207 <option value="none">None: leave unchanged</option>
208 </param>
209 <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.">
210 <option value="X">Enabled</option>
211 <option value="" selected="True">Disabled</option>
212 </param>
213 <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)." />
214 <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)." />
215 <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." />
216 <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." />
217 <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">
218 <option value=" " selected="True">In the adapters but not in the reads</option>
219 <option value="--match-read-wildcards">In the adapters and in the reads</option>
220 <option value="--no-match-adapter-wildcards">Nowhere</option>
221 </param>
222 <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." />
223 </section>
224
225 <!-- Filter Options -->
226 <section name="filter_options" title="Filter Options">
227 <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!" />
228 <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." />
229 <param argument="--minimum-length" type="integer" min="0" optional="True" value="25" 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." />
230 <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." />
231 <conditional name="length_R2_options">
232 <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.">
233 <option value="True">Enabled</option>
234 <option value="False" selected="True">Disabled</option>
235 </param>
236 <when value="True">
237 <param name="R2_minimum" type="integer" min="0" value="" optional="True" label="Minimum length (R2)" />
238 <param name="R2_maximum" type="integer" min="0" value="" optional="True" label="Maximum length (R2)" />
239 </when>
240 <when value="False">
241 </when>
242 </conditional>
243 <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." />
244 <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">
245 <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>
246 <option value="both">Both: filtering criteria must apply to both reads in order for a read pair to be discarded. </option>
247 <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>
248
249 </param>
250 <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." />
251 <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:)." />
252 </section>
253
254 <!-- Read Modification Options -->
255 <section name="read_mod_options" title="Read Modification Options">
256 <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 for paired-end data, unless a separate value for the second read is specified. 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.">
257 <sanitizer>
258 <valid initial="string.digits"><add value="," /></valid>
259 </sanitizer>
260 <validator type="regex">[0-9,]+</validator>
261 </param>
262 <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." />
263 <param argument="--trim-n" type="boolean" truevalue="--trim-n" falsevalue="" checked="False" label="Trim Ns" help="Trim N's on ends of reads." />
264 <param argument="--strip-suffix" label="Strip suffix" type="text" help="Remove this suffix from read names if present." />
265 <conditional name="shorten_options">
266 <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.">
267 <option value="True">Enabled</option>
268 <option value="False" selected="True">Disabled</option>
269 </param>
270 <when value="True">
271 <param argument="--length" type="integer" value="0" label="Length" help="Shorten reads to this length. This modification is applied after adapter trimming." />
272 <param name="shorten_end" type="select" label="End at which to apply the slice">
273 <option value="3prime">3' ends</option>
274 <option value="5prime">5' ends</option>
275 </param>
276 </when>
277 <when value="False">
278 </when>
279 </conditional>
280 <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'." >
281 <sanitizer invalid_char="">
282 <valid initial="string.letters,string.digits">
283 <add value="/" />
284 <add value="+" />
285 <add value="-" />
286 <add value="=" />
287 <add value=" " />
288 <add value="_" />
289 </valid>
290 </sanitizer>
291 <validator type="regex">[A-Za-z0-9 =-_/+]+</validator>
292 </param>
293 <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. ">
294 <sanitizer invalid_char="">
295 <valid initial="string.letters,string.digits">
296 <add value="{" />
297 <add value="}" />
298 <add value="_" />
299 <add value="=" />
300 <add value=" " />
301 </valid>
302 </sanitizer>
303 <validator type="regex">[A-Za-z0-9 {}=_]+</validator>
304 </param>
305 <param argument="--zero-cap" type="boolean" truevalue="--zero-cap" falsevalue="" checked="False" label="Change negative quality values to zero" />
306 </section>
307
308 <!-- Output Options -->
309 <param name="output_selector" type="select" multiple="True" display="checkboxes" label="Outputs selector">
310 <option value="report">Report: Cutadapt's per-adapter statistics. You can use this file with MultiQC.</option>
311 <option value="info_file">Info file: write information about each read and its adapter matches.</option>
312 <option value="rest_file">Rest of read: when the adapter matches in the middle of a read, write the rest (after the adapter).</option>
313 <option value="wildcard_file">Wildcard file: when the adapter has wildcard bases (Ns) write adapter bases matching wildcard positions.</option>
314 <option value="too_short_file">Too short reads: write reads that are too short according to minimum length specified (default: discard reads).</option>
315 <option value="too_long_file">Too long reads: write reads that are too long (according to maximum length specified)</option>
316 <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>
317 <option value="multiple_output">Multiple output: create a separate file for each adapter trimmed (default: all trimmed reads are in a single file)</option>
318 <option value="json_stats">Statistics in JSON format</option>
319 </param>
320 </inputs>
321
322 <outputs>
323 <data name="out1" format="fastqsanger" metadata_source="input_1" from_work_dir="out1*" label="${tool.name} on ${on_string}: Read 1 Output">
324 <filter>library['type'] != 'paired_collection' and 'multiple_output' not in output_selector</filter>
325 <expand macro="inherit_format_1" />
326 </data>
327
328 <data name="out2" format="fastqsanger" metadata_source="input_2" from_work_dir="out2*" label="${tool.name} on ${on_string}: Read 2 Output" >
329 <filter>library['type'] == 'paired' and 'multiple_output' not in output_selector</filter>
330 <expand macro="inherit_format_2" />
331 </data>
332
333 <collection name="out_pairs" type="paired" format_source="input_1" label="${tool.name} on ${on_string}: Reads">
334 <filter>library['type'] == 'paired_collection' and 'multiple_output' not in output_selector</filter>
335 <data name="forward" from_work_dir="out1.fq*" />
336 <data name="reverse" from_work_dir="out2.fq*" />
337 </collection>
338
339 <data name="report" format="txt" from_work_dir="report.txt" label="${tool.name} on ${on_string}: Report">
340 <filter>output_selector and 'report' in output_selector</filter>
341 </data>
342 <data name="info_file" format="txt" metadata_source="input_1" label="${tool.name} on ${on_string}: Info File" >
343 <filter>output_selector and 'info_file' in output_selector</filter>
344 </data>
345
346 <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)" >
347 <filter>output_selector and 'rest_file' in output_selector</filter>
348 <expand macro="inherit_format_1" />
349 </data>
350
351 <data name="wild_output" format="txt" metadata_source="input_1" from_work_dir="wild_output*" label="${tool.name} on ${on_string}: Wildcard File" >
352 <filter>output_selector and 'wildcard_file' in output_selector</filter>
353 </data>
354
355 <data name="untrimmed_output" format="fastqsanger" metadata_source="input_1" from_work_dir="untrimmed_output*" label="${tool.name} on ${on_string}: Untrimmed Read 1" >
356 <filter>output_selector and 'untrimmed_file' in output_selector</filter>
357 <expand macro="inherit_format_1" />
358 </data>
359 <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" >
360 <filter>library['type'] == 'paired' or library['type'] == 'paired_collection'</filter>
361 <filter>output_selector and 'untrimmed_file' in output_selector </filter>
362 <expand macro="inherit_format_2" />
363 </data>
364
365 <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" >
366 <filter>output_selector and 'too_short_file' in output_selector</filter>
367 <expand macro="inherit_format_1" />
368 </data>
369 <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" >
370 <filter>library['type'] == 'paired' or library['type'] == 'paired_collection'</filter>
371 <filter>output_selector and 'too_short_file' in output_selector</filter>
372 <expand macro="inherit_format_2" />
373 </data>
374 <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" >
375 <filter>output_selector and 'too_long_file' in output_selector</filter>
376 <expand macro="inherit_format_1" />
377 </data>
378 <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" >
379 <filter>library['type'] == 'paired' or library['type'] == 'paired_collection'</filter>
380 <filter>output_selector and 'too_long_file' in output_selector</filter>
381 <expand macro="inherit_format_2" />
382 </data>
383 <data name="json_stats" format="json" from_work_dir="stats.json" label="${tool.name} on ${on_string}: Statistics (JSON)" >
384 <filter>output_selector and 'json_stats' in output_selector</filter>
385 </data>
386 <collection name="split_output" type="list" label="${tool.name} on ${on_string}: Split outputs" format="fastqsanger" >
387 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.(?P&lt;ext&gt;fastq.*)" directory="split" />
388 <filter>output_selector and 'multiple_output' in output_selector</filter>
389 </collection>
390 </outputs>
391
392 <tests>
393 <!-- Ensure fastq works -->
394 <test expect_num_outputs="1">
395 <param name="type" value="single" />
396 <param name="input_1" ftype="fastq" value="cutadapt_small.fastq" />
397 <section name="r1">
398 <repeat name="adapters">
399 <conditional name="adapter_source">
400 <param name="adapter_source_list" value="user"/>
401 <param name="adapter" value="AGATCGGAAGAGC"/>
402 </conditional>
403 </repeat>
404 </section>
405 <output name="out1" file="cutadapt_small.out" ftype="fastq"/>
406 </test>
407 <!-- Ensure single end fastq.gz works -->
408 <test expect_num_outputs="1">
409 <param name="type" value="single" />
410 <param name="input_1" ftype="fastq.gz" value="bwa-mem-fastq1.fq.gz" />
411 <section name="r1">
412 <repeat name="adapters">
413 <conditional name="adapter_source">
414 <param name="adapter_source_list" value="user"/>
415 <param name="adapter" value="AGATCGGAAGAGC"/>
416 </conditional>
417 </repeat>
418 </section>
419 <output name="out1" decompress="True" file="cutadapt_out1.fq.gz" ftype="fastq.gz"/>
420 </test>
421 </tests>
422
423 <help><![CDATA[
424
425 .. class:: infomark
426
427 **What it does**
428
429 -------------------
430
431 **Cutadapt** finds and removes adapter sequences, primers, poly-A tails and other types of unwanted sequence from your high-throughput sequencing reads.
432
433 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.
434
435 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.
436
437 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.
438
439 -------------------
440
441 **Inputs**
442
443 -------------------
444
445 Input files for Cutadapt need to be:
446
447 - FASTQ.GZ, FASTQ.BZ2, FASTQ or FASTA
448
449 To trim an adapter, input the ADAPTER sequence in plain text or in a FASTA file e.g. AACCGGTT (with the characters: **$**, **^**, **...**, if anchored or linked).
450
451 ============================================= ===================
452 **Option** **Sequence**
453 --------------------------------------------- -------------------
454 3’ (End) Adapter ADAPTER
455 Anchored 3’ Adapter ADAPTER$
456
457 5’ (Front) Adapter ADAPTER
458 Anchored 5’ Adapter ^ADAPTER
459
460 5’ or 3’ (Both possible) ADAPTER
461
462 Linked Adapter - 3' (End) only ADAPTER1...ADAPTER2
463 Non-anchored Linked Adapter - 5' (Front) only ADAPTER1...ADAPTER2
464 ============================================= ===================
465
466 Below is an illustration of the allowed adapter locations relative to the read and depending on the adapter type:
467
468 .. image:: $PATH_TO_IMAGES/adapters.svg
469
470
471 -------------------
472
473 *Example: Illumina TruSeq Adapters*
474
475 -------------------
476
477 If you have reads containing Illumina TruSeq adapters, for example, follow these steps.
478
479
480 For Single-end reads as well as the first reads of Paired-end data:
481
482 **Read 1**
483
484 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:
485
486 AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC
487
488
489 For the second reads of Paired-end data:
490
491 **Read 2**
492
493 In the **3' (End) Adapters** option above, insert the reverse complement of the “TruSeq Universal Adapter”:
494
495 AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT
496
497 The adapter sequences can be found in the document `Illumina TruSeq Adapters De-Mystified`_.
498
499 -----------
500
501 **Outputs**
502
503 -----------
504
505 - Trimmed reads
506
507 Optionally, under **Output Options** you can choose to output
508
509 * Report
510 * Info file
511
512
513 **Report**
514
515 Cutadapt can output per-adapter statistics if you select to output the report above.
516
517 Example:
518
519 ::
520
521 This is cutadapt 3.4 with Python 3.9.2
522
523 Command line parameters: -j=1 -a AGATCGGAAGAGC -A AGATCGGAAGAGC --output=out1.fq.gz --paired-output=out2.fq.gz --error-rate=0.1 --times=1
524 --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
525
526 Processing reads on 1 core in paired-end mode ...
527 Finished in 0.01 s (129 µs/read; 0.46 M reads/minute).
528
529 === Summary ===
530
531 Total read pairs processed: 99
532 Read 1 with adapter: 2 (2.0%)
533 Read 2 with adapter: 4 (4.0%)
534 Pairs that were too short: 3 (3.0%)
535 Pairs written (passing filters): 96 (97.0%)
536
537 Total basepairs processed: 48,291 bp
538 Read 1: 24,147 bp
539 Read 2: 24,144 bp
540 Total written (filtered): 48,171 bp (99.8%)
541 Read 1: 24,090 bp
542 Read 2: 24,081 bp
543
544
545 **Info file**
546
547 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.
548
549 Columns contain the following data:
550
551 * **1st**: Read name
552 * **2nd**: Number of errors
553 * **3rd**: 0-based start coordinate of the adapter match
554 * **4th**: 0-based end coordinate of the adapter match
555 * **5th**: Sequence of the read to the left of the adapter match (can be empty)
556 * **6th**: Sequence of the read that was matched to the adapter
557 * **7th**: Sequence of the read to the right of the adapter match (can be empty)
558 * **8th**: Name of the found adapter
559 * **9th**: Quality values corresponding to sequence left of the adapter match (can be empty)
560 * **10th**: Quality values corresponding to sequence matched to the adapter (can be empty)
561 * **11th**: Quality values corresponding to sequence to the right of the adapter (can be empty)
562
563 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.
564
565 If no adapter was found, the format is as follows:
566
567 #. Read name
568 #. The value -1
569 #. The read sequence
570 #. Quality values
571
572 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.
573
574 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.
575
576
577 --------------------
578
579 **Rename Reads**
580
581 --------------------
582
583
584 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}).
585
586 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.
587
588 The following placeholders are currently available for single-end reads:
589
590 * {header} – the full, unchanged header
591 * {id} – the read ID, that is, the part of the header before the first whitespace
592 * {comment} – the part of the header after the whitespace following the ID
593 * {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.
594 * {match_sequence} – the sequence of the read that matched the adapter (including errors). If there was no adapter match, this is set to an empty string. If you use a linked adapter, this is to the two matching strings, separated by a comma.
595 * {cut_prefix} – the prefix removed by the --cut (or -u) option (that is, when used with a positive length argument)
596 * {cut_suffix} – the suffix removed by the --cut (or -u) option (that is, when used with a negative length argument)
597 * {rc} – this is replaced with the string rc if the read was reverse complemented. This only applies when reverse complementing was requested
598
599 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.
600
601 For paired-end data, the placeholder {rn} is available (“read number”), and it is replaced with 1 in R1 and with 2 in R2.
602
603 In addition, it is possible to write a placeholder as {r1.placeholdername} or {r2.placeholdername}, which always takes the replacement value from R1 or R2, respectively.
604 The {r1.placeholder} and {r2.placeholder} notation is available for all placeholders except {rn} and {id} because the read ID needs to be identical for both reads.
605
606 --------------------
607
608 **More Information**
609
610 --------------------
611
612 See the excellent `Cutadapt documentation`_
613
614 .. _Cutadapt: https://cutadapt.readthedocs.io/en/stable/
615 .. _`Cutadapt documentation`: https://cutadapt.readthedocs.io/en/latest/index.html
616 .. _`Illumina TruSeq Adapters De-Mystified`: http://tucf-genomics.tufts.edu/documents/protocols/TUCF_Understanding_Illumina_TruSeq_Adapters.pdf
617
618
619 --------------------
620
621 **Galaxy Wrapper Development**
622
623 --------------------
624
625 Author: Lance Parsons <lparsons@princeton.edu>
626
627 ]]></help>
628 <expand macro="citations" />
629 </tool>