1 | <tool id="fastq_groomer" name="FASTQ Groomer" version="1.0.3"> |
---|
2 | <description>convert between various FASTQ quality formats</description> |
---|
3 | <command interpreter="python">fastq_groomer.py '$input_file' '$input_type' '$output_file' |
---|
4 | #if str( $options_type['options_type_selector'] ) == 'basic': |
---|
5 | #if str( $input_type ) == 'cssanger': |
---|
6 | 'cssanger' |
---|
7 | #else: |
---|
8 | 'sanger' |
---|
9 | #end if |
---|
10 | 'ascii' 'summarize_input' |
---|
11 | #else: |
---|
12 | '${options_type.output_type}' '${options_type.force_quality_encoding}' '${options_type.summarize_input}' |
---|
13 | #end if |
---|
14 | </command> |
---|
15 | <inputs> |
---|
16 | <param name="input_file" type="data" format="fastq" label="File to groom" /> |
---|
17 | <param name="input_type" type="select" label="Input FASTQ quality scores type"> |
---|
18 | <option value="solexa">Solexa</option> |
---|
19 | <option value="illumina">Illumina 1.3+</option> |
---|
20 | <option value="sanger" selected="True">Sanger</option> |
---|
21 | <option value="cssanger">Color Space Sanger</option> |
---|
22 | </param> |
---|
23 | <conditional name="options_type"> |
---|
24 | <param name="options_type_selector" type="select" label="Advanced Options"> |
---|
25 | <option value="basic" selected="True">Hide Advanced Options</option> |
---|
26 | <option value="advanced">Show Advanced Options</option> |
---|
27 | </param> |
---|
28 | <when value="basic"> |
---|
29 | <!-- no options --> |
---|
30 | </when> |
---|
31 | <when value="advanced"> |
---|
32 | <param name="output_type" type="select" label="Output FASTQ quality scores type" help="Galaxy tools are designed to work with the Sanger Quality score format."> |
---|
33 | <option value="solexa">Solexa</option> |
---|
34 | <option value="illumina">Illumina 1.3+</option> |
---|
35 | <option value="sanger" selected="True">Sanger (recommended)</option> |
---|
36 | <option value="cssanger">Color Space Sanger</option> |
---|
37 | </param> |
---|
38 | <param name="force_quality_encoding" type="select" label="Force Quality Score encoding"> |
---|
39 | <option value="None">Use Source Encoding</option> |
---|
40 | <option value="ascii" selected="True">ASCII</option> |
---|
41 | <option value="decimal">Decimal</option> |
---|
42 | </param> |
---|
43 | <param name="summarize_input" type="select" label="Summarize input data"> |
---|
44 | <option value="summarize_input" selected="True">Summarize Input</option> |
---|
45 | <option value="dont_summarize_input">Do not Summarize Input (faster)</option> |
---|
46 | </param> |
---|
47 | </when> |
---|
48 | </conditional> |
---|
49 | </inputs> |
---|
50 | <outputs> |
---|
51 | <data name="output_file" format="fastqsanger"> |
---|
52 | <change_format> |
---|
53 | <when input="input_type" value="cssanger" format="fastqcssanger" /> |
---|
54 | <when input="options_type.output_type" value="solexa" format="fastqsolexa" /> |
---|
55 | <when input="options_type.output_type" value="illumina" format="fastqillumina" /> |
---|
56 | <when input="options_type.output_type" value="sanger" format="fastqsanger" /> |
---|
57 | <when input="options_type.output_type" value="cssanger" format="fastqcssanger" /> |
---|
58 | </change_format> |
---|
59 | </data> |
---|
60 | </outputs> |
---|
61 | <tests> |
---|
62 | <!-- These tests include test files adapted from supplemental material in Cock PJ, Fields CJ, Goto N, Heuer ML, Rice PM. The Sanger FASTQ file format for sequences with quality scores, and the Solexa/Illumina FASTQ variants. Nucleic Acids Res. 2009 Dec 16. --> |
---|
63 | <!-- Unfortunately, cannot test for expected failures --> |
---|
64 | <!-- Test basic options --> |
---|
65 | <test> |
---|
66 | <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastq" /> |
---|
67 | <param name="input_type" value="sanger" /> |
---|
68 | <param name="options_type_selector" value="basic" /> |
---|
69 | <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" /> |
---|
70 | </test> |
---|
71 | <test> |
---|
72 | <param name="input_file" value="sanger_full_range_as_cssanger.fastqcssanger" ftype="fastq" /> |
---|
73 | <param name="input_type" value="cssanger" /> |
---|
74 | <param name="options_type_selector" value="basic" /> |
---|
75 | <output name="output_file" file="sanger_full_range_as_cssanger.fastqcssanger" /> |
---|
76 | </test> |
---|
77 | <test> |
---|
78 | <param name="input_file" value="illumina_full_range_original_illumina.fastqillumina" ftype="fastq" /> |
---|
79 | <param name="input_type" value="illumina" /> |
---|
80 | <param name="options_type_selector" value="basic" /> |
---|
81 | <output name="output_file" file="illumina_full_range_as_sanger.fastqsanger" /> |
---|
82 | </test> |
---|
83 | <test> |
---|
84 | <param name="input_file" value="solexa_full_range_original_solexa.fastqsolexa" ftype="fastq" /> |
---|
85 | <param name="input_type" value="solexa" /> |
---|
86 | <param name="options_type_selector" value="basic" /> |
---|
87 | <output name="output_file" file="solexa_full_range_as_sanger.fastqsanger" /> |
---|
88 | </test> |
---|
89 | <test> |
---|
90 | <param name="input_file" value="sanger_full_range_as_illumina.fastqillumina" ftype="fastq" /> |
---|
91 | <param name="input_type" value="sanger" /> |
---|
92 | <param name="options_type_selector" value="basic" /> |
---|
93 | <output name="output_file" file="sanger_full_range_as_illumina.fastqillumina" /> |
---|
94 | </test> |
---|
95 | <!-- Test grooming from illumina --> |
---|
96 | <test> |
---|
97 | <param name="input_file" value="illumina_full_range_original_illumina.fastqillumina" ftype="fastq" /> |
---|
98 | <param name="input_type" value="illumina" /> |
---|
99 | <param name="options_type_selector" value="advanced" /> |
---|
100 | <param name="output_type" value="illumina" /> |
---|
101 | <param name="force_quality_encoding" value="None" /> |
---|
102 | <param name="summarize_input" value="summarize_input" /> |
---|
103 | <output name="output_file" file="illumina_full_range_original_illumina.fastqillumina" /> |
---|
104 | </test> |
---|
105 | <test> |
---|
106 | <param name="input_file" value="illumina_full_range_original_illumina.fastqillumina" ftype="fastq" /> |
---|
107 | <param name="input_type" value="illumina" /> |
---|
108 | <param name="options_type_selector" value="advanced" /> |
---|
109 | <param name="output_type" value="sanger" /> |
---|
110 | <param name="force_quality_encoding" value="None" /> |
---|
111 | <param name="summarize_input" value="summarize_input" /> |
---|
112 | <output name="output_file" file="illumina_full_range_as_sanger.fastqsanger" /> |
---|
113 | </test> |
---|
114 | <test> |
---|
115 | <param name="input_file" value="illumina_full_range_original_illumina.fastqillumina" ftype="fastq" /> |
---|
116 | <param name="input_type" value="illumina" /> |
---|
117 | <param name="options_type_selector" value="advanced" /> |
---|
118 | <param name="output_type" value="solexa" /> |
---|
119 | <param name="force_quality_encoding" value="None" /> |
---|
120 | <param name="summarize_input" value="summarize_input" /> |
---|
121 | <output name="output_file" file="illumina_full_range_as_solexa.fastqsolexa" /> |
---|
122 | </test> |
---|
123 | <test> |
---|
124 | <param name="input_file" value="illumina_full_range_original_illumina.fastqillumina" ftype="fastq" /> |
---|
125 | <param name="input_type" value="illumina" /> |
---|
126 | <param name="options_type_selector" value="advanced" /> |
---|
127 | <param name="output_type" value="cssanger" /> |
---|
128 | <param name="force_quality_encoding" value="None" /> |
---|
129 | <param name="summarize_input" value="summarize_input" /> |
---|
130 | <output name="output_file" file="illumina_full_range_as_cssanger.fastqcssanger" /> |
---|
131 | </test> |
---|
132 | <!-- Test grooming from sanger --> |
---|
133 | <test> |
---|
134 | <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastq" /> |
---|
135 | <param name="input_type" value="sanger" /> |
---|
136 | <param name="options_type_selector" value="advanced" /> |
---|
137 | <param name="output_type" value="sanger" /> |
---|
138 | <param name="force_quality_encoding" value="None" /> |
---|
139 | <param name="summarize_input" value="summarize_input" /> |
---|
140 | <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" /> |
---|
141 | </test> |
---|
142 | <test> |
---|
143 | <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastq" /> |
---|
144 | <param name="input_type" value="sanger" /> |
---|
145 | <param name="options_type_selector" value="advanced" /> |
---|
146 | <param name="output_type" value="illumina" /> |
---|
147 | <param name="force_quality_encoding" value="None" /> |
---|
148 | <param name="summarize_input" value="summarize_input" /> |
---|
149 | <output name="output_file" file="sanger_full_range_as_illumina.fastqillumina" /> |
---|
150 | </test> |
---|
151 | <test> |
---|
152 | <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastq" /> |
---|
153 | <param name="input_type" value="sanger" /> |
---|
154 | <param name="options_type_selector" value="advanced" /> |
---|
155 | <param name="output_type" value="solexa" /> |
---|
156 | <param name="force_quality_encoding" value="None" /> |
---|
157 | <param name="summarize_input" value="summarize_input" /> |
---|
158 | <output name="output_file" file="sanger_full_range_as_solexa.fastqsolexa" /> |
---|
159 | </test> |
---|
160 | <test> |
---|
161 | <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastq" /> |
---|
162 | <param name="input_type" value="sanger" /> |
---|
163 | <param name="options_type_selector" value="advanced" /> |
---|
164 | <param name="output_type" value="cssanger" /> |
---|
165 | <param name="force_quality_encoding" value="None" /> |
---|
166 | <param name="summarize_input" value="summarize_input" /> |
---|
167 | <output name="output_file" file="sanger_full_range_as_cssanger.fastqcssanger" /> |
---|
168 | </test> |
---|
169 | <!-- Test grooming from solexa --> |
---|
170 | <test> |
---|
171 | <param name="input_file" value="solexa_full_range_original_solexa.fastqsolexa" ftype="fastq" /> |
---|
172 | <param name="input_type" value="solexa" /> |
---|
173 | <param name="options_type_selector" value="advanced" /> |
---|
174 | <param name="output_type" value="solexa" /> |
---|
175 | <param name="force_quality_encoding" value="None" /> |
---|
176 | <param name="summarize_input" value="summarize_input" /> |
---|
177 | <output name="output_file" file="solexa_full_range_original_solexa.fastqsolexa" /> |
---|
178 | </test> |
---|
179 | <test> |
---|
180 | <param name="input_file" value="solexa_full_range_original_solexa.fastqsolexa" ftype="fastq" /> |
---|
181 | <param name="input_type" value="solexa" /> |
---|
182 | <param name="options_type_selector" value="advanced" /> |
---|
183 | <param name="output_type" value="illumina" /> |
---|
184 | <param name="force_quality_encoding" value="None" /> |
---|
185 | <param name="summarize_input" value="summarize_input" /> |
---|
186 | <output name="output_file" file="solexa_full_range_as_illumina.fastqillumina" /> |
---|
187 | </test> |
---|
188 | <test> |
---|
189 | <param name="input_file" value="solexa_full_range_original_solexa.fastqsolexa" ftype="fastq" /> |
---|
190 | <param name="input_type" value="solexa" /> |
---|
191 | <param name="options_type_selector" value="advanced" /> |
---|
192 | <param name="output_type" value="sanger" /> |
---|
193 | <param name="force_quality_encoding" value="None" /> |
---|
194 | <param name="summarize_input" value="summarize_input" /> |
---|
195 | <output name="output_file" file="solexa_full_range_as_sanger.fastqsanger" /> |
---|
196 | </test> |
---|
197 | <test> |
---|
198 | <param name="input_file" value="solexa_full_range_original_solexa.fastqsolexa" ftype="fastq" /> |
---|
199 | <param name="input_type" value="solexa" /> |
---|
200 | <param name="options_type_selector" value="advanced" /> |
---|
201 | <param name="output_type" value="cssanger" /> |
---|
202 | <param name="force_quality_encoding" value="None" /> |
---|
203 | <param name="summarize_input" value="summarize_input" /> |
---|
204 | <output name="output_file" file="solexa_full_range_as_cssanger.fastqcssanger" /> |
---|
205 | </test> |
---|
206 | <!-- Test grooming from cssanger --> |
---|
207 | <test> |
---|
208 | <param name="input_file" value="sanger_full_range_as_cssanger.fastqcssanger" ftype="fastq" /> |
---|
209 | <param name="input_type" value="cssanger" /> |
---|
210 | <param name="options_type_selector" value="advanced" /> |
---|
211 | <param name="output_type" value="cssanger" /> |
---|
212 | <param name="force_quality_encoding" value="None" /> |
---|
213 | <param name="summarize_input" value="summarize_input" /> |
---|
214 | <output name="output_file" file="sanger_full_range_as_cssanger.fastqcssanger" /> |
---|
215 | </test> |
---|
216 | <test> |
---|
217 | <param name="input_file" value="sanger_full_range_as_cssanger.fastqcssanger" ftype="fastq" /> |
---|
218 | <param name="input_type" value="cssanger" /> |
---|
219 | <param name="options_type_selector" value="advanced" /> |
---|
220 | <param name="output_type" value="sanger" /> |
---|
221 | <param name="force_quality_encoding" value="None" /> |
---|
222 | <param name="summarize_input" value="summarize_input" /> |
---|
223 | <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" /> |
---|
224 | </test> |
---|
225 | <test> |
---|
226 | <param name="input_file" value="sanger_full_range_as_cssanger.fastqcssanger" ftype="fastq" /> |
---|
227 | <param name="input_type" value="cssanger" /> |
---|
228 | <param name="options_type_selector" value="advanced" /> |
---|
229 | <param name="output_type" value="illumina" /> |
---|
230 | <param name="force_quality_encoding" value="None" /> |
---|
231 | <param name="summarize_input" value="summarize_input" /> |
---|
232 | <output name="output_file" file="sanger_full_range_as_illumina.fastqillumina" /> |
---|
233 | </test> |
---|
234 | <test> |
---|
235 | <param name="input_file" value="sanger_full_range_as_cssanger.fastqcssanger" ftype="fastq" /> |
---|
236 | <param name="input_type" value="cssanger" /> |
---|
237 | <param name="options_type_selector" value="advanced" /> |
---|
238 | <param name="output_type" value="solexa" /> |
---|
239 | <param name="force_quality_encoding" value="None" /> |
---|
240 | <param name="summarize_input" value="summarize_input" /> |
---|
241 | <output name="output_file" file="sanger_full_range_as_solexa.fastqsolexa" /> |
---|
242 | </test> |
---|
243 | <!-- Test fastq with line wrapping --> |
---|
244 | <test> |
---|
245 | <param name="input_file" value="wrapping_original_sanger.fastqsanger" ftype="fastq" /> |
---|
246 | <param name="input_type" value="sanger" /> |
---|
247 | <param name="options_type_selector" value="advanced" /> |
---|
248 | <param name="output_type" value="sanger" /> |
---|
249 | <param name="force_quality_encoding" value="None" /> |
---|
250 | <param name="summarize_input" value="summarize_input" /> |
---|
251 | <output name="output_file" file="wrapping_as_sanger.fastqsanger" /> |
---|
252 | </test> |
---|
253 | <test> |
---|
254 | <param name="input_file" value="wrapping_original_sanger.fastqsanger" ftype="fastq" /> |
---|
255 | <param name="input_type" value="sanger" /> |
---|
256 | <param name="options_type_selector" value="advanced" /> |
---|
257 | <param name="output_type" value="illumina" /> |
---|
258 | <param name="force_quality_encoding" value="None" /> |
---|
259 | <param name="summarize_input" value="summarize_input" /> |
---|
260 | <output name="output_file" file="wrapping_as_illumina.fastqillumina" /> |
---|
261 | </test> |
---|
262 | <test> |
---|
263 | <param name="input_file" value="wrapping_original_sanger.fastqsanger" ftype="fastq" /> |
---|
264 | <param name="input_type" value="sanger" /> |
---|
265 | <param name="options_type_selector" value="advanced" /> |
---|
266 | <param name="output_type" value="solexa" /> |
---|
267 | <param name="force_quality_encoding" value="None" /> |
---|
268 | <param name="summarize_input" value="summarize_input" /> |
---|
269 | <output name="output_file" file="wrapping_as_solexa.fastqsolexa" /> |
---|
270 | </test> |
---|
271 | <!-- Test forcing quality score encoding --> |
---|
272 | <!-- Sanger, range 0 - 93 --> |
---|
273 | <test> |
---|
274 | <param name="input_file" value="sanger_full_range_as_decimal_sanger.fastqsanger" ftype="fastq" /> |
---|
275 | <param name="input_type" value="sanger" /> |
---|
276 | <param name="options_type_selector" value="advanced" /> |
---|
277 | <param name="output_type" value="sanger" /> |
---|
278 | <param name="force_quality_encoding" value="ascii" /> |
---|
279 | <param name="summarize_input" value="summarize_input" /> |
---|
280 | <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" /> |
---|
281 | </test> |
---|
282 | <test> |
---|
283 | <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastq" /> |
---|
284 | <param name="input_type" value="sanger" /> |
---|
285 | <param name="options_type_selector" value="advanced" /> |
---|
286 | <param name="output_type" value="sanger" /> |
---|
287 | <param name="force_quality_encoding" value="decimal" /> |
---|
288 | <param name="summarize_input" value="summarize_input" /> |
---|
289 | <output name="output_file" file="sanger_full_range_as_decimal_sanger.fastqsanger" /> |
---|
290 | </test> |
---|
291 | <test> |
---|
292 | <param name="input_file" value="sanger_full_range_as_tab_decimal_sanger.fastqsanger" ftype="fastq" /> |
---|
293 | <param name="input_type" value="sanger" /> |
---|
294 | <param name="options_type_selector" value="advanced" /> |
---|
295 | <param name="output_type" value="sanger" /> |
---|
296 | <param name="force_quality_encoding" value="ascii" /> |
---|
297 | <param name="summarize_input" value="summarize_input" /> |
---|
298 | <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" /> |
---|
299 | </test> |
---|
300 | <!-- Solexa, range -5 - 62 --> |
---|
301 | <test> |
---|
302 | <param name="input_file" value="solexa_full_range_as_decimal_solexa.fastqsolexa" ftype="fastq" /> |
---|
303 | <param name="input_type" value="solexa" /> |
---|
304 | <param name="options_type_selector" value="advanced" /> |
---|
305 | <param name="output_type" value="solexa" /> |
---|
306 | <param name="force_quality_encoding" value="ascii" /> |
---|
307 | <param name="summarize_input" value="summarize_input" /> |
---|
308 | <output name="output_file" file="solexa_full_range_original_solexa.fastqsolexa" /> |
---|
309 | </test> |
---|
310 | <test> |
---|
311 | <param name="input_file" value="solexa_full_range_original_solexa.fastqsolexa" ftype="fastq" /> |
---|
312 | <param name="input_type" value="solexa" /> |
---|
313 | <param name="options_type_selector" value="advanced" /> |
---|
314 | <param name="output_type" value="solexa" /> |
---|
315 | <param name="force_quality_encoding" value="decimal" /> |
---|
316 | <param name="summarize_input" value="summarize_input" /> |
---|
317 | <output name="output_file" file="solexa_full_range_as_decimal_solexa.fastqsolexa" /> |
---|
318 | </test> |
---|
319 | </tests> |
---|
320 | <help> |
---|
321 | **What it does** |
---|
322 | |
---|
323 | This tool offers several conversions options relating to the FASTQ format. |
---|
324 | |
---|
325 | When using *Basic* options, the output will be *sanger* formatted or *cssanger* formatted (when the input is Color Space Sanger). |
---|
326 | |
---|
327 | When converting, if a quality score falls outside of the target score range, it will be coerced to the closest available value (i.e. the minimum or maximum). |
---|
328 | |
---|
329 | When converting between Solexa and the other formats, quality scores are mapped between Solexa and PHRED scales using the equations found in `Cock PJ, Fields CJ, Goto N, Heuer ML, Rice PM. The Sanger FASTQ file format for sequences with quality scores, and the Solexa/Illumina FASTQ variants. Nucleic Acids Res. 2009 Dec 16.`_ |
---|
330 | |
---|
331 | When converting between color space (csSanger) and base/sequence space (Sanger, Illumina, Solexa) formats, adapter bases are lost or gained; if gained, the base 'G' is used as the adapter. You cannot convert a color space read to base space if there is no adapter present in the color space sequence. Any masked or ambiguous nucleotides in base space will be converted to 'N's when determining color space encoding. |
---|
332 | |
---|
333 | ----- |
---|
334 | |
---|
335 | **Quality Score Comparison** |
---|
336 | |
---|
337 | :: |
---|
338 | |
---|
339 | SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS |
---|
340 | ...............................IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII |
---|
341 | ..........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
---|
342 | !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
---|
343 | | | | | | | |
---|
344 | 33 59 64 73 104 126 |
---|
345 | |
---|
346 | S - Sanger Phred+33, 93 values (0, 93) (0 to 60 expected in raw reads) |
---|
347 | I - Illumina 1.3 Phred+64, 62 values (0, 62) (0 to 40 expected in raw reads) |
---|
348 | X - Solexa Solexa+64, 67 values (-5, 62) (-5 to 40 expected in raw reads) |
---|
349 | |
---|
350 | Diagram adapted from http://en.wikipedia.org/wiki/FASTQ_format |
---|
351 | |
---|
352 | |
---|
353 | .. _Cock PJ, Fields CJ, Goto N, Heuer ML, Rice PM. The Sanger FASTQ file format for sequences with quality scores, and the Solexa/Illumina FASTQ variants. Nucleic Acids Res. 2009 Dec 16.: http://www.ncbi.nlm.nih.gov/pubmed/20015970 |
---|
354 | |
---|
355 | </help> |
---|
356 | </tool> |
---|