|
0
|
1 <tool id="gatk2_base_recalibrator" name="Base Recalibrator" version="0.0.7">
|
|
|
2 <description>on BAM files</description>
|
|
|
3 <expand macro="requirements" />
|
|
|
4 <macros>
|
|
|
5 <import>gatk2_macros.xml</import>
|
|
|
6 </macros>
|
|
1
|
7 <command interpreter="python">
|
|
|
8 gatk2_wrapper.py
|
|
|
9 --stdout "${output_log}"
|
|
|
10 -d "-I" "${reference_source.input_bam}" "${reference_source.input_bam.ext}" "gatk_input"
|
|
|
11 #if str( $reference_source.input_bam.metadata.bam_index ) != "None":
|
|
|
12 -d "" "${reference_source.input_bam.metadata.bam_index}" "bam_index" "gatk_input" ##hardcode galaxy ext type as bam_index
|
|
|
13 #end if
|
|
|
14 -p '
|
|
|
15 @JAR_PATH@
|
|
0
|
16 -T "BaseRecalibrator"
|
|
|
17 \$GATK2_SITE_OPTIONS
|
|
|
18
|
|
|
19 ## according to http://www.broadinstitute.org/gatk/guide/article?id=1975
|
|
|
20 --num_cpu_threads_per_data_thread 8
|
|
|
21
|
|
|
22 @THREADS@
|
|
|
23
|
|
|
24 #if $reference_source.reference_source_selector != "history":
|
|
|
25 -R "${reference_source.ref_file.fields.path}"
|
|
|
26 #end if
|
|
|
27 #if str($input_recal) != 'None':
|
|
|
28 --BQSR "${input_recal}"
|
|
|
29 #end if
|
|
|
30 --out "${output_recal}"
|
|
|
31 ${standard_covs}
|
|
|
32 #if str( $covariates ) != "None":
|
|
|
33 #for $cov in str( $covariates ).split( ',' ):
|
|
|
34 -cov "${cov}"
|
|
|
35 #end for
|
|
|
36 #end if
|
|
|
37 #if $plot_pdf:
|
|
|
38 --plot_pdf_file $output_pdf
|
|
|
39 #end if
|
|
|
40 '
|
|
|
41
|
|
|
42 #set $snp_dataset_provided = False
|
|
|
43 #set $rod_binding_names = dict()
|
|
|
44 #for $rod_binding in $rod_bind:
|
|
|
45 #if str( $rod_binding.rod_bind_type.rod_bind_type_selector ) == 'custom':
|
|
|
46 #set $rod_bind_name = $rod_binding.rod_bind_type.custom_rod_name
|
|
|
47 #else
|
|
|
48 #set $rod_bind_name = $rod_binding.rod_bind_type.rod_bind_type_selector
|
|
|
49 #end if
|
|
|
50 #if str( $rod_binding.rod_bind_type.rod_bind_type_selector ) == 'dbsnp':
|
|
|
51 #set $snp_dataset_provided = True
|
|
|
52 #end if
|
|
|
53 #set $rod_binding_names[$rod_bind_name] = $rod_binding_names.get( $rod_bind_name, -1 ) + 1
|
|
|
54 -d "--knownSites:${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]}"
|
|
|
55 #end for
|
|
|
56
|
|
|
57 #include source=$standard_gatk_options#
|
|
|
58
|
|
|
59 ##start analysis specific options
|
|
|
60 #if $analysis_param_type.analysis_param_type_selector == "advanced":
|
|
|
61 -p '
|
|
|
62 #if $analysis_param_type.default_read_group_type.default_read_group_type_selector == "set":
|
|
|
63 --default_read_group "${analysis_param_type.default_read_group_type.default_read_group}"
|
|
|
64 #end if
|
|
|
65 #if str( $analysis_param_type.default_platform ) != "default":
|
|
|
66 --default_platform "${analysis_param_type.default_platform}"
|
|
|
67 #end if
|
|
|
68 #if str( $analysis_param_type.force_read_group_type.force_read_group_type_selector ) == "set":
|
|
|
69 --force_read_group "${analysis_param_type.force_read_group_type.force_read_group}"
|
|
|
70 #end if
|
|
|
71 #if str( $analysis_param_type.force_platform ) != "default":
|
|
|
72 --force_platform "${analysis_param_type.force_platform}"
|
|
|
73 #end if
|
|
|
74 ${analysis_param_type.exception_if_no_tile}
|
|
|
75 #if str( $analysis_param_type.solid_options_type.solid_options_type_selector ) == "set":
|
|
|
76 #if str( $analysis_param_type.solid_options_type.solid_recal_mode ) != "default":
|
|
|
77 --solid_recal_mode "${analysis_param_type.solid_options_type.solid_recal_mode}"
|
|
|
78 #end if
|
|
|
79 #if str( $analysis_param_type.solid_options_type.solid_nocall_strategy ) != "default":
|
|
|
80 --solid_nocall_strategy "${analysis_param_type.solid_options_type.solid_nocall_strategy}"
|
|
|
81 #end if
|
|
|
82 #end if
|
|
|
83 --window_size_nqs "${analysis_param_type.window_size_nqs}"
|
|
|
84 --homopolymer_nback "${analysis_param_type.homopolymer_nback}"
|
|
|
85 '
|
|
|
86 #end if
|
|
|
87 #if not $snp_dataset_provided:
|
|
|
88 -p '--run_without_dbsnp_potentially_ruining_quality'
|
|
|
89 #end if
|
|
|
90 </command>
|
|
|
91 <inputs>
|
|
|
92 <conditional name="reference_source">
|
|
|
93 <expand macro="reference_source_selector_param" />
|
|
|
94 <when value="cached">
|
|
|
95 <param name="input_bam" type="data" format="bam" label="BAM file" help="-I,--input_file &lt;input_file&gt;">
|
|
|
96 <validator type="unspecified_build" />
|
|
|
97 <validator type="dataset_metadata_in_data_table" table_name="gatk2_picard_indexes" metadata_name="dbkey" metadata_column="dbkey" message="Sequences are not currently available for the specified build." /> <!-- fixme!!! this needs to be a select -->
|
|
|
98 </param>
|
|
|
99 <param name="ref_file" type="select" label="Using reference genome" help="-R,--reference_sequence &lt;reference_sequence&gt;" >
|
|
|
100 <options from_data_table="gatk2_picard_indexes">
|
|
|
101 <filter type="data_meta" key="dbkey" ref="input_bam" column="dbkey"/>
|
|
|
102 </options>
|
|
|
103 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
|
|
|
104 </param>
|
|
|
105 </when>
|
|
|
106 <when value="history">
|
|
|
107 <param name="input_bam" type="data" format="bam" label="BAM file" help="-I,--input_file &lt;input_file&gt;" />
|
|
|
108 <param name="ref_file" type="data" format="fasta" label="Using reference file" help="-R,--reference_sequence &lt;reference_sequence&gt;">
|
|
|
109 <options>
|
|
|
110 <filter type="data_meta" key="dbkey" ref="input_bam" />
|
|
|
111 </options>
|
|
|
112 </param>
|
|
|
113 </when>
|
|
|
114 </conditional>
|
|
|
115 <param name="input_recal" type="data" format="gatk_report" optional="true" label="Covariates table recalibration file" help="-BQSR,--BQSR &lt;recal_file&gt;" >
|
|
|
116 <help>The input covariates table file which enables on-the-fly base quality score recalibration.
|
|
|
117 Enables on-the-fly recalibrate of base qualities. The covariates tables are produced by the BaseQualityScoreRecalibrator tool.
|
|
|
118 Please be aware that one should only run recalibration with the covariates file created on the same input bam(s).
|
|
|
119 </help>
|
|
|
120 </param>
|
|
|
121 <param name="standard_covs" type="boolean" truevalue="" falsevalue="--no_standard_covs" checked="false" label="Do not use the standard set of covariates in addition to the ones selected" help="--no_standard_covs/-noStandard" />
|
|
|
122 <param name="covariates" type="select" multiple="True" display="checkboxes" label="Covariates to be used in the recalibration" help="-cov,--covariate &lt;covariate&gt;" >
|
|
|
123 <!-- might we want to load the available covariates from an external configuration file, since additional ones can be added to local installs? -->
|
|
|
124 <option value="ReadGroupCovariate" />
|
|
|
125 <option value="QualityScoreCovariate" />
|
|
|
126 <option value="CycleCovariate" />
|
|
|
127 <option value="ContextCovariate" />
|
|
|
128 <!-- covariates below were pulled from list option -->
|
|
|
129 <option value="HomopolymerCovariate" />
|
|
|
130 <option value="GCContentCovariate" />
|
|
|
131 <option value="MappingQualityCovariate" />
|
|
|
132 <option value="MinimumNQSCovariate" />
|
|
|
133 <option value="PositionCovariate" />
|
|
|
134 <option value="PrimerRoundCovariate" />
|
|
|
135 <option value="TileCovariate" />
|
|
|
136 </param>
|
|
|
137
|
|
|
138 <repeat name="rod_bind" title="Binding for reference-ordered data" help="-knownSites,--knownSites &lt;knownSites&gt;">
|
|
|
139 <conditional name="rod_bind_type">
|
|
|
140 <param name="rod_bind_type_selector" type="select" label="Binding Type">
|
|
|
141 <option value="dbsnp" selected="True">dbSNP</option>
|
|
|
142 <option value="snps">SNPs</option>
|
|
|
143 <option value="indels">INDELs</option>
|
|
|
144 <option value="mask">Mask</option>
|
|
|
145 <option value="custom">Custom</option>
|
|
|
146 </param>
|
|
|
147 <when value="dbsnp">
|
|
|
148 <param name="input_rod" type="data" format="vcf,gatk_dbsnp,bed" label="ROD file" />
|
|
|
149 </when>
|
|
|
150 <when value="snps">
|
|
|
151 <param name="input_rod" type="data" format="vcf,gatk_dbsnp,bed" label="ROD file" />
|
|
|
152 </when>
|
|
|
153 <when value="indels">
|
|
|
154 <param name="input_rod" type="data" format="vcf,gatk_dbsnp,bed" label="ROD file" />
|
|
|
155 </when>
|
|
|
156 <when value="mask">
|
|
|
157 <param name="input_rod" type="data" format="vcf,gatk_dbsnp,bed" label="ROD file" />
|
|
|
158 </when>
|
|
|
159 <when value="custom">
|
|
|
160 <param name="custom_rod_name" type="text" value="Unknown" label="ROD Name"/>
|
|
|
161 <param name="input_rod" type="data" format="vcf,gatk_dbsnp,bed" label="ROD file" />
|
|
|
162 </when>
|
|
|
163 </conditional>
|
|
|
164 </repeat>
|
|
|
165 <param name="plot_pdf" type="boolean" truevalue="--plot_pdf_file" falsevalue="" checked="False" label="Output recalibration plots pdf"/>
|
|
|
166 <expand macro="gatk_param_type_conditional" />
|
|
|
167
|
|
|
168 <conditional name="analysis_param_type">
|
|
|
169 <param name="analysis_param_type_selector" type="select" label="Basic or Advanced Analysis options">
|
|
|
170 <option value="basic" selected="True">Basic</option>
|
|
|
171 <option value="advanced">Advanced</option>
|
|
|
172 </param>
|
|
|
173 <when value="basic">
|
|
|
174 <!-- Do nothing here -->
|
|
|
175 </when>
|
|
|
176 <when value="advanced">
|
|
|
177 <conditional name="default_read_group_type">
|
|
|
178 <param name="default_read_group_type_selector" type="select" label="Set default Read Group" help="--default_read_group">
|
|
|
179 <option value="default" selected="True">Don't Set</option>
|
|
|
180 <option value="set">Set</option>
|
|
|
181 </param>
|
|
|
182 <when value="default">
|
|
|
183 <!-- do nothing here -->
|
|
|
184 </when>
|
|
|
185 <when value="set">
|
|
|
186 <param name="default_read_group" type="text" value="Unknown" label="If a read has no read group then default to the provided String"/>
|
|
|
187 </when>
|
|
|
188 </conditional>
|
|
|
189 <param name="default_platform" type="select" label="Set default Platform" help="--default_platform">
|
|
|
190 <option value="default" selected="True">Don't Set</option>
|
|
|
191 <option value="illumina">illumina</option>
|
|
|
192 <option value="454">454</option>
|
|
|
193 <option value="solid">solid</option>
|
|
|
194 </param>
|
|
|
195 <conditional name="force_read_group_type">
|
|
|
196 <param name="force_read_group_type_selector" type="select" label="Force Read Group" help="--force_read_group">
|
|
|
197 <option value="default" selected="True">Don't Force</option>
|
|
|
198 <option value="set">Force</option>
|
|
|
199 </param>
|
|
|
200 <when value="default">
|
|
|
201 <!-- do nothing here -->
|
|
|
202 </when>
|
|
|
203 <when value="set">
|
|
|
204 <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."/>
|
|
|
205 </when>
|
|
|
206 </conditional>
|
|
|
207 <param name="force_platform" type="select" label="Force Platform" help="--force_platform">
|
|
|
208 <option value="default" selected="True">Don't Force</option>
|
|
|
209 <option value="illumina">illumina</option>
|
|
|
210 <option value="454">454</option>
|
|
|
211 <option value="solid">solid</option>
|
|
|
212 </param>
|
|
|
213 <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" help="--exception_if_no_tile"/>
|
|
|
214 <conditional name="solid_options_type">
|
|
|
215 <param name="solid_options_type_selector" type="select" label="Set SOLiD specific options">
|
|
|
216 <option value="default" selected="True">Don't Set</option>
|
|
|
217 <option value="set">Set</option>
|
|
|
218 </param>
|
|
|
219 <when value="default">
|
|
|
220 <!-- do nothing here -->
|
|
|
221 </when>
|
|
|
222 <when value="set">
|
|
|
223 <param name="solid_recal_mode" type="select" label="How should we recalibrate solid bases in which the reference was inserted" help="-sMode,--solid_recal_mode &lt;solid_recal_mode&gt;">
|
|
|
224 <option value="default" selected="True">Don't set</option>
|
|
|
225 <option value="DO_NOTHING">DO_NOTHING</option>
|
|
|
226 <option value="SET_Q_ZERO">SET_Q_ZERO</option>
|
|
|
227 <option value="SET_Q_ZERO_BASE_N">SET_Q_ZERO_BASE_N</option>
|
|
|
228 <option value="REMOVE_REF_BIAS">REMOVE_REF_BIAS</option>
|
|
|
229 </param>
|
|
|
230 <param name="solid_nocall_strategy" type="select" label="Behavior of the recalibrator when it encounters no calls" help="-solid_nocall_strategy,--solid_nocall_strategy &lt;solid_nocall_strategy&gt;">
|
|
|
231 <option value="default" selected="True">Don't set</option>
|
|
|
232 <option value="THROW_EXCEPTION">THROW_EXCEPTION</option>
|
|
|
233 <option value="LEAVE_READ_UNRECALIBRATED">LEAVE_READ_UNRECALIBRATED</option>
|
|
|
234 <option value="PURGE_READ">PURGE_READ</option>
|
|
|
235 </param>
|
|
|
236 </when>
|
|
|
237 </conditional>
|
|
|
238 <param name="window_size_nqs" type="integer" value="5" label="Window size used by MinimumNQSCovariate" help="window_size_nqs"/>
|
|
|
239 <param name="homopolymer_nback" type="integer" value="7" label="number of previous bases to look at in HomopolymerCovariate" help="-nback,--homopolymer_nback &lt;homopolymer_nback&gt;" />
|
|
|
240 </when>
|
|
|
241 </conditional>
|
|
|
242 </inputs>
|
|
|
243 <outputs>
|
|
|
244 <data format="gatk_report" name="output_recal" label="${tool.name} on ${on_string} (Covariate File)" />
|
|
|
245 <data format="txt" name="output_log" label="${tool.name} on ${on_string} (log)" />
|
|
|
246 <data format="pdf" name="output_pdf" label="${tool.name} on ${on_string} (plot_pdf_file)">
|
|
|
247 <filter>plot_pdf == True</filter>
|
|
|
248 </data>
|
|
|
249 </outputs>
|
|
|
250 <tests>
|
|
|
251 <test>
|
|
|
252 <param name="reference_source_selector" value="history" />
|
|
|
253 <param name="ref_file" value="phiX.fasta" ftype="fasta" />
|
|
|
254 <param name="input_bam" value="gatk/gatk_indel_realigner/gatk_indel_realigner_out_1.bam" ftype="bam" />
|
|
|
255 <param name="rod_bind_type_selector" value="dbsnp" />
|
|
|
256 <param name="input_rod" value="gatk/fake_phiX_variant_locations.bed" ftype="bed" />
|
|
|
257 <param name="standard_covs" value="True" />
|
|
|
258 <param name="covariates" value="ReadGroupCovariate,HomopolymerCovariate,MinimumNQSCovariate,PositionCovariate" />
|
|
|
259 <param name="gatk_param_type_selector" value="basic" />
|
|
|
260 <param name="analysis_param_type_selector" value="basic" />
|
|
|
261 <output name="output_recal" file="gatk/gatk_count_covariates/gatk_count_covariates_out_1.csv" />
|
|
|
262 <output name="output_log" file="gatk/gatk_count_covariates/gatk_count_covariates_out_1.log.contains" compare="contains" />
|
|
|
263 </test>
|
|
|
264 </tests>
|
|
|
265 <help>
|
|
|
266 .. class:: warningmark
|
|
|
267
|
|
|
268 "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."
|
|
|
269 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.
|
|
|
270
|
|
|
271 **What it does**
|
|
|
272
|
|
|
273 This walker is designed to work as the first pass in a two-pass processing step. It does a by-locus traversal operating only at sites that are not in dbSNP. We assume that all reference mismatches we see are therefore errors and indicative of poor base quality. This walker generates tables based on various user-specified covariates (such as read group, reported quality score, cycle, and dinucleotide) Since there is a large amount of data one can then calculate an empirical probability of error given the particular covariates seen at this site, where p(error) = num mismatches / num observations The output file is a CSV list of (the several covariate values, num observations, num mismatches, empirical quality score) The first non-comment line of the output file gives the name of the covariates that were used for this calculation. Note: ReadGroupCovariate and QualityScoreCovariate are required covariates and will be added for the user regardless of whether or not they were specified Note: This walker is designed to be used in conjunction with TableRecalibrationWalker.
|
|
|
274
|
|
|
275 For more information on base quality score recalibration using the GATK, see this `tool specific page <http://www.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_sting_gatk_walkers_bqsr_BaseRecalibrator.html>`_.
|
|
|
276
|
|
|
277 To learn about best practices for variant detection using GATK, see this `overview <http://www.broadinstitute.org/gatk/guide/topic?name=best-practices>`_.
|
|
|
278
|
|
|
279 If you encounter errors, please view the `GATK FAQ <http://www.broadinstitute.org/gatk/guide/topic?name=faqs>`_.
|
|
|
280
|
|
|
281 ------
|
|
|
282
|
|
|
283 **Inputs**
|
|
|
284
|
|
|
285 GenomeAnalysisTK: BaseRecalibrator accepts an aligned BAM input file.
|
|
|
286
|
|
|
287
|
|
|
288 **Outputs**
|
|
|
289
|
|
|
290 The output is in CSV format.
|
|
|
291
|
|
|
292
|
|
|
293 Go `here <http://www.broadinstitute.org/gatk/guide/topic?name=intro>`_ for details on GATK file formats.
|
|
|
294
|
|
|
295 -------
|
|
|
296
|
|
|
297 **Settings**::
|
|
|
298
|
|
|
299
|
|
|
300 default_read_group If a read has no read group then default to the provided String.
|
|
|
301 default_platform If a read has no platform then default to the provided String. Valid options are illumina, 454, and solid.
|
|
|
302 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.
|
|
|
303 force_platform If provided, the platform of EVERY read will be forced to be the provided String. Valid options are illumina, 454, and solid.
|
|
|
304 window_size_nqs The window size used by MinimumNQSCovariate for its calculation
|
|
|
305 homopolymer_nback The number of previous bases to look at in HomopolymerCovariate
|
|
|
306 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
|
|
|
307 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)
|
|
|
308 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)
|
|
|
309 recal_file Filename for the input covariates table recalibration .csv file
|
|
|
310 out The output CSV file
|
|
|
311 standard_covs Use the standard set of covariates in addition to the ones listed using the -cov argument
|
|
|
312 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.
|
|
|
313
|
|
|
314 @CITATION_SECTION@
|
|
|
315 </help>
|
|
|
316 </tool>
|