4
|
1 <tool id="trim_galore" name="Trim Galore" version="0.3.7.0">
|
|
2 <!-- Wrapper compatible with Trim Galore version 0.3.7 -->
|
0
|
3 <description>adaptive quality and adapter trimmer</description>
|
|
4 <version_command interpreter="perl">trim_galore --version</version_command>
|
|
5 <requirements>
|
4
|
6 <requirement type="package" version="1.8">cutadapt</requirement>
|
0
|
7 </requirements>
|
4
|
8 <macros>
|
|
9 <macro name="paired_adapter_trimming">
|
|
10 <param name="trim1" type="boolean" truevalue="--trim1" falsevalue="" checked="False" label="Trims 1 bp off every read from its 3' end." help="" />
|
|
11 <param name="adapter" type="text" value="AGATCGGAAGAGC" label="Adapter sequence to be trimmed off read 1">
|
|
12 <validator type="regex" message="Adapter sequence must contain DNA characters only (A,C,T,G or N)">^[ACTGNactgn]*$</validator>
|
|
13 </param>
|
|
14 <param name="adapter2" type="text" optional="True" value="" label="Adapter sequence to be trimmed off read 2">
|
|
15 <validator type="regex" message="Adapter sequence must contain DNA characters only (A,C,T,G or N)">^[ACTGNactgn]*$</validator>
|
|
16 </param>
|
1
|
17
|
4
|
18 <param name="three_prime_clip_R1" type="integer" value="" optional="True" label="Remove N bp from the 3' end of read 1">
|
|
19 <help>Instructs Trim Galore to remove N bp from the 3' end of read 1 after adapter/quality trimming has been performed.
|
|
20 This may remove some unwanted bias from the 3' end that is not directly related to adapter sequence or basecall quality.
|
|
21 (--three_prime_clip_R1)</help>
|
|
22 </param>
|
|
23 <param name="three_prime_clip_R2" type="integer" value="" optional="True" label="Remove N bp from the 3' end of read 1">
|
|
24 <help>Instructs Trim Galore to remove N bp from the 3' end of read 2 after
|
|
25 adapter/quality trimming has been performed. This may remove some unwanted bias from
|
|
26 the 3' end that is not directly related to adapter sequence or basecall quality. (--three_prime_clip_R2)</help>
|
|
27 </param>
|
|
28 </macro>
|
|
29 </macros>
|
|
30 <command>
|
|
31 <![CDATA[
|
1
|
32
|
4
|
33 ## trim_galore removes .fastq and .fq file extensions of input files.
|
|
34 ## This is essential if Galaxy provides links to files (with real extensions)
|
|
35 ## but that behaviour is causing an inconsitency in output filenaming.
|
|
36 ## We work around this by linking every file to cwd without file extension
|
1
|
37
|
|
38 #if $singlePaired.sPaired == "single":
|
4
|
39 ln -s "${singlePaired.input_singles}" ./input_singles;
|
|
40 #elif $singlePaired.sPaired == "paired":
|
|
41 ln -s "${singlePaired.input_mate1}" ./input_mate1;
|
|
42 ln -s "${singlePaired.input_mate2}" ./input_mate2;
|
1
|
43 #else:
|
4
|
44 ln -s "${singlePaired.input_mate_pairs.forward}" ./input_mate1;
|
|
45 ln -s "${singlePaired.input_mate_pairs.reverse}" ./input_mate2;
|
1
|
46 #end if
|
|
47
|
4
|
48 perl $__tool_directory__/trim_galore
|
0
|
49
|
4
|
50 ## we only support fastqsanger
|
|
51 --phred33
|
0
|
52
|
|
53 #if $params.settingsType == "custom":
|
|
54
|
|
55 ## default 20
|
|
56 --quality $params.quality
|
4
|
57
|
0
|
58 ## default 1
|
|
59 --stringency $params.stringency
|
4
|
60
|
0
|
61 ## default 0.1
|
|
62 -e $params.error_rate
|
|
63
|
|
64 ## default 20
|
|
65 --length $params.min_length
|
|
66
|
1
|
67 #if int($params.clip_R1) > 0:
|
|
68 --clip_R1 $params.clip_R1
|
|
69 #end if
|
4
|
70
|
1
|
71 #if int($params.clip_R2) > 0:
|
|
72 --clip_R2 $params.clip_R2
|
|
73 #end if
|
|
74
|
0
|
75 #if $params.retain_unpaired.settingsType == "retain_unpaired_output":
|
|
76 --retain_unpaired
|
|
77 --length_1 $params.retain_unpaired.length_1
|
|
78 --length_2 $params.retain_unpaired.length_2
|
|
79 #end if
|
|
80
|
|
81 #end if
|
|
82
|
|
83 ## RBBS specific options.
|
|
84 #if $rrbs.settingsType == "custom":
|
|
85 $rrbs.rrbs
|
|
86 $rrbs.non_directional
|
4
|
87 #end if
|
0
|
88
|
4
|
89 --output_dir ./
|
|
90 --suppress_warn
|
|
91
|
|
92 #if $params.settingsType == "custom" and not $params.report:
|
|
93 --no_report_file
|
0
|
94 #end if
|
|
95
|
|
96
|
4
|
97 ## default 'AGATCGGAAGAGC'
|
|
98 #if $singlePaired.adapter.strip() != '':
|
|
99 --adapter $singlePaired.adapter
|
|
100 #end if
|
|
101
|
|
102 #if $singlePaired.three_prime_clip_R1:
|
|
103 --three_prime_clip_R1 $singlePaired.three_prime_clip_R1
|
|
104 #end if
|
0
|
105
|
|
106 #if $singlePaired.sPaired == "single":
|
|
107 ## input sequence
|
4
|
108 ./input_singles
|
0
|
109 #else:
|
4
|
110 --paired
|
0
|
111
|
|
112 $singlePaired.trim1
|
4
|
113
|
|
114 #if $singlePaired.adapter2 and $singlePaired.adapter2.strip() != '':
|
0
|
115 --adapter2 $singlePaired.adapter2
|
|
116 #end if
|
|
117
|
4
|
118 #if $singlePaired.three_prime_clip_R2:
|
|
119 --three_prime_clip_R2 $singlePaired.three_prime_clip_R2
|
0
|
120 #end if
|
|
121
|
|
122 ## input sequences
|
4
|
123 ./input_mate1
|
|
124 ./input_mate2
|
0
|
125
|
|
126 #end if
|
|
127
|
4
|
128 &&
|
0
|
129
|
4
|
130 ## Trim Galore! run is finished. Move the report files to the proper place
|
|
131 #if $params.settingsType == "custom" and $params.report:
|
|
132 cat ./*_trimming_report.txt > $report_file;
|
0
|
133 #end if
|
|
134
|
4
|
135 ]]>
|
0
|
136 </command>
|
|
137 <inputs>
|
|
138 <!-- Input Parameters -->
|
|
139 <conditional name="singlePaired">
|
4
|
140 <param name="sPaired" type="select" label="Is this library paired- or single-end?">
|
|
141 <option value="single">Single-end</option>
|
|
142 <option value="paired">Paired-end</option>
|
|
143 <option value="paired_collection">Paired Collection</option>
|
0
|
144 </param>
|
|
145 <when value="single">
|
4
|
146 <param name="input_singles" type="data" format="fastqsanger" label="Reads in FASTQ format" />
|
|
147 <param name="adapter" type="text" value="AGATCGGAAGAGC" label="Adapter sequence to be trimmed">
|
|
148 <validator type="regex" message="Adapter sequence must contain DNA characters only (A,C,T,G or N)">^[ACTGNactgn]*$</validator>
|
|
149 </param>
|
|
150 <param name="three_prime_clip_R1" type="integer" value="" optional="True" label="Remove N bp from the 3' end">
|
|
151 <help>Instructs Trim Galore to remove N bp from the 3' end of read 1 after adapter/quality trimming has been performed.
|
|
152 This may remove some unwanted bias from the 3' end that is not directly related to adapter sequence or basecall quality.
|
|
153 (--three_prime_clip_R1)</help>
|
|
154 </param>
|
0
|
155 </when>
|
|
156 <when value="paired">
|
4
|
157 <param name="input_mate1" type="data" format="fastqsanger" label="Reads in FASTQ format" />
|
|
158 <param name="input_mate2" type="data" format="fastqsanger" label="Reads in FASTQ format" />
|
|
159 <expand macro="paired_adapter_trimming" />
|
|
160 </when>
|
|
161 <when value="paired_collection">
|
|
162 <param name="input_mate_pairs" format="fastqsanger" type="data_collection" collection_type="paired"
|
|
163 label="Select a paired collection" help="See help section for an explanation of dataset collections"/>
|
|
164 <expand macro="paired_adapter_trimming" />
|
0
|
165 </when>
|
|
166 </conditional>
|
|
167
|
|
168 <conditional name="params">
|
|
169 <param name="settingsType" type="select" label="Trim galore! advanced settings" help="You can use the default settings or set custom values for any of Trim Galore's parameters.">
|
|
170 <option value="default">Use Defaults</option>
|
|
171 <option value="custom">Full parameter list</option>
|
|
172 </param>
|
|
173 <when value="default" />
|
|
174 <!-- Full/advanced params. -->
|
|
175 <when value="custom">
|
4
|
176 <param name="quality" type="integer" value="20" label="Trim low-quality ends from reads in addition to adapter removal"
|
|
177 help="For more information please see below." />
|
0
|
178 <param name="stringency" type="integer" value="1" label="Overlap with adapter sequence required to trim a sequence" />
|
|
179 <param name="error_rate" type="float" value="0.1" label="Maximum allowed error rate" />
|
|
180 <param name="min_length" type="integer" value="20" label="Discard reads that became shorter than length INT" />
|
|
181
|
4
|
182 <param name="clip_R1" type="integer" value="0" label="Instructs Trim Galore to remove INT bp from the 5' end of read 1" />
|
|
183 <param name="clip_R2" type="integer" value="0" label="Instructs Trim Galore to remove INT bp from the 5' end of read 2" />
|
1
|
184
|
0
|
185 <param name="report" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Generate a report file" help="" />
|
|
186
|
|
187 <conditional name="retain_unpaired">
|
|
188 <param name="settingsType" type="select" label="specify if you would like to retain unpaired reads">
|
|
189 <option value="no_output">Do not output unpaired reads</option>
|
|
190 <option value="retain_unpaired_output">Output unpaired reads</option>
|
|
191 </param>
|
|
192 <when value="no_output" />
|
|
193 <!-- Output params. -->
|
|
194 <when value="retain_unpaired_output">
|
|
195 <param name="length_1" type="integer" value="35" label="Unpaired single-end read length cutoff needed for read 1 to be written" />
|
|
196 <param name="length_2" type="integer" value="35" label="Unpaired single-end read length cutoff needed for read 2 to be written" />
|
|
197 </when> <!-- output -->
|
|
198 </conditional> <!-- retain_unpaired -->
|
|
199
|
|
200 </when> <!-- full -->
|
|
201 </conditional> <!-- params -->
|
|
202
|
|
203 <conditional name="rrbs">
|
|
204 <param name="settingsType" type="select" label="RRBS specific settings">
|
|
205 <option value="default">Use Defaults (no RRBS)</option>
|
|
206 <option value="custom">Full parameter list</option>
|
|
207 </param>
|
|
208 <when value="default" />
|
|
209 <!-- Full/advanced params. -->
|
|
210 <when value="custom">
|
4
|
211 <param name="rrbs" type="boolean" truevalue="--rrbs" falsevalue="" checked="True"
|
|
212 label="Specifies that the input file was an MspI digested RRBS sample" />
|
|
213 <param name="non_directional" type="boolean" truevalue="--non_directional" falsevalue="" checked="False"
|
|
214 label="Selecting this option for non-directional RRBS libraries" />
|
0
|
215 </when> <!-- full -->
|
4
|
216 </conditional> <!-- params -->
|
0
|
217
|
|
218 </inputs>
|
|
219 <outputs>
|
|
220
|
4
|
221 <data format="fastqsanger" name="trimmed_reads_single" from_work_dir="input_singles_trimmed.fq" label="${tool.name} on ${on_string}: trimmed reads">
|
0
|
222 <filter>singlePaired['sPaired'] == "single"</filter>
|
|
223 </data>
|
|
224
|
4
|
225 <collection name="trimmed_reads_paired_collection" type="paired" label="${tool.name} on ${on_string}: trimmed reads">
|
|
226 <filter>singlePaired['sPaired'] == "paired_collection"</filter>
|
|
227 <data name="forward" format="fastqsanger" from_work_dir="input_mate1_val_1.fq" />
|
|
228 <data name="reverse" format="fastqsanger" from_work_dir="input_mate2_val_2.fq" />
|
|
229 </collection>
|
|
230
|
|
231 <collection name="trimmed_reads_unpaired_collection" type="paired" label="${tool.name} on ${on_string}: unpaired reads">
|
|
232 <filter>
|
0
|
233 ((
|
4
|
234 params['settingsType'] == "custom" and
|
|
235 params['retain_unpaired']['settingsType'] == "retain_unpaired_output" and
|
|
236 singlePaired['sPaired'] == "paired_collection"
|
0
|
237 ))
|
4
|
238 </filter>
|
|
239 <data name="forward" format="fastqsanger" from_work_dir="input_mate1_unpaired_1.fq" />
|
|
240 <data name="reverse" format="fastqsanger" from_work_dir="input_mate2_unpaired_2.fq" />
|
|
241 </collection>
|
|
242
|
|
243
|
|
244 <data format="fastqsanger" name="trimmed_reads_pair1" from_work_dir="input_mate1_val_1.fq"
|
|
245 label="${tool.name} on ${on_string}: trimmed reads pair 1">
|
|
246 <filter>singlePaired['sPaired'] == "paired"</filter>
|
0
|
247 </data>
|
|
248
|
4
|
249 <data format="fastqsanger" name="trimmed_reads_pair2" from_work_dir="input_mate2_val_2.fq"
|
|
250 label="${tool.name} on ${on_string}: trimmed reads pair 2">
|
|
251 <filter>singlePaired['sPaired'] == "paired"</filter>
|
|
252 </data>
|
|
253
|
|
254 <data format="fastqsanger" name="unpaired_reads_1" from_work_dir="input_mate1_val_1.fq"
|
|
255 label="${tool.name} on ${on_string}: unpaired reads (1)">
|
|
256 <filter>
|
0
|
257 ((
|
4
|
258 params['settingsType'] == "custom" and
|
|
259 params['retain_unpaired']['settingsType'] == "retain_unpaired_output" and
|
|
260 singlePaired['sPaired'] == "paired"
|
0
|
261 ))
|
4
|
262 </filter>
|
|
263 </data>
|
|
264
|
|
265 <data format="fastqsanger" name="unpaired_reads_2" from_work_dir="input_mate2_val_2.fq"
|
|
266 label="${tool.name} on ${on_string}: unpaired reads (2)">
|
|
267 <filter>
|
|
268 ((
|
|
269 params['settingsType'] == "custom" and
|
|
270 params['retain_unpaired']['settingsType'] == "retain_unpaired_output" and
|
|
271 singlePaired['sPaired'] == "paired"
|
|
272 ))
|
|
273 </filter>
|
0
|
274 </data>
|
|
275
|
|
276 <data format="txt" name="report_file" label="${tool.name} on ${on_string}: report file">
|
4
|
277 <filter>
|
0
|
278 ((
|
|
279 params['settingsType'] == "custom" and
|
|
280 params['report'] == True
|
|
281 ))
|
4
|
282 </filter>
|
0
|
283 </data>
|
|
284
|
|
285 </outputs>
|
|
286 <tests>
|
4
|
287 <test>
|
|
288 <!-- Trim entire sequences; keep empty reads -->
|
|
289 <param name="input_singles" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
|
|
290 <param name="sPaired" value="single" />
|
|
291 <param name="settingsType" value="custom" />
|
|
292 <param name="report" value="true" />
|
|
293 <output name="trimmed_reads_single" file="sanger_full_range_results1.fastqsanger" ftype="fastqsanger"/>
|
|
294 <output name="report_file" file="sanger_full_range_report_results1.txt" ftype="txt" lines_diff="2" />
|
|
295 </test>
|
|
296
|
|
297 <test>
|
|
298 <!-- Trim entire sequences; keep empty reads -->
|
|
299 <param name="input_mate1" value="bwa-mem-fastq1.fq" ftype="fastqsanger" />
|
|
300 <param name="input_mate2" value="bwa-mem-fastq2.fq" ftype="fastqsanger" />
|
|
301 <param name="sPaired" value="paired" />
|
|
302 <param name="settingsType" value="custom" />
|
|
303 <param name="report" value="true" />
|
|
304 <output name="trimmed_reads_pair1" file="paired_example_pair1_results2.fastqsanger" ftype="fastqsanger"/>
|
|
305 <output name="trimmed_reads_pair2" file="paired_example_pair2_results2.fastqsanger" ftype="fastqsanger"/>
|
|
306 <output name="report_file" file="paired_example_results2.txt" ftype="txt" lines_diff="8" />
|
|
307 </test>
|
0
|
308
|
4
|
309 <test>
|
|
310 <!-- Trim entire sequences; keep empty reads -->
|
|
311 <param name="input_mate_pairs">
|
|
312 <collection type="paired">
|
|
313 <element name="forward" value="bwa-mem-fastq1.fq" />
|
|
314 <element name="reverse" value="bwa-mem-fastq2.fq" />
|
|
315 </collection>
|
|
316 </param>
|
|
317 <param name="sPaired" value="paired_collection" />
|
|
318 <param name="settingsType" value="custom" />
|
|
319 <param name="report" value="true" />
|
|
320 <param name="retain_unpaired" value="retain_unpaired_output" />
|
|
321
|
|
322 <output name="report_file" file="paired_collection_example_results3.txt" ftype="txt" lines_diff="8" />
|
|
323
|
|
324 <output_collection name="trimmed_reads_paired_collection" type="paired">
|
|
325 <element name="forward" file="paired_collection_example_pair1_results3.fastqsanger" ftype="fastqsanger"/>
|
|
326 <element name="reverse" file="paired_collection_example_pair2_results3.fastqsanger" ftype="fastqsanger"/>
|
|
327 </output_collection>
|
|
328
|
|
329 <output_collection name="trimmed_reads_unpaired_collection" type="paired">
|
|
330 <element name="forward" file="paired_collection_example_unpair1_results3.fastqsanger" ftype="fastqsanger"/>
|
|
331 <element name="reverse" file="paired_collection_example_unpair2_results3.fastqsanger" ftype="fastqsanger"/>
|
|
332 </output_collection>
|
|
333 </test>
|
|
334 </tests>
|
0
|
335 <help>
|
4
|
336 <![CDATA[
|
0
|
337
|
|
338 **What it does**
|
|
339
|
4
|
340 TrimGalore_ is a wrapper script that makes use of the publically available
|
2
|
341 adapter trimming tool Cutadapt.
|
0
|
342
|
4
|
343 .. _TrimGalore: http://www.bioinformatics.babraham.ac.uk/projects/trim_galore/
|
|
344
|
0
|
345
|
4
|
346 It is developed by Felix Krueger at the Babraham Institute.
|
0
|
347
|
|
348
|
4
|
349 ]]>
|
|
350 </help>
|
0
|
351 </tool>
|