comparison tools/gatk/table_recalibration.xml @ 0:9071e359b9a3

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:37:19 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:9071e359b9a3
1 <tool id="gatk_table_recalibration" name="Table Recalibration" version="0.0.1">
2 <description>on BAM files</description>
3 <command interpreter="python">gatk_wrapper.py
4 --stdout "${output_log}"
5 -d "-I" "${reference_source.input_bam}" "${reference_source.input_bam.ext}" "gatk_input"
6 -d "" "${reference_source.input_bam.metadata.bam_index}" "bam_index" "gatk_input" ##hardcode galaxy ext type as bam_index
7 -p 'java
8 -jar "${GALAXY_DATA_INDEX_DIR}/shared/jars/gatk/GenomeAnalysisTK.jar"
9 -T "TableRecalibration"
10 -o "${output_bam}"
11 -et "NO_ET" ##ET no phone home
12 ##-log "${output_log}" ##don't use this to log to file, instead directly capture stdout
13 #if $reference_source.reference_source_selector != "history":
14 -R "${reference_source.ref_file.fields.path}"
15 #end if
16 --recal_file "${input_recal}"
17 --disable_bam_indexing
18 '
19 ##start standard gatk options
20 #if $gatk_param_type.gatk_param_type_selector == "advanced":
21 #for $sample_metadata in $gatk_param_type.sample_metadata:
22 -p '--sample_metadata "${sample_metadata.sample_metadata_file}"'
23 #end for
24 #for $read_filter in $gatk_param_type.read_filter:
25 -p '--read_filter "${read_filter.read_filter_type.read_filter_type_selector}"
26 ###raise Exception( str( dir( $read_filter ) ) )
27 #for $name, $param in $read_filter.read_filter_type.iteritems():
28 #if $name not in [ "__current_case__", "read_filter_type_selector" ]:
29 --${name} "${param}"
30 #end if
31 #end for
32 '
33 #end for
34 #if str( $gatk_param_type.input_intervals ) != "None":
35 -d "-L" "${gatk_param_type.input_intervals}" "${gatk_param_type.input_intervals.ext}" "input_intervals"
36 #end if
37 #if str( $gatk_param_type.input_exclude_intervals ) != "None":
38 -d "-XL" "${gatk_param_type.input_exclude_intervals}" "${gatk_param_type.input_exclude_intervals.ext}" "input_intervals"
39 #end if
40 #set $rod_binding_names = dict()
41 #for $rod_binding in $gatk_param_type.rod_bind:
42 #if str( $rod_binding.rod_bind_type.rod_bind_type_selector ) == 'custom':
43 #set $rod_bind_name = $rod_binding.rod_bind_type.custom_rod_name
44 #else
45 #set $rod_bind_name = $rod_binding.rod_bind_type.rod_bind_type_selector
46 #end if
47 #set $rod_binding_names[$rod_bind_name] = $rod_binding_names.get( $rod_bind_name, -1 ) + 1
48 -d "-B:${rod_bind_name},%(file_type)s" "${rod_binding.rod_bind_type.input_rod}" "${rod_binding.rod_bind_type.input_rod.ext}" "input_${rod_bind_name}_${rod_binding_names[$rod_bind_name]}"
49 #if str( $rod_binding.rod_bind_type.rodToIntervalTrackName ):
50 -p '--rodToIntervalTrackName "${rod_bind_name}"'
51 #end if
52 #end for
53 -p '--BTI_merge_rule "${gatk_param_type.BTI_merge_rule}"'
54 #if str( $gatk_param_type.input_dbsnp_rod ) != "None":
55 -d "-D" "${gatk_param_type.input_dbsnp_rod}" "${gatk_param_type.input_dbsnp_rod.ext}" "dbsnp_rod"
56 #end if
57 -p '--downsampling_type "${gatk_param_type.downsampling_type.downsampling_type_selector}"'
58 #if str( $gatk_param_type.downsampling_type.downsampling_type_selector ) != "NONE":
59 -p '--${gatk_param_type.downsampling_type.downsample_to_type.downsample_to_type_selector} "${gatk_param_type.downsampling_type.downsample_to_type.downsample_to_value}"'
60 #end if
61 -p '
62 --baq "${gatk_param_type.baq}"
63 --baqGapOpenPenalty "${gatk_param_type.baq_gap_open_penalty}"
64 ${gatk_param_type.use_original_qualities}
65 --defaultBaseQualities "${gatk_param_type.default_base_qualities}"
66 --validation_strictness "${gatk_param_type.validation_strictness}"
67 --interval_merging "${gatk_param_type.interval_merging}"
68 '
69 #if str( $gatk_param_type.read_group_black_list ) != "None":
70 -d "-read_group_black_list" "${gatk_param_type.read_group_black_list}" "txt" "input_read_group_black_list"
71 #end if
72 #end if
73 #if str( $reference_source.reference_source_selector ) == "history":
74 -d "-R" "${reference_source.ref_file}" "${reference_source.ref_file.ext}" "gatk_input"
75 #end if
76 ##end standard gatk options
77
78 ##start analysis specific options
79 #if $analysis_param_type.analysis_param_type_selector == "advanced":
80 -p '
81 #if $analysis_param_type.default_read_group_type.default_read_group_type_selector == "set":
82 --default_read_group "${analysis_param_type.default_read_group_type.default_read_group}"
83 #end if
84 #if str( $analysis_param_type.default_platform ) != "default":
85 --default_platform "${analysis_param_type.default_platform}"
86 #end if
87 #if str( $analysis_param_type.force_read_group_type.force_read_group_type_selector ) == "set":
88 --force_read_group "${analysis_param_type.force_read_group_type.force_read_group}"
89 #end if
90 #if str( $analysis_param_type.force_platform ) != "default":
91 --force_platform "${analysis_param_type.force_platform}"
92 #end if
93 ${analysis_param_type.exception_if_no_tile}
94 #if str( $analysis_param_type.solid_options_type.solid_options_type_selector ) == "set":
95 #if str( $analysis_param_type.solid_options_type.solid_recal_mode ) != "default":
96 --solid_recal_mode "${analysis_param_type.solid_options_type.solid_recal_mode}"
97 #end if
98 #if str( $analysis_param_type.solid_options_type.solid_nocall_strategy ) != "default":
99 --solid_nocall_strategy "${analysis_param_type.solid_options_type.solid_nocall_strategy}"
100 #end if
101 #end if
102 ${analysis_param_type.simplify_bam}
103 --preserve_qscores_less_than "${analysis_param_type.preserve_qscores_less_than}"
104 --smoothing "${analysis_param_type.smoothing}"
105 --max_quality_score "${analysis_param_type.max_quality_score}"
106 --window_size_nqs "${analysis_param_type.window_size_nqs}"
107 --homopolymer_nback "${analysis_param_type.homopolymer_nback}"
108 ${analysis_param_type.do_not_write_original_quals}
109 '
110 #end if
111 </command>
112 <inputs>
113 <param name="input_recal" type="data" format="csv" label="Covariates table recalibration file" />
114 <conditional name="reference_source">
115 <param name="reference_source_selector" type="select" label="Choose the source for the reference list">
116 <option value="cached">Locally cached</option>
117 <option value="history">History</option>
118 </param>
119 <when value="cached">
120 <param name="input_bam" type="data" format="bam" label="BAM file">
121 <validator type="unspecified_build" />
122 <validator type="dataset_metadata_in_file" filename="picard_index.loc" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." /> <!-- fixme!!! this needs to be a select -->
123 </param>
124 <param name="ref_file" type="select" label="Using reference genome">
125 <options from_data_table="picard_indexes">
126 <filter type="data_meta" key="dbkey" ref="input_bam" column="dbkey"/>
127 </options>
128 </param>
129 </when>
130 <when value="history"> <!-- FIX ME!!!! -->
131 <param name="input_bam" type="data" format="bam" label="BAM file" />
132 <param name="ref_file" type="data" format="fasta" label="Using reference file" />
133 </when>
134 </conditional>
135
136 <conditional name="gatk_param_type">
137 <param name="gatk_param_type_selector" type="select" label="Basic or Advanced GATK options">
138 <option value="basic" selected="True">Basic</option>
139 <option value="advanced">Advanced</option>
140 </param>
141 <when value="basic">
142 <!-- Do nothing here -->
143 </when>
144 <when value="advanced">
145 <repeat name="sample_metadata" title="Sample Metadata">
146 <param name="sample_metadata_file" type="data" format="txt" label="Sample file(s) in JSON format" />
147 </repeat>
148 <repeat name="read_filter" title="Read Filter">
149 <conditional name="read_filter_type">
150 <param name="read_filter_type_selector" type="select" label="Read Filter Type">
151 <option value="MaxReadLength" selected="True">MaxReadLength</option>
152 <option value="ZeroMappingQualityRead">ZeroMappingQualityRead</option>
153 </param>
154 <when value="ZeroMappingQualityRead">
155 <!-- no extra options -->
156 </when>
157 <when value="MaxReadLength">
158 <param name="maxReadLength" type="integer" value="76" label="Max Read Length"/>
159 </when>
160 </conditional>
161 </repeat>
162 <param name="input_intervals" type="data" format="picard_interval_list" optional="True" label="A list of genomic intervals over which to operate" />
163 <param name="input_exclude_intervals" type="data" format="picard_interval_list" optional="True" label="A list of genomic intervals to exclude from processing" />
164 <repeat name="rod_bind" title="Binding for reference-ordered data">
165 <conditional name="rod_bind_type">
166 <param name="rod_bind_type_selector" type="select" label="Binding Type">
167 <option value="snps" selected="True">SNPs</option>
168 <option value="indels">INDELs</option>
169 <option value="custom">Custom</option>
170 </param>
171 <when value="snps">
172 <param name="input_rod" type="data" format="vcf,gatk_dbsnp,bed" label="ROD file" />
173 <param name="rodToIntervalTrackName" type="boolean" truevalue="--rodToIntervalTrackName" falsevalue="" label="Use ROD as interval List (-BTI, --rodToIntervalTrackName)" help="Only one ROD may have this option specified" />
174 </when>
175 <when value="indels">
176 <param name="input_rod" type="data" format="vcf,gatk_dbsnp,bed" label="ROD file" />
177 <param name="rodToIntervalTrackName" type="boolean" truevalue="--rodToIntervalTrackName" falsevalue="" label="Use ROD as interval List (-BTI, --rodToIntervalTrackName)" help="Only one ROD may have this option specified" />
178 </when>
179 <when value="custom">
180 <param name="custom_rod_name" type="text" value="Unknown" label="ROD Name"/>
181 <param name="input_rod" type="data" format="vcf,gatk_dbsnp,bed" label="ROD file" />
182 <param name="rodToIntervalTrackName" type="boolean" truevalue="--rodToIntervalTrackName" falsevalue="" label="Use ROD as interval List (-BTI, --rodToIntervalTrackName)" help="Only one ROD may have this option specified" />
183 </when>
184 </conditional>
185 </repeat>
186 <param name="BTI_merge_rule" type="select" label="BTI merge rule">
187 <option value="UNION" selected="True">UNION</option>
188 <option value="INTERSECTION">INTERSECTION</option>
189 </param>
190 <param name="input_dbsnp_rod" type="data" format="gatk_dbsnp" optional="True" label="dbSNP reference ordered data (ROD)" />
191 <conditional name="downsampling_type">
192 <param name="downsampling_type_selector" type="select" label="Type of reads downsampling to employ at a given locus" help="Downsampling Type">
193 <option value="NONE" selected="True">NONE</option>
194 <option value="ALL_READS">ALL_READS</option>
195 <option value="BY_SAMPLE">BY_SAMPLE</option>
196 </param>
197 <when value="NONE">
198 <!-- no more options here -->
199 </when>
200 <when value="ALL_READS">
201 <conditional name="downsample_to_type">
202 <param name="downsample_to_type_selector" type="select" label="Type of reads downsampling to employ at a given locus" help="Downsampling Type">
203 <option value="downsample_to_fraction" selected="True">Downsample by Fraction</option>
204 <option value="downsample_to_coverage">Downsample by Coverage</option>
205 </param>
206 <when value="downsample_to_fraction">
207 <param name="downsample_to_value" type="float" label="Fraction [0.0-1.0] of reads to downsample to" value="0.1"/>
208 </when>
209 <when value="downsample_to_coverage">
210 <param name="downsample_to_value" type="integer" label="Coverage to downsample to at any given locus" value="0"/>
211 </when>
212 </conditional>
213 </when>
214 <when value="BY_SAMPLE">
215 <conditional name="downsample_to_type">
216 <param name="downsample_to_type_selector" type="select" label="Type of reads downsampling to employ at a given locus" help="Downsampling Type">
217 <option value="downsample_to_fraction" selected="True">Downsample by Fraction</option>
218 <option value="downsample_to_coverage">Downsample by Coverage</option>
219 </param>
220 <when value="downsample_to_fraction">
221 <param name="downsample_to_value" type="float" label="Fraction [0.0-1.0] of reads to downsample to" value="0.1"/>
222 </when>
223 <when value="downsample_to_coverage">
224 <param name="downsample_to_value" type="integer" label="Coverage to downsample to at any given locus" value="0"/>
225 </when>
226 </conditional>
227 </when>
228 </conditional>
229 <param name="baq" type="select" label="Type of BAQ calculation to apply in the engine">
230 <option value="OFF" selected="True">OFF</option>
231 <option value="CALCULATE_AS_NECESSARY">CALCULATE_AS_NECESSARY</option>
232 <option value="RECALCULATE">RECALCULATE</option>
233 </param>
234 <param name="baq_gap_open_penalty" type="integer" label="BAQ gap open penalty (Phred Scaled)" value="40" help="Default value is 40. 30 is perhaps better for whole genome call sets."/>
235 <param name="use_original_qualities" type="boolean" truevalue="--useOriginalQualities" falsevalue="" label="Use the original base quality scores from the OQ tag" />
236 <param name="default_base_qualities" type="integer" label="Value to be used for all base quality scores, when some are missing" value="-1"/>
237 <param name="validation_strictness" type="select" label="How strict should we be with validation">
238 <option value="STRICT" selected="True">STRICT</option>
239 <option value="LENIENT">LENIENT</option>
240 <option value="SILENT">SILENT</option>
241 </param>
242 <param name="interval_merging" type="select" label="Interval merging rule">
243 <option value="ALL" selected="True">ALL</option>
244 <option value="OVERLAPPING_ONLY">OVERLAPPING_ONLY</option>
245 </param>
246 <param name="read_group_black_list" type="data" format="txt" optional="True" label="Read group black list" />
247 </when>
248 </conditional>
249
250
251 <conditional name="analysis_param_type">
252 <param name="analysis_param_type_selector" type="select" label="Basic or Advanced Analysis options">
253 <option value="basic" selected="True">Basic</option>
254 <option value="advanced">Advanced</option>
255 </param>
256 <when value="basic">
257 <!-- Do nothing here -->
258 </when>
259 <when value="advanced">
260 <conditional name="default_read_group_type">
261 <param name="default_read_group_type_selector" type="select" label="Set default Read Group">
262 <option value="default" selected="True">Don't Set</option>
263 <option value="set">Set</option>
264 </param>
265 <when value="default">
266 <!-- do nothing here -->
267 </when>
268 <when value="set">
269 <param name="default_read_group" type="text" value="Unknown" label="If a read has no read group then default to the provided String"/>
270 </when>
271 </conditional>
272 <param name="default_platform" type="select" label="Set default Platform">
273 <option value="default" selected="True">Don't Set</option>
274 <option value="illumina">illumina</option>
275 <option value="454">454</option>
276 <option value="solid">solid</option>
277 </param>
278 <conditional name="force_read_group_type">
279 <param name="force_read_group_type_selector" type="select" label="Force Read Group">
280 <option value="default" selected="True">Don't Force</option>
281 <option value="set">Force</option>
282 </param>
283 <when value="default">
284 <!-- do nothing here -->
285 </when>
286 <when value="set">
287 <param name="force_read_group" type="text" value="Unknown" label="If provided, the read group ID of EVERY read will be forced to be the provided String."/>
288 </when>
289 </conditional>
290 <param name="force_platform" type="select" label="Force Platform">
291 <option value="default" selected="True">Don't Force</option>
292 <option value="illumina">illumina</option>
293 <option value="454">454</option>
294 <option value="solid">solid</option>
295 </param>
296 <param name="exception_if_no_tile" type="boolean" checked="False" truevalue="--exception_if_no_tile" falsevalue="" label="Throw an exception when no tile can be found"/>
297 <conditional name="solid_options_type">
298 <param name="solid_options_type_selector" type="select" label="Set SOLiD specific options">
299 <option value="default" selected="True">Don't Set</option>
300 <option value="set">Set</option>
301 </param>
302 <when value="default">
303 <!-- do nothing here -->
304 </when>
305 <when value="set">
306 <param name="solid_recal_mode" type="select" label="How should we recalibrate solid bases in which the reference was inserted">
307 <option value="default" selected="True">Don't set</option>
308 <option value="DO_NOTHING">DO_NOTHING</option>
309 <option value="SET_Q_ZERO">SET_Q_ZERO</option>
310 <option value="SET_Q_ZERO_BASE_N">SET_Q_ZERO_BASE_N</option>
311 <option value="REMOVE_REF_BIAS">REMOVE_REF_BIAS</option>
312 </param>
313 <param name="solid_nocall_strategy" type="select" label="Behavior of the recalibrator when it encounters no calls">
314 <option value="default" selected="True">Don't set</option>
315 <option value="THROW_EXCEPTION">THROW_EXCEPTION</option>
316 <option value="LEAVE_READ_UNRECALIBRATED">LEAVE_READ_UNRECALIBRATED</option>
317 <option value="PURGE_READ">PURGE_READ</option>
318 </param>
319 </when>
320 </conditional>
321 <param name="simplify_bam" type="boolean" checked="False" truevalue="-simplifyBAM" falsevalue="" label="Simplify BAM"/>
322 <param name="window_size_nqs" type="integer" value="5" label="Window size used by MinimumNQSCovariate"/>
323 <param name="homopolymer_nback" type="integer" value="7" label="Number of previous bases to look at in HomopolymerCovariate" />
324 <param name="preserve_qscores_less_than" type="integer" value="5" label="Bases with quality scores less than this threshold won't be recalibrated"/>
325 <param name="smoothing" type="integer" value="1" label="smoothing"/>
326 <param name="max_quality_score" type="integer" value="50" label="Max quality score"/>
327 <param name="do_not_write_original_quals" type="boolean" checked="False" truevalue="--doNotWriteOriginalQuals" falsevalue="" label="Do Not Write Original Quality tag"/>
328 </when>
329 </conditional>
330 </inputs>
331 <outputs>
332 <data format="bam" name="output_bam" label="${tool.name} on ${on_string} (BAM)" />
333 <data format="txt" name="output_log" label="${tool.name} on ${on_string} (log)" />
334 </outputs>
335 <tests>
336 <test>
337 <param name="input_recal" value="gatk/gatk_count_covariates/gatk_count_covariates_out_1.csv" ftype="csv" />
338 <param name="reference_source_selector" value="history" />
339 <param name="ref_file" value="phiX.fasta" ftype="fasta" />
340 <param name="input_bam" value="gatk/gatk_indel_realigner/gatk_indel_realigner_out_1.bam" ftype="bam" />
341 <param name="gatk_param_type_selector" value="basic" />
342 <param name="analysis_param_type_selector" value="basic" />
343 <output name="output_bam" file="gatk/gatk_table_recalibration/gatk_table_recalibration_out_1.bam" ftype="bam" lines_diff="2" />
344 <output name="output_log" file="gatk/gatk_table_recalibration/gatk_table_recalibration_out_1.log.contains" compare="contains" />
345 </test>
346 </tests>
347 <help>
348 **What it does**
349
350 This walker is designed to work as the second pass in a two-pass processing step, doing a by-read traversal. For
351 each base in each read this walker calculates various user-specified covariates (such as read group, reported
352 quality score, cycle, and dinuc) Using these values as a key in a large hashmap the walker calculates an empirical
353 base quality score and overwrites the quality score currently in the read. This walker then outputs a new bam file
354 with these updated (recalibrated) reads. Note: This walker expects as input the recalibration table file generated
355 previously by CovariateCounterWalker. Note: This walker is designed to be used in conjunction with
356 CovariateCounterWalker.
357
358 ------
359
360 Please cite the website "http://addlink.here" as well as:
361
362 Add citation here 2011.
363
364 ------
365
366 **Input formats**
367
368 GenomeAnalysisTK: TableRecalibration accepts an aligned BAM and a recalibration CSV input files.
369
370 ------
371
372 **Outputs**
373
374 The output is in BAM format, see http://addlink.here for more details.
375
376 -------
377
378 **Settings**::
379
380 default_read_group If a read has no read group then default to the provided String.
381 default_platform If a read has no platform then default to the provided String. Valid options are illumina, 454, and solid.
382 force_read_group If provided, the read group ID of EVERY read will be forced to be the provided String. This is useful to collapse all data into a single read group.
383 force_platform If provided, the platform of EVERY read will be forced to be the provided String. Valid options are illumina, 454, and solid.
384 window_size_nqs The window size used by MinimumNQSCovariate for its calculation
385 homopolymer_nback The number of previous bases to look at in HomopolymerCovariate
386 exception_if_no_tile If provided, TileCovariate will throw an exception when no tile can be found. The default behavior is to use tile = -1
387 solid_recal_mode How should we recalibrate solid bases in whichthe reference was inserted? Options = DO_NOTHING, SET_Q_ZERO, SET_Q_ZERO_BASE_N, or REMOVE_REF_BIAS (DO_NOTHING|SET_Q_ZERO|SET_Q_ZERO_BASE_N|REMOVE_REF_BIAS)
388 solid_nocall_strategy Defines the behavior of the recalibrator when it encounters no calls in the color space. Options = THROW_EXCEPTION, LEAVE_READ_UNRECALIBRATED, or PURGE_READ (THROW_EXCEPTION|LEAVE_READ_UNRECALIBRATED|PURGE_READ)
389 recal_file Filename for the input covariates table recalibration .csv file
390 out The output BAM file
391 bam_compression Compression level to use for writing BAM files
392 disable_bam_indexing Turn off on-the-fly creation of indices for output BAM files.
393 simplifyBAM If provided, output BAM files will be simplified to include just key reads for downstream variation discovery analyses (removing duplicates, PF-, non-primary reads), as well stripping all extended tags from the kept reads except the read group identifier
394 preserve_qscores_less_than Bases with quality scores less than this threshold won't be recalibrated, default=5. In general it's unsafe to change qualities scores below &lt; 5, since base callers use these values to indicate random or bad bases
395 smoothing Number of imaginary counts to add to each bin bin order to smooth out bins with few data points, default=1
396 max_quality_score The integer value at which to cap the quality scores, default=50
397 doNotWriteOriginalQuals If true, we will not write the original quality (OQ) tag for each read
398
399 </help>
400 </tool>