1
|
1 <tool id="trim_galore" name="Trim Galore" version="0.2.8">
|
|
2 <!-- Wrapper compatible with Trim Galore version 0.2.8 -->
|
0
|
3 <description>adaptive quality and adapter trimmer</description>
|
|
4 <version_command interpreter="perl">trim_galore --version</version_command>
|
|
5 <requirements>
|
|
6 <requirement type="package" version="1.1">cutadapt</requirement>
|
|
7 <requirement type="package" version="0.10.1">fastqc</requirement>
|
|
8 </requirements>
|
|
9 <command interpreter="perl">
|
|
10 #from glob import glob
|
|
11 #import tempfile, os
|
1
|
12
|
|
13 ##
|
|
14 ## Creating a temporary directory where trim_galore will store all result files
|
|
15 ##
|
|
16
|
|
17 #set $temp_dir = os.path.abspath(tempfile.mkdtemp())
|
|
18
|
|
19
|
|
20 ## trim_galore removes .fastq and .fq file extensions of input files.
|
|
21 ## That is essential if Galaxy provides links to files (these can have real extensions), but that behaviour is causing an inconsitency in output filenaming.
|
|
22 ## Fix: link every file to $TMP without file extension
|
|
23
|
|
24 #if $singlePaired.sPaired == "single":
|
|
25 #set $input_singles_tmp_handle = tempfile.NamedTemporaryFile( dir=$temp_dir )
|
|
26 #set $input_singles_tmp = $input_singles_tmp_handle.name
|
|
27 #silent $input_singles_tmp_handle.close()
|
|
28 #silent os.system("ln -s %s %s" % (str($singlePaired.input_singles), $input_singles_tmp))
|
|
29 #else:
|
|
30 #set $input_mate1_tmp_handle = tempfile.NamedTemporaryFile( dir=$temp_dir )
|
|
31 #set $input_mate2_tmp_handle = tempfile.NamedTemporaryFile( dir=$temp_dir )
|
|
32
|
|
33 #set $input_mate1_tmp = $input_mate1_tmp_handle.name
|
|
34 #silent $input_mate1_tmp_handle.close()
|
|
35
|
|
36 #set $input_mate2_tmp = $input_mate2_tmp_handle.name
|
|
37 #silent $input_mate2_tmp_handle.close()
|
|
38
|
|
39 #silent os.system("ln -s %s %s" % (str($singlePaired.input_mate1), $input_mate1_tmp))
|
|
40 #silent os.system("ln -s %s %s" % (str($singlePaired.input_mate2), $input_mate2_tmp))
|
|
41 #end if
|
|
42
|
0
|
43 trim_galore
|
|
44
|
|
45 ##
|
|
46 ## Input parameters
|
|
47 ##
|
|
48
|
|
49
|
|
50 #if $params.settingsType == "custom":
|
|
51
|
|
52 $params.fastqc
|
|
53 ## default 20
|
|
54 --quality $params.quality
|
|
55 ## default 'AGATCGGAAGAGC'
|
|
56 #if $params.adapter.strip() != '':
|
|
57 --adapter $params.adapter
|
|
58 #end if
|
|
59 ## default 1
|
|
60 --stringency $params.stringency
|
|
61
|
|
62 ## default 0.1
|
|
63 -e $params.error_rate
|
|
64
|
|
65 ## default 20
|
|
66 --length $params.min_length
|
|
67
|
1
|
68 #if int($params.clip_R1) > 0:
|
|
69 --clip_R1 $params.clip_R1
|
|
70 #end if
|
|
71
|
|
72 #if int($params.clip_R2) > 0:
|
|
73 --clip_R2 $params.clip_R2
|
|
74 #end if
|
|
75
|
0
|
76 #if $params.retain_unpaired.settingsType == "retain_unpaired_output":
|
|
77 --retain_unpaired
|
|
78 --length_1 $params.retain_unpaired.length_1
|
|
79 --length_2 $params.retain_unpaired.length_2
|
|
80 #end if
|
|
81
|
|
82 #end if
|
|
83
|
|
84 ##
|
|
85 ## RBBS specific options.
|
|
86 ##
|
|
87
|
|
88 #if $rrbs.settingsType == "custom":
|
|
89
|
|
90 $rrbs.rrbs
|
|
91 $rrbs.non_directional
|
|
92
|
|
93 #end if
|
|
94
|
|
95 --output_dir $temp_dir
|
|
96 --suppress_warn
|
|
97
|
|
98
|
|
99 #if $singlePaired.sPaired == "single":
|
|
100
|
|
101 #if $singlePaired.input_singles.ext == "fastqillumina":
|
|
102 --phred64
|
|
103 #elif $singlePaired.input_singles.ext == "fastqsanger":
|
|
104 --phred33
|
|
105 #end if
|
|
106
|
|
107 #if $params.settingsType == "custom":
|
|
108 #if not $params.report:
|
|
109 --no_report_file
|
|
110 #end if
|
|
111 #end if
|
|
112
|
|
113 ## input sequence
|
1
|
114 $input_singles_tmp
|
0
|
115 #else:
|
|
116 --paired
|
|
117 #if $singlePaired.input_mate1.ext == "fastqillumina":
|
|
118 --phred64
|
|
119 #elif $singlePaired.input_mate1.ext == "fastqsanger":
|
|
120 --phred33
|
|
121 #end if
|
|
122
|
|
123 $singlePaired.trim1
|
|
124 #if $singlePaired.adapter2.strip() != '':
|
|
125 --adapter2 $singlePaired.adapter2
|
|
126 #end if
|
|
127
|
|
128 #if $params.settingsType == "custom":
|
|
129 #if not $params.report:
|
|
130 --no_report_file
|
|
131 #end if
|
|
132 #end if
|
|
133
|
|
134 ## input sequences
|
1
|
135 $input_mate1_tmp
|
|
136 $input_mate2_tmp
|
0
|
137
|
|
138 #end if
|
|
139
|
|
140 &&
|
|
141
|
|
142 ##
|
|
143 ## Trim Galore! run is finished. Move the result files to the proper place
|
|
144 ##
|
|
145
|
|
146
|
|
147 #if $singlePaired.sPaired == "single":
|
1
|
148 #set $single_end_path = os.path.join($temp_dir, os.path.basename(str($input_singles_tmp)) + '_trimmed.fq')
|
0
|
149 mv $single_end_path $trimmed_reads_single;
|
|
150
|
|
151 #if $params.settingsType == "custom":
|
|
152 #if $params.report:
|
1
|
153 #set $report_path = os.path.join($temp_dir, os.path.basename(str($input_singles_tmp)) + '_trimming_report.txt')
|
0
|
154 mv $report_path $report_file;
|
|
155 #end if
|
|
156 #end if
|
|
157
|
|
158 #else:
|
1
|
159 #set $paired_end_path_1 = os.path.join($temp_dir, os.path.basename(str($input_mate1_tmp)) + '_val_1.fq')
|
|
160 #set $paired_end_path_2 = os.path.join($temp_dir, os.path.basename(str($input_mate2_tmp)) + '_val_2.fq')
|
0
|
161 mv $paired_end_path_1 $trimmed_reads_pair1;
|
|
162 mv $paired_end_path_2 $trimmed_reads_pair2;
|
|
163
|
|
164 #if $params.settingsType == "custom":
|
|
165 #if $params.retain_unpaired.settingsType == "retain_unpaired_output":
|
1
|
166 #set $unpaired_path_1 = os.path.join($temp_dir, os.path.basename(str($input_mate1_tmp)) + '_unpaired_1.fq')
|
|
167 #set $unpaired_path_2 = os.path.join($temp_dir, os.path.basename(str($input_mate2_tmp)) + '_unpaired_2.fq')
|
0
|
168 mv $unpaired_path_1 $unpaired_reads_1;
|
|
169 mv $unpaired_path_2 $unpaired_reads_2;
|
|
170 #end if
|
|
171
|
|
172 #if $params.report:
|
1
|
173 #set $report_path = os.path.join($temp_dir, os.path.basename(str($input_mate1_tmp)) + '_trimming_report.txt')
|
0
|
174 mv $report_path $report_file;
|
|
175 #end if
|
|
176
|
|
177 #end if
|
|
178 #end if
|
|
179
|
|
180 ## delete the temp_dir
|
1
|
181 ##rm -rf $temp_dir
|
0
|
182
|
|
183 </command>
|
|
184 <inputs>
|
|
185
|
|
186 <!-- Input Parameters -->
|
|
187 <conditional name="singlePaired">
|
|
188 <param name="sPaired" type="select" label="Is this library mate-paired?">
|
|
189 <option value="single">Single-end</option>
|
|
190 <option value="paired">Paired-end</option>
|
|
191 </param>
|
|
192 <when value="single">
|
|
193 <param name="input_singles" type="data" format="fastqsanger,fastqillumina,fastq,fasta" label="FASTQ/FASTA file" help="FASTQ or FASTA files." />
|
|
194 </when>
|
|
195 <when value="paired">
|
|
196 <param name="input_mate1" type="data" format="fastqsanger,fastqillumina,fastq,fasta" label="FASTQ/FASTA file" help="FASTQ or FASTA files." />
|
|
197 <param name="input_mate2" type="data" format="fastqsanger,fastqillumina,fastq,fasta" label="FASTQ/FASTA file" help="FASTQ or FASTA files." />
|
|
198 <param name="trim1" type="boolean" truevalue="--trim1" falsevalue="" checked="False" label="Trims 1 bp off every read from its 3' end." help="" />
|
|
199 <param name="adapter2" type="text" value="" label="Optional adapter sequence to be trimmed off read 2">
|
|
200 <validator type="regex" message="Adapter sequence must contain DNA characters only (A,C,T,G or N)">^[ACTGNactgn]*$</validator>
|
|
201 </param>
|
|
202 </when>
|
|
203 </conditional>
|
|
204
|
|
205
|
|
206 <conditional name="params">
|
|
207 <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.">
|
|
208 <option value="default">Use Defaults</option>
|
|
209 <option value="custom">Full parameter list</option>
|
|
210 </param>
|
|
211 <when value="default" />
|
|
212 <!-- Full/advanced params. -->
|
|
213 <when value="custom">
|
|
214 <param name="fastqc" type="boolean" truevalue="--fastqc" falsevalue="" checked="False" label="Run FastQC in the default mode on the FastQ file once trimming is complete" help="" />
|
|
215 <param name="quality" type="integer" value="20" label="Trim low-quality ends from reads in addition to adapter removal." help="For more information please see below." />
|
|
216 <param name="adapter" type="text" value="AGATCGGAAGAGC" label="Adapter sequence to be trimmed">
|
|
217 <validator type="regex" message="Adapter sequence must contain DNA characters only (A,C,T,G or N)">^[ACTGNactgn]*$</validator>
|
|
218 </param>
|
|
219 <param name="stringency" type="integer" value="1" label="Overlap with adapter sequence required to trim a sequence" />
|
|
220 <param name="error_rate" type="float" value="0.1" label="Maximum allowed error rate" />
|
|
221 <param name="min_length" type="integer" value="20" label="Discard reads that became shorter than length INT" />
|
|
222
|
1
|
223 <param name="clip_R1" type="integer" value="0" label="nstructs Trim Galore to remove INT bp from the 5' end of read 1" />
|
|
224 <param name="clip_R2" type="integer" value="0" label="nstructs Trim Galore to remove INT bp from the 5' end of read 2" />
|
|
225
|
0
|
226 <param name="report" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Generate a report file" help="" />
|
|
227
|
|
228 <conditional name="retain_unpaired">
|
|
229 <param name="settingsType" type="select" label="specify if you would like to retain unpaired reads">
|
|
230 <option value="no_output">Do not output unpaired reads</option>
|
|
231 <option value="retain_unpaired_output">Output unpaired reads</option>
|
|
232 </param>
|
|
233 <when value="no_output" />
|
|
234 <!-- Output params. -->
|
|
235 <when value="retain_unpaired_output">
|
|
236 <param name="length_1" type="integer" value="35" label="Unpaired single-end read length cutoff needed for read 1 to be written" />
|
|
237 <param name="length_2" type="integer" value="35" label="Unpaired single-end read length cutoff needed for read 2 to be written" />
|
|
238 </when> <!-- output -->
|
|
239 </conditional> <!-- retain_unpaired -->
|
|
240
|
|
241 </when> <!-- full -->
|
|
242 </conditional> <!-- params -->
|
|
243
|
|
244 <conditional name="rrbs">
|
|
245 <param name="settingsType" type="select" label="RRBS specific settings">
|
|
246 <option value="default">Use Defaults (no RRBS)</option>
|
|
247 <option value="custom">Full parameter list</option>
|
|
248 </param>
|
|
249 <when value="default" />
|
|
250 <!-- Full/advanced params. -->
|
|
251 <when value="custom">
|
|
252 <param name="rrbs" type="boolean" truevalue="--rrbs" falsevalue="" checked="True" label="Specifies that the input file was an MspI digested RRBS sample" />
|
|
253 <param name="non_directional" type="boolean" truevalue="--non_directional" falsevalue="" checked="False" label="Selecting this option for non-directional RRBS libraries" />
|
|
254 </when> <!-- full -->
|
|
255 </conditional> <!-- params -->
|
|
256
|
|
257 </inputs>
|
|
258 <outputs>
|
|
259
|
|
260 <data format="fastq" name="trimmed_reads_single" label="${tool.name} on ${on_string}: trimmed reads">
|
|
261 <filter>singlePaired['sPaired'] == "single"</filter>
|
|
262 <actions>
|
|
263 <action type="format">
|
|
264 <option type="from_param" name="singlePaired.input_singles" param_attribute="ext" />
|
|
265 </action>
|
|
266 </actions>
|
|
267 </data>
|
|
268
|
|
269 <data format="fastq" name="trimmed_reads_pair1" label="${tool.name} on ${on_string}: trimmed reads pair 1">
|
|
270 <filter>singlePaired['sPaired'] == "paired"</filter>
|
|
271 <actions>
|
|
272 <action type="format">
|
|
273 <option type="from_param" name="singlePaired.input_mate1" param_attribute="ext" />
|
|
274 </action>
|
|
275 </actions>
|
|
276 </data>
|
|
277
|
|
278 <data format="fastq" name="trimmed_reads_pair2" label="${tool.name} on ${on_string}: trimmed reads pair 2">
|
|
279 <filter>singlePaired['sPaired'] == "paired"</filter>
|
|
280 <actions>
|
|
281 <action type="format">
|
|
282 <option type="from_param" name="singlePaired.input_mate1" param_attribute="ext" />
|
|
283 </action>
|
|
284 </actions>
|
|
285 </data>
|
|
286
|
|
287 <data format="fastq" name="unpaired_reads_1" label="${tool.name} on ${on_string}: unpaired reads (1)">
|
|
288 <filter>
|
|
289 ((
|
|
290 params['settingsType'] == "custom" and
|
|
291 params['retain_unpaired']['settingsType'] == "retain_unpaired_output"
|
|
292 ))
|
|
293 </filter>
|
|
294 <actions>
|
|
295 <action type="format">
|
|
296 <option type="from_param" name="singlePaired.input_mate1" param_attribute="ext" />
|
|
297 </action>
|
|
298 </actions>
|
|
299 </data>
|
|
300
|
|
301 <data format="fastq" name="unpaired_reads_2" label="${tool.name} on ${on_string}: unpaired reads (2)">
|
|
302 <filter>
|
|
303 ((
|
|
304 params['settingsType'] == "custom" and
|
|
305 params['retain_unpaired']['settingsType'] == "retain_unpaired_output"
|
|
306 ))
|
|
307 </filter>
|
|
308 <actions>
|
|
309 <action type="format">
|
|
310 <option type="from_param" name="singlePaired.input_mate1" param_attribute="ext" />
|
|
311 </action>
|
|
312 </actions>
|
|
313 </data>
|
|
314
|
|
315 <data format="txt" name="report_file" label="${tool.name} on ${on_string}: report file">
|
|
316 <filter>
|
|
317 ((
|
|
318 params['settingsType'] == "custom" and
|
|
319 params['report'] == True
|
|
320 ))
|
|
321 </filter>
|
|
322 </data>
|
|
323
|
|
324 </outputs>
|
|
325 <tests>
|
|
326 </tests>
|
|
327
|
|
328 <help>
|
|
329
|
|
330 **What it does**
|
|
331
|
|
332 TrimGalore!_ is a wrapper script that makes use of the publically available
|
|
333 adapter trimming tool Cutadapt and FastQC for optional quality control once
|
|
334 the trimming process has completed.
|
|
335
|
|
336
|
|
337 .. _TrimGalore!: http://www.bioinformatics.babraham.ac.uk/projects/trim_galore/
|
|
338
|
|
339
|
|
340 It is developed by Krueger F at the Babraham Institute.
|
|
341
|
|
342 ------
|
|
343
|
|
344
|
|
345 </help>
|
|
346 </tool>
|