comparison trim_galore.xml @ 6:11962ce40855 draft

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