comparison tools/gatk/count_covariates.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_count_covariates" name="Count Covariates" 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 "CountCovariates"
10 --num_threads 4 ##hard coded, for now
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 "${output_recal}"
17 ${standard_covs}
18 #if $covariates.value:
19 #for $cov in $covariates.value:
20 -cov "${cov}"
21 #end for
22 #end if
23 '
24
25 #set $snp_dataset_provided = False
26 #if str( $input_dbsnp_rod ) != "None":
27 -d "-D" "${input_dbsnp_rod}" "${input_dbsnp_rod.ext}" "dbsnp_rod"
28 #set $snp_dataset_provided = True
29 #end if
30 #set $rod_binding_names = dict()
31 #for $rod_binding in $rod_bind:
32 #if str( $rod_binding.rod_bind_type.rod_bind_type_selector ) == 'custom':
33 #set $rod_bind_name = $rod_binding.rod_bind_type.custom_rod_name
34 #else
35 #set $rod_bind_name = $rod_binding.rod_bind_type.rod_bind_type_selector
36 #end if
37 #if str( $rod_binding.rod_bind_type.rod_bind_type_selector ) == 'snps':
38 #set $snp_dataset_provided = True
39 #end if
40 #set $rod_binding_names[$rod_bind_name] = $rod_binding_names.get( $rod_bind_name, -1 ) + 1
41 -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]}"
42 #if str( $rod_binding.rod_bind_type.rodToIntervalTrackName ):
43 -p '--rodToIntervalTrackName "${rod_bind_name}"'
44 #end if
45 #end for
46
47 ##start standard gatk options
48 #if $gatk_param_type.gatk_param_type_selector == "advanced":
49 #for $sample_metadata in $gatk_param_type.sample_metadata:
50 -p '--sample_metadata "${sample_metadata.sample_metadata_file}"'
51 #end for
52 #for $read_filter in $gatk_param_type.read_filter:
53 -p '--read_filter "${read_filter.read_filter_type.read_filter_type_selector}"
54 ###raise Exception( str( dir( $read_filter ) ) )
55 #for $name, $param in $read_filter.read_filter_type.iteritems():
56 #if $name not in [ "__current_case__", "read_filter_type_selector" ]:
57 --${name} "${param}"
58 #end if
59 #end for
60 '
61 #end for
62 #if str( $gatk_param_type.input_intervals ) != "None":
63 -d "-L" "${gatk_param_type.input_intervals}" "${gatk_param_type.input_intervals.ext}" "input_intervals"
64 #end if
65 #if str( $gatk_param_type.input_exclude_intervals ) != "None":
66 -d "-XL" "${gatk_param_type.input_exclude_intervals}" "${gatk_param_type.input_exclude_intervals.ext}" "input_intervals"
67 #end if
68
69 -p '--BTI_merge_rule "${gatk_param_type.BTI_merge_rule}"'
70 -p '--downsampling_type "${gatk_param_type.downsampling_type.downsampling_type_selector}"'
71 #if str( $gatk_param_type.downsampling_type.downsampling_type_selector ) != "NONE":
72 -p '--${gatk_param_type.downsampling_type.downsample_to_type.downsample_to_type_selector} "${gatk_param_type.downsampling_type.downsample_to_type.downsample_to_value}"'
73 #end if
74 -p '
75 --baq "${gatk_param_type.baq}"
76 --baqGapOpenPenalty "${gatk_param_type.baq_gap_open_penalty}"
77 ${gatk_param_type.use_original_qualities}
78 --defaultBaseQualities "${gatk_param_type.default_base_qualities}"
79 --validation_strictness "${gatk_param_type.validation_strictness}"
80 --interval_merging "${gatk_param_type.interval_merging}"
81 '
82 #if str( $gatk_param_type.read_group_black_list ) != "None":
83 -d "-read_group_black_list" "${gatk_param_type.read_group_black_list}" "txt" "input_read_group_black_list"
84 #end if
85 #end if
86 #if str( $reference_source.reference_source_selector ) == "history":
87 -d "-R" "${reference_source.ref_file}" "${reference_source.ref_file.ext}" "gatk_input"
88 #end if
89 ##end standard gatk options
90
91 ##start analysis specific options
92 #if $analysis_param_type.analysis_param_type_selector == "advanced":
93 -p '
94 #if $analysis_param_type.default_read_group_type.default_read_group_type_selector == "set":
95 --default_read_group "${analysis_param_type.default_read_group_type.default_read_group}"
96 #end if
97 #if str( $analysis_param_type.default_platform ) != "default":
98 --default_platform "${analysis_param_type.default_platform}"
99 #end if
100 #if str( $analysis_param_type.force_read_group_type.force_read_group_type_selector ) == "set":
101 --force_read_group "${analysis_param_type.force_read_group_type.force_read_group}"
102 #end if
103 #if str( $analysis_param_type.force_platform ) != "default":
104 --force_platform "${analysis_param_type.force_platform}"
105 #end if
106 ${analysis_param_type.exception_if_no_tile}
107 #if str( $analysis_param_type.solid_options_type.solid_options_type_selector ) == "set":
108 #if str( $analysis_param_type.solid_options_type.solid_recal_mode ) != "default":
109 --solid_recal_mode "${analysis_param_type.solid_options_type.solid_recal_mode}"
110 #end if
111 #if str( $analysis_param_type.solid_options_type.solid_nocall_strategy ) != "default":
112 --solid_nocall_strategy "${analysis_param_type.solid_options_type.solid_nocall_strategy}"
113 #end if
114 #end if
115 --window_size_nqs "${analysis_param_type.window_size_nqs}"
116 --homopolymer_nback "${analysis_param_type.homopolymer_nback}"
117 '
118 #end if
119 #if not $snp_dataset_provided:
120 -p '--run_without_dbsnp_potentially_ruining_quality'
121 #end if
122 </command>
123 <inputs>
124 <conditional name="reference_source">
125 <param name="reference_source_selector" type="select" label="Choose the source for the reference list">
126 <option value="cached">Locally cached</option>
127 <option value="history">History</option>
128 </param>
129 <when value="cached">
130 <param name="input_bam" type="data" format="bam" label="BAM file">
131 <validator type="unspecified_build" />
132 <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 -->
133 </param>
134 <param name="ref_file" type="select" label="Using reference genome">
135 <options from_data_table="picard_indexes">
136 <filter type="data_meta" key="dbkey" ref="input_bam" column="dbkey"/>
137 </options>
138 </param>
139 </when>
140 <when value="history"> <!-- FIX ME!!!! -->
141 <param name="input_bam" type="data" format="bam" label="BAM file" />
142 <param name="ref_file" type="data" format="fasta" label="Using reference file" />
143 </when>
144 </conditional>
145 <param name="standard_covs" type="boolean" truevalue="--standard_covs" falsevalue="" label="Use the standard set of covariates in addition to the ones selected" />
146 <param name="covariates" type="select" multiple="True" display="checkboxes" label="Covariates to be used in the recalibration" >
147 <!-- might we want to load the available covariates from an external configuration file, since additional ones can be added to local installs? -->
148 <option value="ReadGroupCovariate" />
149 <option value="QualityScoreCovariate" />
150 <option value="CycleCovariate" />
151 <option value="DinucCovariate" />
152 <!-- covariates below were pull from source code, since the list option doesn't seem to work (when tried) -->
153 <option value="HomopolymerCovariate" />
154 <option value="MappingQualityCovariate" />
155 <option value="MinimumNQSCovariate" />
156 <option value="PositionCovariate" />
157 <option value="PrimerRoundCovariate" />
158 <option value="TileCovariate" />
159 </param>
160 <param name="input_dbsnp_rod" type="data" format="gatk_dbsnp" optional="True" label="dbSNP reference ordered data (ROD)" />
161 <repeat name="rod_bind" title="Binding for reference-ordered data">
162 <conditional name="rod_bind_type">
163 <param name="rod_bind_type_selector" type="select" label="Binding Type">
164 <option value="snps" selected="True">SNPs</option>
165 <option value="indels">INDELs</option>
166 <option value="mask">Mask</option>
167 <option value="custom">Custom</option>
168 </param>
169 <when value="snps">
170 <param name="input_rod" type="data" format="vcf,gatk_dbsnp,bed" label="ROD file" />
171 <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" />
172 </when>
173 <when value="indels">
174 <param name="input_rod" type="data" format="vcf,gatk_dbsnp,bed" label="ROD file" />
175 <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" />
176 </when>
177 <when value="custom">
178 <param name="custom_rod_name" type="text" value="Unknown" label="ROD Name"/>
179 <param name="input_rod" type="data" format="vcf,gatk_dbsnp,bed" label="ROD file" />
180 <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" />
181 </when>
182 </conditional>
183 </repeat>
184
185 <conditional name="gatk_param_type">
186 <param name="gatk_param_type_selector" type="select" label="Basic or Advanced GATK options">
187 <option value="basic" selected="True">Basic</option>
188 <option value="advanced">Advanced</option>
189 </param>
190 <when value="basic">
191 <!-- Do nothing here -->
192 </when>
193 <when value="advanced">
194 <repeat name="sample_metadata" title="Sample Metadata">
195 <param name="sample_metadata_file" type="data" format="txt" label="Sample file(s) in JSON format" />
196 </repeat>
197 <repeat name="read_filter" title="Read Filter">
198 <conditional name="read_filter_type">
199 <param name="read_filter_type_selector" type="select" label="Read Filter Type">
200 <option value="MaxReadLength" selected="True">MaxReadLength</option>
201 <option value="ZeroMappingQualityRead">ZeroMappingQualityRead</option>
202 </param>
203 <when value="ZeroMappingQualityRead">
204 <!-- no extra options -->
205 </when>
206 <when value="MaxReadLength">
207 <param name="maxReadLength" type="integer" value="76" label="Max Read Length"/>
208 </when>
209 </conditional>
210 </repeat>
211 <param name="input_intervals" type="data" format="picard_interval_list" optional="True" label="A list of genomic intervals over which to operate" />
212 <param name="input_exclude_intervals" type="data" format="picard_interval_list" optional="True" label="A list of genomic intervals to exclude from processing" />
213 <param name="BTI_merge_rule" type="select" label="BTI merge rule">
214 <option value="UNION" selected="True">UNION</option>
215 <option value="INTERSECTION">INTERSECTION</option>
216 </param>
217 <conditional name="downsampling_type">
218 <param name="downsampling_type_selector" type="select" label="Type of reads downsampling to employ at a given locus" help="Downsampling Type">
219 <option value="NONE" selected="True">NONE</option>
220 <option value="ALL_READS">ALL_READS</option>
221 <option value="BY_SAMPLE">BY_SAMPLE</option>
222 </param>
223 <when value="NONE">
224 <!-- no more options here -->
225 </when>
226 <when value="ALL_READS">
227 <conditional name="downsample_to_type">
228 <param name="downsample_to_type_selector" type="select" label="Type of reads downsampling to employ at a given locus" help="Downsampling Type">
229 <option value="downsample_to_fraction" selected="True">Downsample by Fraction</option>
230 <option value="downsample_to_coverage">Downsample by Coverage</option>
231 </param>
232 <when value="downsample_to_fraction">
233 <param name="downsample_to_value" type="float" label="Fraction [0.0-1.0] of reads to downsample to" value="0.1"/>
234 </when>
235 <when value="downsample_to_coverage">
236 <param name="downsample_to_value" type="integer" label="Coverage to downsample to at any given locus" value="0"/>
237 </when>
238 </conditional>
239 </when>
240 <when value="BY_SAMPLE">
241 <conditional name="downsample_to_type">
242 <param name="downsample_to_type_selector" type="select" label="Type of reads downsampling to employ at a given locus" help="Downsampling Type">
243 <option value="downsample_to_fraction" selected="True">Downsample by Fraction</option>
244 <option value="downsample_to_coverage">Downsample by Coverage</option>
245 </param>
246 <when value="downsample_to_fraction">
247 <param name="downsample_to_value" type="float" label="Fraction [0.0-1.0] of reads to downsample to" value="0.1"/>
248 </when>
249 <when value="downsample_to_coverage">
250 <param name="downsample_to_value" type="integer" label="Coverage to downsample to at any given locus" value="0"/>
251 </when>
252 </conditional>
253 </when>
254 </conditional>
255 <param name="baq" type="select" label="Type of BAQ calculation to apply in the engine">
256 <option value="OFF" selected="True">OFF</option>
257 <option value="CALCULATE_AS_NECESSARY">CALCULATE_AS_NECESSARY</option>
258 <option value="RECALCULATE">RECALCULATE</option>
259 </param>
260 <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."/>
261 <param name="use_original_qualities" type="boolean" truevalue="--useOriginalQualities" falsevalue="" label="Use the original base quality scores from the OQ tag" />
262 <param name="default_base_qualities" type="integer" label="Value to be used for all base quality scores, when some are missing" value="-1"/>
263 <param name="validation_strictness" type="select" label="How strict should we be with validation">
264 <option value="STRICT" selected="True">STRICT</option>
265 <option value="LENIENT">LENIENT</option>
266 <option value="SILENT">SILENT</option>
267 </param>
268 <param name="interval_merging" type="select" label="Interval merging rule">
269 <option value="ALL" selected="True">ALL</option>
270 <option value="OVERLAPPING_ONLY">OVERLAPPING_ONLY</option>
271 </param>
272 <param name="read_group_black_list" type="data" format="txt" optional="True" label="Read group black list" />
273 </when>
274 </conditional>
275
276 <conditional name="analysis_param_type">
277 <param name="analysis_param_type_selector" type="select" label="Basic or Advanced Analysis options">
278 <option value="basic" selected="True">Basic</option>
279 <option value="advanced">Advanced</option>
280 </param>
281 <when value="basic">
282 <!-- Do nothing here -->
283 </when>
284 <when value="advanced">
285 <conditional name="default_read_group_type">
286 <param name="default_read_group_type_selector" type="select" label="Set default Read Group">
287 <option value="default" selected="True">Don't Set</option>
288 <option value="set">Set</option>
289 </param>
290 <when value="default">
291 <!-- do nothing here -->
292 </when>
293 <when value="set">
294 <param name="default_read_group" type="text" value="Unknown" label="If a read has no read group then default to the provided String"/>
295 </when>
296 </conditional>
297 <param name="default_platform" type="select" label="Set default Platform">
298 <option value="default" selected="True">Don't Set</option>
299 <option value="illumina">illumina</option>
300 <option value="454">454</option>
301 <option value="solid">solid</option>
302 </param>
303 <conditional name="force_read_group_type">
304 <param name="force_read_group_type_selector" type="select" label="Force Read Group">
305 <option value="default" selected="True">Don't Force</option>
306 <option value="set">Force</option>
307 </param>
308 <when value="default">
309 <!-- do nothing here -->
310 </when>
311 <when value="set">
312 <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."/>
313 </when>
314 </conditional>
315 <param name="force_platform" type="select" label="Force Platform">
316 <option value="default" selected="True">Don't Force</option>
317 <option value="illumina">illumina</option>
318 <option value="454">454</option>
319 <option value="solid">solid</option>
320 </param>
321 <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"/>
322 <conditional name="solid_options_type">
323 <param name="solid_options_type_selector" type="select" label="Set SOLiD specific options">
324 <option value="default" selected="True">Don't Set</option>
325 <option value="set">Set</option>
326 </param>
327 <when value="default">
328 <!-- do nothing here -->
329 </when>
330 <when value="set">
331 <param name="solid_recal_mode" type="select" label="How should we recalibrate solid bases in which the reference was inserted">
332 <option value="default" selected="True">Don't set</option>
333 <option value="DO_NOTHING">DO_NOTHING</option>
334 <option value="SET_Q_ZERO">SET_Q_ZERO</option>
335 <option value="SET_Q_ZERO_BASE_N">SET_Q_ZERO_BASE_N</option>
336 <option value="REMOVE_REF_BIAS">REMOVE_REF_BIAS</option>
337 </param>
338 <param name="solid_nocall_strategy" type="select" label="Behavior of the recalibrator when it encounters no calls">
339 <option value="default" selected="True">Don't set</option>
340 <option value="THROW_EXCEPTION">THROW_EXCEPTION</option>
341 <option value="LEAVE_READ_UNRECALIBRATED">LEAVE_READ_UNRECALIBRATED</option>
342 <option value="PURGE_READ">PURGE_READ</option>
343 </param>
344 </when>
345 </conditional>
346 <param name="window_size_nqs" type="integer" value="5" label="Window size used by MinimumNQSCovariate"/>
347 <param name="homopolymer_nback" type="integer" value="7" label="number of previous bases to look at in HomopolymerCovariate" />
348 </when>
349 </conditional>
350 </inputs>
351 <outputs>
352 <data format="csv" name="output_recal" label="${tool.name} on ${on_string} (Covariate File)" />
353 <data format="txt" name="output_log" label="${tool.name} on ${on_string} (log)" />
354 </outputs>
355 <tests>
356 <test>
357 <param name="reference_source_selector" value="history" />
358 <param name="ref_file" value="phiX.fasta" ftype="fasta" />
359 <param name="input_bam" value="gatk/gatk_indel_realigner/gatk_indel_realigner_out_1.bam" ftype="bam" />
360 <param name="input_dbsnp_rod" />
361 <param name="rod_bind_type_selector" value="snps" />
362 <param name="rodToIntervalTrackName" />
363 <param name="input_rod" value="gatk/fake_phiX_variant_locations.bed" ftype="bed" />
364 <param name="standard_covs" value="True" />
365 <param name="covariates" value="ReadGroupCovariate,HomopolymerCovariate,MinimumNQSCovariate,PositionCovariate" />
366 <param name="gatk_param_type_selector" value="basic" />
367 <param name="analysis_param_type_selector" value="basic" />
368 <output name="output_recal" file="gatk/gatk_count_covariates/gatk_count_covariates_out_1.csv" />
369 <output name="output_log" file="gatk/gatk_count_covariates/gatk_count_covariates_out_1.log.contains" compare="contains" />
370 </test>
371 </tests>
372 <help>
373 .. class:: warningmark
374
375 "This calculation is critically dependent on being able to skip over known variant sites. Please provide a dbSNP ROD or a VCF file containing known sites of genetic variation."
376 However, if you do not provide this file, the '--run_without_dbsnp_potentially_ruining_quality' flag will be automatically used, and the command will be allowed to run.
377
378 **What it does**
379
380 This walker is designed to work as the first pass in a two-pass processing step. It does a by-locus traversal
381 operating only at sites that are not in dbSNP. We assume that all reference mismatches we see are therefore errors
382 and indicative of poor base quality. This walker generates tables based on various user-specified covariates (such
383 as read group, reported quality score, cycle, and dinucleotide) Since there is a large amount of data one can then
384 calculate an empirical probability of error given the particular covariates seen at this site, where p(error) = num
385 mismatches / num observations The output file is a CSV list of (the several covariate values, num observations, num
386 mismatches, empirical quality score) The first non-comment line of the output file gives the name of the covariates
387 that were used for this calculation. Note: ReadGroupCovariate and QualityScoreCovariate are required covariates
388 and will be added for the user regardless of whether or not they were specified Note: This walker is designed to be
389 used in conjunction with TableRecalibrationWalker.
390
391
392 ------
393
394 Please cite the website "http://addlink.here" as well as:
395
396 Add citation here 2011.
397
398 ------
399
400 **Input formats**
401
402 GenomeAnalysisTK: CountCovariates accepts an aligned BAM input file.
403
404 ------
405
406 **Outputs**
407
408 The output is in CSV format, see http://addlink.here for more details.
409
410 -------
411
412 **Settings**::
413
414
415 default_read_group If a read has no read group then default to the provided String.
416 default_platform If a read has no platform then default to the provided String. Valid options are illumina, 454, and solid.
417 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.
418 force_platform If provided, the platform of EVERY read will be forced to be the provided String. Valid options are illumina, 454, and solid.
419 window_size_nqs The window size used by MinimumNQSCovariate for its calculation
420 homopolymer_nback The number of previous bases to look at in HomopolymerCovariate
421 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
422 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)
423 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)
424 recal_file Filename for the input covariates table recalibration .csv file
425 out The output CSV file
426 recal_file Filename for the outputted covariates table recalibration file
427 standard_covs Use the standard set of covariates in addition to the ones listed using the -cov argument
428 run_without_dbsnp_potentially_ruining_quality If specified, allows the recalibrator to be used without a dbsnp rod. Very unsafe and for expert users only.
429
430 </help>
431 </tool>