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