comparison freebayes4workflow.xml @ 0:874dd6c0fcde draft default tip

Uploaded
author urgi-team
date Tue, 10 Nov 2015 08:51:31 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:874dd6c0fcde
1 <?xml version="1.0"?>
2 <tool id="freebayes4workflow" name="Freebayes4Workflow" version="0.5">
3 <requirements>
4 <requirement type="package" version="1.0">freebayes</requirement>
5 <requirement type="package" version="0.1.19">samtools</requirement>
6 </requirements>
7 <description> - bayesian genetic variant detector</description>
8 <command>
9 ##set up input files
10
11 #set $reference_fasta_filename = "localref.fa"
12
13 #if str( $reference_source.reference_source_selector ) == "history":
14 ln -s "${reference_source.ref_file}" "${reference_fasta_filename}" &amp;&amp;
15 samtools faidx "${reference_fasta_filename}" 2&gt;&amp;1 || echo "Error running samtools faidx for FreeBayes" &gt;&amp;2 &amp;&amp;
16 #else:
17 #set $reference_fasta_filename = str( $reference_source.ref_file.fields.path )
18 #end if
19
20 #for $bam_count, $input_bam in enumerate( $input_bams ):
21 ln -s "${input_bam.input_bam}" "localbam_${bam_count}.bam" &amp;&amp;
22 ln -s "${input_bam.input_bam.metadata.bam_index}" "localbam_${bam_count}.bam.bai" &amp;&amp;
23 #end for
24
25 ## Tabixize optional input_varinat_vcf file (for --variant-input option)
26
27 #if ( str( $options_type.options_type_selector ) == 'cline' or str( $options_type.options_type_selector ) == 'full' ) and $options_type.optional_inputs.optional_inputs_selector and str( $options_type.optional_inputs.input_variant_type.input_variant_type_selector ) == "provide_vcf":
28 ln -s "${options_type.optional_inputs.input_variant_type.input_variant_vcf}" "input_variant_vcf.vcf.gz" &amp;&amp;
29 ln -s "${Tabixized_input}" "input_variant_vcf.vcf.gz.tbi" &amp;&amp;
30 #end if
31
32 ##finished setting up inputs
33
34 ##COMMAND LINE STARTS HERE
35
36 freebayes
37 #for $bam_count, $input_bam in enumerate( $input_bams ):
38 --bam "localbam_${bam_count}.bam"
39 #end for
40 --fasta-reference "${reference_fasta_filename}"
41
42 ##outputs
43 #if str( $rename_output.rename_output_selector ) == "noRename":
44 --vcf ${output_vcf_default}
45 #elif str( $rename_output.rename_output_selector ) == "firstBAM":
46 --vcf "${output_vcf_firstBAM}"
47 #elif str( $rename_output.rename_output_selector ) == "providedName":
48 --vcf "${output_vcf_rename}"
49 #end if
50
51 #if str( $target_limit_type.target_limit_type_selector ) == "limit_by_target_file":
52 --targets "${target_limit_type.input_target_bed}"
53 #elif str( $target_limit_type.target_limit_type_selector ) == "limit_by_region":
54 --region "${target_limit_type.region_chromosome}:${target_limit_type.region_start}..${target_limit_type.region_end}"
55 #end if
56
57 ##advanced options
58 #if str( $options_type.options_type_selector ) == "simple":
59 ##do nothing as command like build up to this point is sufficinet for simple diploid calling
60
61 #elif str( $options_type.options_type_selector ) == "simple_w_filters":
62
63 --standard-filters
64 --min-coverage "${options_type.min_coverage}"
65
66 #elif str( $options_type.options_type_selector ) == "naive":
67
68 --haplotype-length 0
69 --min-alternate-count 1
70 --min-alternate-fraction 0
71 --pooled-continuous
72 --report-monomorphic
73
74 #elif str( $options_type.options_type_selector ) == "naive_w_filters":
75
76 --haplotype-length 0
77 --min-alternate-count 1
78 --min-alternate-fraction 0
79 --pooled-continuous
80 --report-monomorphic
81 --standard-filters
82 --min-coverage "${options_type.min_coverage}"
83
84 ## Command line direct text entry is not allowed at this time for security reasons
85
86 #elif str( $options_type.options_type_selector ) == "full":
87
88 #if $options_type.optional_inputs.optional_inputs_selector:
89
90 #if $options_type.optional_inputs.output_trace_option:
91 --trace "${output_trace}"
92 #end if
93
94 #if $options_type.optional_inputs.output_failed_alleles_option:
95 --failed-alleles "${output_failed_alleles_bed}"
96 #end if
97
98 #if $options_type.optional_inputs.samples:
99 --samples "${options_type.optional_inputs.samples}"
100 #end if
101
102 #if $options_type.optional_inputs.populations:
103 --populations "${options_type.optional_inputs.populations}"
104 #end if
105
106 #if $options_type.optional_inputs.A:
107 --cnv-map "${options_type.optional_inputs.A}"
108 #end if
109
110 #if str( $options_type.optional_inputs.input_variant_type.input_variant_type_selector ) == "provide_vcf":
111 --variant-input "input_variant_vcf.vcf.gz" ## input_variant_vcf.vcf.gz is symlinked to a galaxy-generated dataset in "Tabixize optional input_varinat_vcf file" section of the command line above
112 ${options_type.optional_inputs.input_variant_type.only_use_input_alleles}
113 #end if
114
115 #if $options_type.optional_inputs.haplotype_basis_alleles:
116 --haplotype-basis-alleles "${options_type.optional_inputs.haplotype_basis_alleles}"
117 #end if
118
119 ${options_type.optional_inputs.report_monomorphic}
120
121 #if $options_type.optional_inputs.observation_bias:
122 --observation-bias "${options_type.optional_inputs.observation_bias}"
123 #end if
124
125 #if $options_type.optional_inputs.contamination_estimates:
126 --contamination-estimates "${options_type.optional_inputs.contamination_estimates}"
127 #end if
128
129 #end if
130
131 ## REPORTING
132
133 ${options_type.optional_inputs.report_monomorphic}
134
135 #if str( $options_type.reporting.reporting_selector ) == "True":
136 --pvar ${options_type.reporting.pvar}
137 #end if
138
139 ## POPULATION MODEL
140
141 #if str( $options_type.population_model.population_model_selector ) == "True":
142 --theta "${options_type.population_model.T}"
143 --ploidy "${options_type.population_model.P}"
144 ${options_type.population_model.J}
145 ${options_type.population_model.K}
146
147 #end if
148
149 ## REFERENCE ALLELE
150
151 #if str( $options_type.reference_allele.reference_allele_selector ) == "True":
152 ${options_type.reference_allele.Z}
153 --reference-quality "${options_type.reference_allele.reference_quality}"
154 #end if
155
156 ## ALLELE SCOPE
157
158 #if str( $options_type.allele_scope.allele_scope_selector ) == "True":
159 ${options_type.allele_scope.I}
160 ${options_type.allele_scope.i}
161 ${options_type.allele_scope.X}
162 ${options_type.allele_scope.u}
163 -n "${options_type.allele_scope.n}"
164 --haplotype-length "${options_type.allele_scope.haplotype_length}"
165 --min-repeat-size "${options_type.allele_scope.min_repeat_length}"
166 --min-repeat-entropy "${options_type.allele_scope.min_repeat_entropy}"
167 ${options_type.allele_scope.no_partial_observations}
168 #end if
169
170 ## REALIGNMENT
171
172 ${options_type.O}
173
174 ##INPUT FILTERS
175
176 #if str( $options_type.input_filters.input_filters_selector ) == "True":
177 ${options_type.input_filters.use_duplicate_reads}
178 -m "${options_type.input_filters.m}"
179 -q "${options_type.input_filters.q}"
180 -R "${options_type.input_filters.R}"
181 -Y "${options_type.input_filters.Y}"
182
183 #if str( $options_type.input_filters.mismatch_filters.mismatch_filters_selector ) == "True":
184 -Q "${options_type.input_filters.mismatch_filters.Q}"
185 -U "${options_type.input_filters.mismatch_filters.U}"
186 -z "${options_type.input_filters.mismatch_filters.z}"
187 --read-snp-limit "${options_type.input_filters.mismatch_filters.read_snp_limit}"
188 #end if
189
190 -e "${options_type.input_filters.e}"
191 -F "${options_type.input_filters.F}"
192 -C "${options_type.input_filters.C}"
193 --min-alternate-qsum "${options_type.input_filters.min_alternate_qsum}"
194 -G "${options_type.input_filters.G}"
195 --min-coverage "${options_type.input_filters.min_coverage}"
196 #end if
197
198 ## POPULATION AND MAPPABILITY PRIORS
199
200 #if str( $options_type.population_mappability_priors.population_mappability_priors_selector ) == "True":
201 ${options_type.population_mappability_priors.k}
202 ${options_type.population_mappability_priors.w}
203 ${options_type.population_mappability_priors.V}
204 ${options_type.population_mappability_priors.a}
205 #end if
206
207 ## GENOTYPE LIKELIHOODS
208
209 #if str( $options_type.genotype_likelihoods.genotype_likelihoods_selector ) == "True":
210 --base-quality-cap "${$options_type.genotype_likelihoods.base_quality_cap}"
211 ${$options_type.genotype_likelihoods.experimental_gls}
212 --prob-contamination "${$options_type.genotype_likelihoods.prob_contamination}"
213 #end if
214
215 ## ALGORITHMIC FEATURES
216
217 #if str( $options_type.algorithmic_features.algorithmic_features_selector ) == "True":
218 ${options_type.algorithmic_features.report_genotype_likelihood_max}
219 -B "${options_type.algorithmic_features.B}"
220 --genotyping-max-banddepth "${options_type.algorithmic_features.genotyping_max_banddepth}"
221 -W "${options_type.algorithmic_features.W}"
222 ${options_type.algorithmic_features.N}
223
224 #if str( $options_type.algorithmic_features.genotype_variant_threshold.genotype_variant_threshold_selector ) == "True":
225 -S "${options_type.algorithmic_features.genotype_variant_threshold.S}"
226 #end if
227
228 ${options_type.algorithmic_features.j}
229 ${options_type.algorithmic_features.H}
230 -D "${options_type.algorithmic_features.D}"
231 ${options_type.algorithmic_features.genotype_qualities}
232 #end if
233 #end if
234
235
236 #silent sys.stderr.write("!!!! Cheetah Template Variables !!!!\n")
237 #for k,v in $searchList[2].items()
238 #silent sys.stderr.write(" %s = %s\n" % (str(k), str(v) ))
239 #end for
240 #silent sys.stderr.write("!!!! end-of-list !!!!\n")
241 </command>
242
243 <inputs>
244 <conditional name="reference_source">
245 <param name="reference_source_selector" type="select" label="Load reference genome from">
246 <option value="cached">Local cache</option>
247 <option value="history">History</option>
248 </param>
249 <when value="cached">
250 <param name="ref_file" type="select" label="Using reference genome">
251 <options from_data_table="fasta_indexes"></options>
252 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
253 </param>
254 </when>
255 <when value="history">
256 <param name="ref_file" type="data" format="fasta" label="Use the following dataset as the reference sequence" help="You can upload a FASTA sequence to the history and use it as reference" />
257 </when>
258 </conditional>
259
260
261 <!-- <repeat name="input_bams" title="Sample BAM file" min="1">
262 <param name="input_bam" type="data" format="bam" label="BAM file">
263 <validator type="unspecified_build" />
264 <validator type="dataset_metadata_in_data_table" table_name="fasta_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." />
265 </param>
266 </repeat> -->
267 <repeat name="input_bams" title="Sample BAM file" min="1">
268 <param name="input_bam" type="data" format="bam" label="BAM file" />
269 </repeat>
270
271
272 <conditional name="rename_output">
273 <param name="rename_output_selector" type="select" display="radio" label="Rename the output vcf ?" multiple="False">
274 <option value="noRename" >default output name</option>
275 <option value="firstBAM" >output as [first bam name].VCF</option>
276 <option value="providedName" >choose the output name</option>
277 </param>
278 <when value="noRename">
279 </when>
280 <when value="firstBAM">
281 </when>
282 <when value="providedName">
283 <param name="output_user_name" type="text" label="output name :" value="" help="" />
284 </when>
285 </conditional>
286
287 <conditional name="target_limit_type">
288 <param name="target_limit_type_selector" type="select" label="Limit variant calling to a set of regions?" help="Sets --targets or --region options">
289 <option value="do_not_limit" selected="True">Do not limit</option>
290 <option value="limit_by_target_file">Limit by target file</option>
291 <option value="limit_by_region">Limit to region</option>
292 </param>
293 <when value="do_not_limit">
294 <!-- Do nothing here -->
295 </when>
296 <when value="limit_by_target_file">
297 <param name="input_target_bed" type="data" format="bed" label="Limit analysis to targets listed in the BED-format FILE." help="-t --targets"/>
298 </when>
299 <when value="limit_by_region">
300 <param name="region_chromosome" type="text" label="Region Chromosome" value="" help="-r --region"/> <!--only once? -->
301 <param name="region_start" type="integer" label="Region Start" value="" />
302 <param name="region_end" type="integer" label="Region End" value="" />
303 </when>
304 </conditional>
305
306 <conditional name="options_type">
307 <param name="options_type_selector" type="select" label="Choose parameter selection level" help="Select how much control over the freebayes run you need" >
308 <option value="simple" selected="True">1:Simple diploid calling</option>
309 <option value="simple_w_filters">2:Simple diploid calling with filtering and coverage</option>
310 <option value="naive">3:Frequency-based pooled calling</option>
311 <option value="naive_w_filters">4:Frequency-based pooled calling with filtering and coverage</option>
312 <option value="full">5:Complete list of all options</option>
313 <!-- We will not alloow command line text boxes at this time
314 <option value="cline">6:Input parameters on the command line</option>
315 -->
316 </param>
317 <when value="full">
318
319 <conditional name="optional_inputs">
320 <param name="optional_inputs_selector" type="boolean" truevalue="set" falsevalue="do_not_set" label="Do you want to provide additional inputs?" help="Sets --samples, --populations, --cnv-map, --trace, --failed-alleles, --varinat-input, --only-use-input-alleles, --haplotype-basis-alleles, --report-all-haplotype-alleles, --report-monomorphic options, --observation-bias, and --contamination-estimates" />
321 <when value="set">
322 <param name="output_failed_alleles_option" type="boolean" truevalue="--failed-alleles" falsevalue="" checked="False" label="Write out failed alleles file" help="--failed-alleles" />
323 <param name="output_trace_option" type="boolean" truevalue="--trace" falsevalue="" checked="False" label="Write out algorithm trace file" help="--trace"/>
324 <param name="samples" type="data" format="txt" label="Limit analysis to samples listed (one per line) in the FILE" optional="True" help="-s --samples; default=By default FreeBayes will analyze all samples in its input BAM files"/>
325 <param name="populations" type="data" format="txt" label="Populations File" optional="True" help="--populations; default=False. Each line of FILE should list a sample and a population which it is part of. The population-based bayesian inference model will then be partitioned on the basis of the populations" />
326 <param name="A" type="data" format="bed" label="Read a copy number map from the BED file FILE" optional="True" help="-A --cnv-map; default=copy number is set to as specified by --ploidy. Read a copy number map from the BED file FILE, which has the format: reference sequence, start, end, sample name, copy number ... for each region in each sample which does not have the default copy number as set by --ploidy."/>
327 <conditional name="input_variant_type">
328 <param name="input_variant_type_selector" type="select" label="Provide variants file">
329 <option value="do_not_provide" selected="True">Do not provide</option>
330 <option value="provide_vcf">Provide VCF file</option>
331 </param>
332 <when value="do_not_provide">
333 <!-- Do nothing here -->
334 </when>
335 <when value="provide_vcf">
336 <param name="input_variant_vcf" type="data" format="vcf_bgzip" label="Use variants reported in VCF file as input to the algorithm">
337 <conversion name="Tabixized_input" type="tabix" />
338 </param>
339 <param name="only_use_input_alleles" type="boolean" truevalue="--only-use-input-alleles" falsevalue="" checked="False" label="Only provide variant calls and genotype likelihoods for sites in VCF" />
340 </when>
341 </conditional>
342 <param name="haplotype_basis_alleles" type="data" format="vcf" label="Only use variant alleles provided in this input VCF for the construction of complex or haplotype alleles" optional="True" help="--haplotype-basis-alleles" />
343 <param name="report_monomorphic" type="boolean" truevalue="--report-monomorphic" falsevalue="" checked="False" label="Report even loci which appear to be monomorphic, and report all considered alleles, even those which are not in called genotypes." help="--report-monomorphic " />
344 <param name="observation_bias" optional="True" type="data" format="tabular" label="Load read length-dependent allele observation biases from" help="--observation-bias; The format is [length] [alignment efficiency relative to reference] where the efficiency is 1 if there is no relative observation bias" />
345 <param name="contamination_estimates" optional="True" type="data" format="tabular" label="Upload per-sample estimates of contamination from" help="--contamination-estimates; The format should be: sample p(read=R|genotype=AR) p(read=A|genotype=AA) Sample '*' can be used to set default contamination estimates." />
346 </when>
347 <when value="do_not_set">
348 <!-- do nothing -->
349 </when>
350 </conditional>
351
352 <!-- reporting -->
353
354 <conditional name="reporting">
355 <param name="reporting_selector" type="boolean" truevalue="set" falsevalue="do_not_set" label="Set reporting option?" help="Sets -P --pvar option" />
356 <when value="set">
357 <param name="pvar" type="float" value="0.0" label="Report sites if the probability that there is a polymorphism at the site is greater than" help="-P --pvar; default=0.0. Note that post-filtering is generally recommended over the use of this parameter. " />
358 </when>
359 <when value="do_not_set">
360 <!-- do nothing -->
361 </when>
362 </conditional>
363
364 <!-- population model -->
365
366 <conditional name="population_model">
367 <param name="population_model_selector" type="boolean" truevalue="set" falsevalue="do_not_set" label="Set population model?" help="Sets --theta, --ploidy, --pooled-discrete, and --pooled-continuous options " />
368 <when value="set">
369 <param name="T" type="float" value="0.001" label="The expected mutation rate or pairwise nucleotide diversity among the population under analysis" help="-T --theta; default = 0.001. This serves as the single parameter to the Ewens Sampling Formula prior model." />
370 <param name="P" type="integer" value="2" label="Set ploidy for the analysis" help="-p --ploidy; default=2" />
371 <param name="J" type="boolean" truevalue="-J" falsevalue="" checked="False" label="Assume that samples result from pooled sequencing" help="-J --pooled-discrete; default=False. Model pooled samples using discrete genotypes across pools. When using this flag, set --ploidy to the number of alleles in each sample or use the --cnv-map to define per-sample ploidy." />
372 <param name="K" type="boolean" truevalue="-K" falsevalue="" checked="False" label="Output all alleles which pass input filters, regardles of genotyping outcome or model" help="-K, --poled-continuous; default=False. " />
373 </when>
374 <when value="do_not_set">
375 <!-- do nothing -->
376 </when>
377 </conditional>
378
379 <!-- reference allele -->
380
381 <conditional name="reference_allele">
382 <param name="reference_allele_selector" type="boolean" truevalue="set" falsevalue="do_not_set" label="Use reference allele?" help="Sets --use-reference-allele and --reference-quality options " />
383 <when value="set">
384 <param name="Z" type="boolean" truevalue="-Z" falsevalue="" checked="False" label="Include the reference allele in the analysis as if it is another sample from the same population" help="-Z --use-reference-allele; default=False" />
385 <param name="reference_quality" type="text" size="8" value="100,60" label="Assign mapping quality of MQ (100) to the reference allele at each site and base quality of BQ (60)" help="--reference-quality; default=100,60 " />
386 </when>
387 <when value="do_not_set">
388 <!-- do nothing -->
389 </when>
390 </conditional>
391
392 <!-- allelic scope -->
393
394 <conditional name="allele_scope">
395 <param name="allele_scope_selector" type="boolean" truevalue="set" falsevalue="do_not_set" label="Set allelic scope?" help="Sets -I, i, -X, -u, -n, --haplotype-length, --min-repeat-size, --min-repeat-entropy, and --no-partial-observations options " />
396 <when value="set">
397 <param name="I" type="boolean" truevalue="-I" falsevalue="" checked="False" label="Ignore SNP alleles" help="-I --no-snps; default=False" />
398 <param name="i" type="boolean" truevalue="-i" falsevalue="" checked="False" label="Ignore indels alleles" help="-i --no-indels; default=False" />
399 <param name="X" type="boolean" truevalue="-X" falsevalue="" checked="False" label="Ignore multi-nucleotide polymorphisms, MNPs" help="-X --no-mnps; default=False" />
400 <param name="u" type="boolean" truevalue="-u" falsevalue="" checked="False" label="Ignore complex events (composites of other classes)." help="-u --no-complex; default=False" />
401 <param name="n" type="integer" value="0" label="How many best SNP alleles to evaluate" help="-n --use-best-n-alleles; default=0 (all). Alleles are ranked by the sum of supporting quality scores. Set to 0 to evaluate all" />
402 <param name="haplotype_length" type="integer" value="3" label="Allow haplotype calls with contiguous embedded matches of up to (nucleotides)" help="-E --max-complex-gap --haplotype-length; default=3." />
403 <param name="min_repeat_length" type="integer" value="5" label="When assembling observations across repeats, require the total repeat length at least this many bp" help="--min-repeat-size; default=5." />
404 <param name="min_repeat_entropy" type="integer" value="0" label="To detect interrupted repeats, build across sequence until it has entropy > (bits per bp)" help="--min-repeat-entropy; default=0 (off)." />
405 <param name="no_partial_observations" type="boolean" truevalue="--no-partial-observations" falsevalue="" checked="False" label="Exclude observations which do not fully span the dynamically-determined detection window" help="--no-partial-observations; default=use all observations, dividing partial support across matching haplotypes when generating haplotypes. " />
406 </when>
407 <when value="do_not_set">
408 <!-- do nothing -->
409 </when>
410 </conditional>
411
412 <!-- indel realignment -->
413
414 <param name="O" type="boolean" truevalue="-O" falsevalue="" checked="False" label="Turn off left-alignment of indels?" help="-O --dont-left-align-indels; default=False (do left align). " />
415
416 <!-- input filters -->
417
418 <conditional name="input_filters">
419 <param name="input_filters_selector" type="boolean" truevalue="set" falsevalue="do_not_set" label="Set input filters?" help="Sets -4, -m, -q, -R, -Y, -Q, -U, -z, -&#36;, -e, -0, -F, -C, -3, -G, and -&#33; options " />
420 <when value="set">
421 <param name="use_duplicate_reads" type="boolean" truevalue="--use-duplicate-reads" falsevalue="" checked="False" label="Include duplicate-marked alignments in the analysis." help="-4 --use-duplicate-reads; default=False (exclude duplicates marked as such in alignments)." />
422 <param name="m" type="integer" value="1" label="Exclude alignments from analysis if they have a mapping quality less than" help="-m --min-mapping-quality; default=1" />
423 <param name="q" type="integer" value="0" label="Exclude alleles from analysis if their supporting base quality less than" help="-q --min-base-quality; default=0" />
424 <param name="R" type="integer" value="0" label="Consider any allele in which the sum of qualities of supporting observations is at least" help="-R --min-supporting-allele-qsum; default=0" />
425 <param name="Y" type="integer" value="0" label="Consider any allele in which and the sum of mapping qualities of supporting reads is at least" help="-Y --min-supporting-mapping-qsum; default=0" />
426 <conditional name="mismatch_filters">
427 <param name="mismatch_filters_selector" type="boolean" truevalue="set" falsevalue="do_not_set" label="Perform mismatch filtering?" help="Sets -Q, -U, -z, and &#36; options" />
428 <when value="set">
429 <param name="Q" type="integer" value="10" label="Count mismatches toward -U (option below) if the base quality of the mismatch is >=" help="-Q --mismatch-base-quality-threshold; default=10" />
430 <param name="U" type="integer" value="1000" optional="True" label="Exclude reads with more than N mismatches where each mismatch has base quality >= Q (option above)" help="-U --read-mismatch-limit; default=~unbound" />
431 <param name="z" type="float" value="1.0" min="0.0" max="1.0" label="Exclude reads with more than N [0,1] fraction of mismatches where each mismatch has base quality >= Q (second option above)" help="-z --read-max-mismatch-fraction; default=1.0" />
432 <param name="read_snp_limit" type="integer" value="1000" label="Exclude reads with more than N base mismatches, ignoring gaps with quality >= Q (third option abobe)" help="-$amp; --read-snp-limit N " />
433 </when>
434 <when value="do_not_set">
435 <!-- do nothing -->
436 </when>
437 </conditional>
438 <param name="e" type="integer" value="1000" label="Exclude reads with more than this number of separate gaps" help="-e --read-snp-limit; default=~unbounded" />
439 <param name="standard_filters" type="boolean" truevalue="-0" falsevalue="" checked="False" label="Use stringent input base and mapping quality filters" help="-0 --standard-filters; default=False. Equivalent to -m 30 -q 20 -R 0 -S 0" />
440 <param name="F" type="float" value="0.2" label="Require at least this fraction of observations supporting an alternate allele within a single individual in the in order to evaluate the position" help="-F --min-alternate-fraction; default=0.2" />
441 <param name="C" type="integer" value="2" label="Require at least this count of observations supporting an alternate allele within a single individual in order to evaluate the position" help="-C --min-alternate-count; default=2" />
442 <param name="min_alternate_qsum" type="integer" value="0" label="Require at least this sum of quality of observations supporting an alternate allele within a single individual in order to evaluate the position" help="-3 --min-alternate-qsum; default=0" />
443 <param name="G" type="integer" value="1" label="Require at least this count of observations supporting an alternate allele within the total population in order to use the allele in analysis" help="-G --min-alternate-total N; default=1" />
444 <param name="min_coverage" type="integer" value="0" label="Require at least this coverage to process a site" help="-! --min-coverage; default=0 " />
445 </when>
446 <when value="do_not_set">
447 <!-- do nothing -->
448 </when>
449 </conditional>
450
451 <!-- population and mappability priors -->
452
453 <conditional name="population_mappability_priors">
454 <param name="population_mappability_priors_selector" type="boolean" truevalue="set" falsevalue="do_not_set" label="Set population and mappability priors?" help="Sets -k, -w, -V, and -a options " />
455 <when value="set">
456 <param name="k" type="boolean" truevalue="-k" falsevalue="" checked="False" label="No population priors" help="-k --no-population-priors; default=False. Equivalent to --pooled-discrete --hwe-priors-off and removal of Ewens Sampling Formula component of priors." />
457 <param name="w" type="boolean" truevalue="-w" falsevalue="" checked="False" label="Disable estimation of the probability of the combination arising under HWE given the allele frequency as estimated by observation frequency" help="-w --hwe-priors-off; default=False" />
458 <param name="V" type="boolean" truevalue="-V" falsevalue="" checked="False" label="Disable incorporation of prior expectations about observations" help="-V --binomial-obs-priors-off; default=False. Uses read placement probability, strand balance probability, and read position (5&#39;'-3&#39;') probability." />
459 <param name="a" type="boolean" truevalue="-a" falsevalue="" checked="False" label="isable use of aggregate probability of observation balance between alleles as a component of the priors" help="-a --allele-balance-priors-off; default=False " />
460 </when>
461 <when value="do_not_set">
462 <!-- do nothing -->
463 </when>
464 </conditional>
465
466 <!-- genotype likelihoods -->
467
468 <conditional name="genotype_likelihoods">
469 <param name="genotype_likelihoods_selector" type="boolean" truevalue="set" falsevalue="do_not_set" label="Tweak genotype likelihoods?" help="Sets --base-quality-cap, --experimental-gls, and --prob-contamination options. " />
470 <when value="set">
471 <param name="base_quality_cap" type="integer" value="0" label="Limit estimated observation quality by capping base quality at" help="--base-quality-cap" />
472 <param name="experimental_gls" type="boolean" truevalue="--experimental-gls" falsevalue="" checked="False" label="Generate genotype likelihoods using 'effective base depth' metric qual = 1-BaseQual * 1-MapQual" help="--experimental-gls; Incorporate partial observations. This is the default when contamination estimates are provided. Optimized for diploid samples." />
473 <param name="prob_contamination" type="float" value="10e-9" label="An estimate of contamination to use for all samples. " help="--prob-contamination; default=10e-9." />
474 </when>
475 <when value="do_not_set">
476 <!-- do nothing -->
477 </when>
478 </conditional>
479
480 <!-- algorithmic features -->
481
482 <conditional name="algorithmic_features">
483 <param name="algorithmic_features_selector" type="boolean" truevalue="set" falsevalue="do_not_set" label="Tweak algorithmic features?" help="Sets --report-genotypes-likelihood-max, -B, --genotyping-max-banddepth, -W, -N, S, -j, -H, -D, -= options " />
484 <when value="set">
485 <param name="report_genotype_likelihood_max" type="boolean" truevalue="--report-genotype-likelihood-max" falsevalue="" checked="False" label="Report genotypes using the maximum-likelihood estimate provided from genotype likelihoods." help="--report-genotype-likelihood-max; default=False" />
486 <param name="B" type="integer" value="1000" label="Iterate no more than N times during genotyping step" help="-B --genotyping-max-iterations; default=1000." />
487 <param name="genotyping_max_banddepth" type="integer" value="6" label="Integrate no deeper than the Nth best genotype by likelihood when genotyping" help="--genotyping-max-banddepth; default=6" />
488 <param name="W" type="text" size="8" value="1,3" label="Integrate all genotype combinations in our posterior space which include no more than N (1) samples with their Mth (3) best data likelihood" help="-W --posterior-integration-limits; default=1,3" />
489 <param name="N" type="boolean" truevalue="--exclude-unobserved-genotypes" falsevalue="" checked="False" label="Skip sample genotypings for which the sample has no supporting reads" help="-N --exclude-unobserved-genotypes; default=False" />
490 <conditional name="genotype_variant_threshold">
491 <param name="genotype_variant_threshold_selector" type="boolean" truevalue="set" falsevalue="do_not_set" label="Do you want to to limit posterior integration" help="-S --genotype-variant-threshold" />
492 <when value="do_not_set">
493 <!-- do nothing -->
494 </when>
495 <when value="set">
496 <param name="S" value="" type="integer" label="Limit posterior integration to samples where the second-best genotype likelihood is no more than log(N) from the highest genotype likelihood for the sample." help="-S --genotype-variant-threshold; default=~unbounded" />
497 </when>
498 </conditional>
499 <param name="j" type="boolean" truevalue="-j" falsevalue="" checked="False" label="Use mapping quality of alleles when calculating data likelihoods" help="-j --use-mapping-quality; default=False" />
500 <param name="H" type="boolean" truevalue="-H" falsevalue="" checked="False" label="Use a weighted sum of base qualities around an indel, scaled by the distance from the indel" help="-H --harmonic-indel-quality; default=use a minimum Base Quality in flanking sequence." />
501 <param name="D" type="float" value="0.9" label="Incorporate non-independence of reads by scaling successive observations by this factor during data likelihood calculations" help="-D --read-dependence-factor; default=0.9." />
502 <param name="genotype_qualities" type="boolean" truevalue="--genotype-qualities" falsevalue="" checked="False" label="Calculate the marginal probability of genotypes and report as GQ in each sample field in the VCF output" help="-= --genotype-qualities; default=False " />
503 </when>
504 <when value="do_not_set">
505 <!-- do nothing -->
506 </when>
507 </conditional>
508 </when>
509 <when value="simple">
510 <!-- do nothing -->
511 </when>
512 <when value="simple_w_filters">
513 <!-- add standard-filters to command line -->
514 <param name="min_coverage" type="integer" value="0" label="Require at least this coverage to process a site" help="-! --min-coverage; default=0 " />
515 </when>
516 <when value="naive">
517 <!-- do nothing build command line using haplotype-length 0 min-alternate-count 1 min-alternate-fraction 0 pooled-continuous report-monomorphic -->
518 </when>
519 <when value="naive_w_filters">
520 <!-- do nothing build command line using haplotype-length 0 min-alternate-count 1 min-alternate-fraction 0 pooled-continuous report-monomorphic standard-filters-->
521 <param name="min_coverage" type="integer" value="0" label="Require at least this coverage to process a site" help="-! --min-coverage; default=0 " />
522 </when>
523 </conditional>
524
525 </inputs>
526
527 <outputs>
528 <data format="vcf" name="output_vcf_default" label="${tool.name} on ${on_string} (variants)">
529 <filter>( rename_output['rename_output_selector'] == 'noRename' )</filter>
530 </data>
531 <data format="vcf" name="output_vcf_firstBAM" label="${input_bams[0].input_bam.name}.vcf">
532 <filter>( rename_output['rename_output_selector'] == 'firstBAM' )</filter>
533 </data>
534 <data format="vcf" name="output_vcf_rename" label="${rename_output.output_user_name}">
535 <filter>( rename_output['rename_output_selector'] == 'providedName' )</filter>
536 </data>
537 <data format="bed" name="output_failed_alleles_bed" label="${tool.name} on ${on_string} (failed alleles)">
538 <filter>( options_type['options_type_selector'] == 'cline' or options_type['options_type_selector'] == 'full' ) and options_type['optional_inputs']['optional_inputs_selector'] is True and options_type['optional_inputs']['output_failed_alleles_option'] is True</filter>
539 </data>
540 <data format="txt" name="output_trace" label="${tool.name} on ${on_string} (trace)">
541 <filter>( options_type['options_type_selector'] == 'cline' or options_type['options_type_selector'] == 'full' ) and options_type['optional_inputs']['optional_inputs_selector'] is True and options_type['optional_inputs']['output_trace_option'] is True</filter>
542 </data>
543 </outputs>
544 <stdio>
545 <exit_code range="1:" />
546 </stdio>
547 <help>
548 **What it does**
549
550 FreeBayes is a Bayesian genetic variant detector designed to find small polymorphisms, specifically SNPs (single-nucleotide polymorphisms), indels (insertions and deletions), MNPs (multi-nucleotide polymorphisms), and complex events (composite insertion and substitution events) smaller than the length of a short-read sequencing alignment.
551
552 See https://github.com/ekg/freebayes for details on FreeBayes.
553
554 This Galaxy instance of FreeBayes corresponds to release 0.9.20
555
556 This tool is a fork of Freebayes revision 22 (99684adf84de)
557
558 ------
559
560 **Description**
561
562 Privided BAM file(s) and a reference. FreeBayes will provide VCF output on standard out describing SNPs, indels, and complex variants in samples in the input alignments.
563
564 By default, FreeBayes will consider variants supported by at least 2 observations in a single sample (-C) and also by at least 20% of the reads from a single sample (-F). These settings are suitable to low to high depth sequencing in haploid and diploid samples, but users working with polyploid or pooled samples may wish to adjust them depending on the characteristics of their sequencing data.
565
566 FreeBayes is capable of calling variant haplotypes shorter than a read length where multiple polymorphisms segregate on the same read. The maximum distance between polymorphisms phased in this way is determined by the --max-complex-gap, which defaults to 3bp. In practice, this can comfortably be set to half the read length.
567
568 Ploidy may be set to any level (-p), but by default all samples are assumed to be diploid. FreeBayes can model per-sample and per-region variation in copy-number (-A) using a copy-number variation map.
569
570 FreeBayes can act as a frequency-based pooled caller and describe variants and haplotypes in terms of observation frequency rather than called genotypes. To do so, use --pooled-continuous and set input filters to a suitable level. Allele observation counts will be described by AO and RO fields in the VCF output.
571
572 -------
573
574 **Galaxy-specific options**
575
576 Galaxy allows six levels of control over FreeBayes options provided by **Choose parameter selection level** menu option. These are:
577
578 1. *Simple diploid calling*: The simples possible FreeBayes application. Equvalent of using FreeBayes with only a BAM input and no other parameter options.
579 2. *Simple diploid calling with filtering and coverage*: Same as #1 plus two additional options: -0 (standard filters: --min-mapping-quality 30 --min-base-quality 20 --min-supporting-allele-qsum 0 --genotype-varinat-threshold 0) and --min-coverage.
580 3. *Frequency-based pooled calling*: This is equivalent to using FreeBayes with the following options: --haplotype-length 0 --min-alternate-count 1 --min-alternate-fraction 0 --pooled-continuous --report-monomorphic. This is the best choice for calling varinats in mixtures such as viral, bacterial, or organellar genomes.
581 4. *Frequency-based pooled calling with filtering and coverage*: Same as #3 but adds -0 and --min-coverage like in #2.
582 5. *Complete list of all options*: Gives you full control by exposing all FreeBayes options as Galaxy widgets.
583
584 -----
585
586 **FreeBayes options**
587
588 .. class:: infomark
589
590 Note that each Galaxy parameter widget corresponding to command line flags listed below:
591
592 Input and output::
593
594 -t --targets FILE
595 Limit analysis to targets listed in the BED-format FILE.
596 -r --region chrom:start_position-end_position
597 Limit analysis to the specified region, 0-base coordinates,
598 end_position included. Either '-' or '..' maybe used as a separator.
599 -s --samples FILE
600 Limit analysis to samples listed (one per line) in the FILE.
601 By default FreeBayes will analyze all samples in its input
602 BAM files.
603 --populations FILE
604 Each line of FILE should list a sample and a population which
605 it is part of. The population-based bayesian inference model
606 will then be partitioned on the basis of the populations.
607 -A --cnv-map FILE
608 Read a copy number map from the BED file FILE, which has
609 the format:
610 reference sequence, start, end, sample name, copy number
611 ... for each region in each sample which does not have the
612 default copy number as set by --ploidy.
613 --trace FILE Output an algorithmic trace to FILE.
614 --failed-alleles FILE
615 Write a BED file of the analyzed positions which do not
616 pass --pvar to FILE.
617 -@ --variant-input VCF
618 Use variants reported in VCF file as input to the algorithm.
619 Variants in this file will be treated as putative variants
620 even if there is not enough support in the data to pass
621 input filters.
622 -l --only-use-input-alleles
623 Only provide variant calls and genotype likelihoods for sites
624 and alleles which are provided in the VCF input, and provide
625 output in the VCF for all input alleles, not just those which
626 have support in the data.
627 --haplotype-basis-alleles VCF
628 When specified, only variant alleles provided in this input
629 VCF will be used for the construction of complex or haplotype
630 alleles.
631 --report-all-haplotype-alleles
632 At sites where genotypes are made over haplotype alleles,
633 provide information about all alleles in output, not only
634 those which are called.
635 --report-monomorphic
636 Report even loci which appear to be monomorphic, and report all
637 considered alleles, even those which are not in called genotypes.
638 Loci which do not have any potential alternates have '.' for ALT.
639
640 Reporting::
641
642 -P --pvar N Report sites if the probability that there is a polymorphism
643 at the site is greater than N. default: 0.0. Note that post-
644 filtering is generally recommended over the use of this parameter.
645
646 Population model::
647
648 -T --theta N The expected mutation rate or pairwise nucleotide diversity
649 among the population under analysis. This serves as the
650 single parameter to the Ewens Sampling Formula prior model
651 default: 0.001
652 -p --ploidy N Sets the default ploidy for the analysis to N. default: 2
653 -J --pooled-discrete
654 Assume that samples result from pooled sequencing.
655 Model pooled samples using discrete genotypes across pools.
656 When using this flag, set --ploidy to the number of
657 alleles in each sample or use the --cnv-map to define
658 per-sample ploidy.
659 -K --pooled-continuous
660 Output all alleles which pass input filters, regardles of
661 genotyping outcome or model.
662
663 Reference allele::
664
665 -Z --use-reference-allele
666 This flag includes the reference allele in the analysis as
667 if it is another sample from the same population.
668 --reference-quality MQ,BQ
669 Assign mapping quality of MQ to the reference allele at each
670 site and base quality of BQ. default: 100,60
671
672 Allele scope::
673
674 -I --no-snps Ignore SNP alleles.
675 -i --no-indels Ignore insertion and deletion alleles.
676 -X --no-mnps Ignore multi-nuceotide polymorphisms, MNPs.
677 -u --no-complex Ignore complex events (composites of other classes).
678 -n --use-best-n-alleles N
679 Evaluate only the best N SNP alleles, ranked by sum of
680 supporting quality scores. (Set to 0 to use all; default: all)
681 -E --max-complex-gap N
682 --haplotype-length N
683 Allow haplotype calls with contiguous embedded matches of up
684 to this length. (default: 3)
685 --min-repeat-size N
686 When assembling observations across repeats, require the total repeat
687 length at least this many bp. (default: 5)
688 --min-repeat-entropy N
689 To detect interrupted repeats, build across sequence until it has
690 entropy > N bits per bp. (default: 0, off)
691 --no-partial-observations
692 Exclude observations which do not fully span the dynamically-determined
693 detection window. (default, use all observations, dividing partial
694 support across matching haplotypes when generating haplotypes.)
695
696 Indel realignment::
697
698 -O --dont-left-align-indels
699 Turn off left-alignment of indels, which is enabled by default.
700
701 Input filters::
702
703 -4 --use-duplicate-reads
704 Include duplicate-marked alignments in the analysis.
705 default: exclude duplicates marked as such in alignments
706 -m --min-mapping-quality Q
707 Exclude alignments from analysis if they have a mapping
708 quality less than Q. default: 1
709 -q --min-base-quality Q
710 Exclude alleles from analysis if their supporting base
711 quality is less than Q. default: 0
712 -R --min-supporting-allele-qsum Q
713 Consider any allele in which the sum of qualities of supporting
714 observations is at least Q. default: 0
715 -Y --min-supporting-mapping-qsum Q
716 Consider any allele in which and the sum of mapping qualities of
717 supporting reads is at least Q. default: 0
718 -Q --mismatch-base-quality-threshold Q
719 Count mismatches toward --read-mismatch-limit if the base
720 quality of the mismatch is >= Q. default: 10
721 -U --read-mismatch-limit N
722 Exclude reads with more than N mismatches where each mismatch
723 has base quality >= mismatch-base-quality-threshold.
724 default: ~unbounded
725 -z --read-max-mismatch-fraction N
726 Exclude reads with more than N [0,1] fraction of mismatches where
727 each mismatch has base quality >= mismatch-base-quality-threshold
728 default: 1.0
729 -$ --read-snp-limit N
730 Exclude reads with more than N base mismatches, ignoring gaps
731 with quality >= mismatch-base-quality-threshold.
732 default: ~unbounded
733 -e --read-indel-limit N
734 Exclude reads with more than N separate gaps.
735 default: ~unbounded
736 -0 --standard-filters Use stringent input base and mapping quality filters
737 Equivalent to -m 30 -q 20 -R 0 -S 0
738 -F --min-alternate-fraction N
739 Require at least this fraction of observations supporting
740 an alternate allele within a single individual in the
741 in order to evaluate the position. default: 0.2
742 -C --min-alternate-count N
743 Require at least this count of observations supporting
744 an alternate allele within a single individual in order
745 to evaluate the position. default: 2
746 -3 --min-alternate-qsum N
747 Require at least this sum of quality of observations supporting
748 an alternate allele within a single individual in order
749 to evaluate the position. default: 0
750 -G --min-alternate-total N
751 Require at least this count of observations supporting
752 an alternate allele within the total population in order
753 to use the allele in analysis. default: 1
754 -! --min-coverage N
755 Require at least this coverage to process a site. default: 0
756
757 Population priors::
758
759 -k --no-population-priors
760 Equivalent to --pooled-discrete --hwe-priors-off and removal of
761 Ewens Sampling Formula component of priors.
762
763 Mappability priors::
764
765 -w --hwe-priors-off
766 Disable estimation of the probability of the combination
767 arising under HWE given the allele frequency as estimated
768 by observation frequency.
769 -V --binomial-obs-priors-off
770 Disable incorporation of prior expectations about observations.
771 Uses read placement probability, strand balance probability,
772 and read position (5'-3') probability.
773 -a --allele-balance-priors-off
774 Disable use of aggregate probability of observation balance between alleles
775 as a component of the priors.
776
777 Genotype likelihoods::
778
779 --observation-bias FILE
780 Read length-dependent allele observation biases from FILE.
781 The format is [length] [alignment efficiency relative to reference]
782 where the efficiency is 1 if there is no relative observation bias.
783 --base-quality-cap Q
784 Limit estimated observation quality by capping base quality at Q.
785 --experimental-gls
786 Generate genotype likelihoods using 'effective base depth' metric
787 qual = 1-BaseQual * 1-MapQual. Incorporate partial observations.
788 This is the default when contamination estimates are provided.
789 Optimized for diploid samples.
790 --prob-contamination F
791 An estimate of contamination to use for all samples. default: 10e-9
792 --contamination-estimates FILE
793 A file containing per-sample estimates of contamination, such as
794 those generated by VerifyBamID. The format should be:
795 sample p(read=R|genotype=AR) p(read=A|genotype=AA)
796 Sample '*' can be used to set default contamination estimates.
797
798 Algorithmic features::
799
800 --report-genotype-likelihood-max
801 Report genotypes using the maximum-likelihood estimate provided
802 from genotype likelihoods.
803 -B --genotyping-max-iterations N
804 Iterate no more than N times during genotyping step. default: 1000.
805 --genotyping-max-banddepth N
806 Integrate no deeper than the Nth best genotype by likelihood when
807 genotyping. default: 6.
808 -W --posterior-integration-limits N,M
809 Integrate all genotype combinations in our posterior space
810 which include no more than N samples with their Mth best
811 data likelihood. default: 1,3.
812 -N --exclude-unobserved-genotypes
813 Skip sample genotypings for which the sample has no supporting reads.
814 -S --genotype-variant-threshold N
815 Limit posterior integration to samples where the second-best
816 genotype likelihood is no more than log(N) from the highest
817 genotype likelihood for the sample. default: ~unbounded
818 -j --use-mapping-quality
819 Use mapping quality of alleles when calculating data likelihoods.
820 -H --harmonic-indel-quality
821 Use a weighted sum of base qualities around an indel, scaled by the
822 distance from the indel. By default use a minimum BQ in flanking sequence.
823 -D --read-dependence-factor N
824 Incorporate non-independence of reads by scaling successive
825 observations by this factor during data likelihood
826 calculations. default: 0.9
827 -= --genotype-qualities
828 Calculate the marginal probability of genotypes and report as GQ in
829 each sample field in the VCF output.
830
831
832 ------
833
834 **Citation**
835
836 For the underlying tool, please cite `Erik Garrison and Gabor Marth. Haplotype-based variant detection from short-read sequencing &lt;http://arxiv.org/abs/1207.3907&gt;`_.
837
838 The initial version of the wrapper was produced by Dan Blankenberg and upgraded by Anton Nekrutenko.
839
840 </help>
841
842 <citations>
843 <citation type="bibtex">@misc{1207.3907,
844 Author = {Erik Garrison},
845 Title = {Haplotype-based variant detection from short-read sequencing},
846 Year = {2012},
847 Eprint = {arXiv:1207.3907},
848 url = {http://arxiv.org/abs/1207.3907},
849 }</citation>
850 </citations>
851 </tool>