Mercurial > repos > iuc > bcftools_cnv
comparison bcftools_cnv.xml @ 8:13fe14c56f6d draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bcftools commit e648d86d550ddf2eb67237752320c390b3a780e5
author | iuc |
---|---|
date | Wed, 05 Jun 2019 13:19:54 -0400 |
parents | bf1f4994f104 |
children | b2d1b7dda2b7 |
comparison
equal
deleted
inserted
replaced
7:bf1f4994f104 | 8:13fe14c56f6d |
---|---|
1 <?xml version='1.0' encoding='utf-8'?> | 1 <?xml version='1.0' encoding='utf-8'?> |
2 <tool name="bcftools @EXECUTABLE@" id="bcftools_@EXECUTABLE@" version="@TOOL_VERSION@"> | 2 <tool name="bcftools @EXECUTABLE@" id="bcftools_@EXECUTABLE@" version="@TOOL_VERSION@+galaxy1"> |
3 <description>Copy number variation caller, requires Illumina's B-allele frequency (BAF) and Log R Ratio intensity (LRR)</description> | 3 <description>Call copy number variation from VCF B-allele frequency (BAF) and Log R Ratio intensity (LRR) values</description> |
4 <macros> | 4 <macros> |
5 <token name="@EXECUTABLE@">cnv</token> | 5 <token name="@EXECUTABLE@">cnv</token> |
6 <import>macros.xml</import> | 6 <import>macros.xml</import> |
7 </macros> | 7 </macros> |
8 <expand macro="requirements" /> | 8 <expand macro="requirements"> |
9 <expand macro="matplotlib_requirement" /> | |
10 </expand> | |
9 <expand macro="version_command" /> | 11 <expand macro="version_command" /> |
10 <command detect_errors="aggressive"><![CDATA[ | 12 <command detect_errors="aggressive"><![CDATA[ |
11 @PREPARE_ENV@ | 13 @PREPARE_ENV@ |
12 @PREPARE_INPUT_FILE@ | 14 @PREPARE_INPUT_FILE@ |
13 #set $section = $sec_restrict | 15 #set $section = $sec_restrict |
14 @PREPARE_TARGETS_FILE@ | 16 @PREPARE_TARGETS_FILE@ |
15 @PREPARE_REGIONS_FILE@ | 17 @PREPARE_REGIONS_FILE@ |
16 | 18 |
17 bcftools @EXECUTABLE@ | 19 bcftools @EXECUTABLE@ |
18 | 20 |
19 --output-dir cnv_tmp | 21 #set $output_dir = 'cnv_tmp' |
22 --output-dir $output_dir | |
20 | 23 |
21 ## General section | 24 ## General section |
22 #set $section = $sec_general | 25 #set $query_sample = str($query_sample).strip() |
23 #if $section.control_sample: | 26 #set $control_sample = str($control_sample).strip() |
24 --control-sample "${section.control_sample}" | 27 #if $control_sample: |
25 #end if | 28 -c '$control_sample' |
26 #if $section.query_sample: | 29 #end if |
27 --query-sample "${section.query_sample}" | 30 #if $query_sample: |
31 -s '$query_sample' | |
28 #end if | 32 #end if |
29 @AF_FILE@ | 33 @AF_FILE@ |
30 | 34 #if str($plotting.generate_plots) != 'none': |
31 #if $section.plot_threshold: | 35 -p ${plotting.plot_threshold} |
32 --plot-threshold "${section.plot_threshold}" | |
33 #end if | 36 #end if |
34 | 37 |
35 ## HMM section | 38 ## HMM section |
36 #set $section = $sec_hmm | 39 #set $section = $sec_hmm |
37 #if $section.aberrant_query or $section.aberrant_control: | 40 --aberrant "${section.aberrant_query},${section.aberrant_control}" |
38 #set $query_val = #if $section.aberrant_query then $section.aberrant_query else '1.0'# | 41 #if str($section.aberrant_optimization.do_optimize) == 'yes': |
39 #set $control_val = #if $section.aberrant_control then $section.aberrant_control else '1.0'# | 42 --optimize ${section.aberrant_optimization.lower_bound} |
40 --aberrant "${query_val},${control_val}" | 43 #end if |
41 #end if | 44 --BAF-weight ${section.score_usage.baf_weight} |
42 #if $section.BAF_weight: | 45 --BAF-dev "${section.score_usage.baf_dev_query},${section.score_usage.baf_dev_control}" |
43 --BAF-weight "${section.BAF_weight}" | 46 --LRR-weight ${section.score_usage.lrr_weight} |
44 #end if | 47 #if str($section.score_usage.compute_on) == 'baf+lrr': |
45 #if $section.BAF_dev_query or $section.BAF_dev_control: | 48 --LRR-dev "${section.score_usage.lrr_dev_query},${section.score_usage.lrr_dev_control}" |
46 #set $query_val = #if $section.BAF_dev_query then $section.BAF_dev_query else '1.0'# | 49 --LRR-smooth-win ${section.score_usage.lrr_smooth_win} |
47 #set $control_val = #if $section.BAF_dev_control then $section.BAF_dev_control else '1.0'# | |
48 --BAF-dev "${query_val},${control_val}" | |
49 #end if | |
50 #if $section.LRR_weight: | |
51 --LRR-weight "${section.LRR_weight}" | |
52 #end if | |
53 #if $section.LRR_dev_query or $section.LRR_dev_control: | |
54 #set $query_val = #if $section.LRR_dev_query then $section.LRR_dev_query else '1.0'# | |
55 #set $control_val = #if $section.LRR_dev_control then $section.LRR_dev_control else '1.0'# | |
56 --LRR-dev "${query_val},${control_val}" | |
57 #end if | |
58 #if $section.LRR_smooth_win: | |
59 --LRR-smooth-win "${section.LRR_smooth_win}" | |
60 #end if | |
61 #if $section.optimize: | |
62 --optimize "${section.optimize}" | |
63 #end if | 50 #end if |
64 #if $section.same_prob: | 51 #if $section.same_prob: |
65 --same-prob "${section.same_prob}" | 52 --same-prob ${section.same_prob} |
66 #end if | 53 #end if |
67 #if $section.err_prob: | 54 #if $section.err_prob: |
68 --err-prob "${section.err_prob}" | 55 --err-prob ${section.err_prob} |
69 #end if | 56 #end if |
70 #if $section.xy_prob: | 57 #if $section.xy_prob: |
71 --xy-prob "${section.xy_prob}" | 58 --xy-prob ${section.xy_prob} |
72 #end if | 59 #end if |
73 | 60 |
74 ## Filter section | 61 ## Filter section |
75 #set $section = $sec_restrict | 62 #set $section = $sec_restrict |
76 @REGIONS@ | 63 @REGIONS@ |
77 @TARGETS@ | 64 @TARGETS@ |
78 | 65 |
79 ## Primary Input/Outputs | 66 ## Primary Input/Outputs |
80 @INPUT_FILE@ | 67 @INPUT_FILE@ |
81 && mv $output_dir/cn.*.tab "$output_cn" | 68 |
82 && mv $output_dir/dat.*.tab "$output_dat" | 69 && mv $output_dir/cn.*.tab '$output_cn' |
83 && mv $output_dir/summary.*.tab "$output_summary" | 70 #if $control_sample: |
84 ## && python $output_dir/plot.*.py | 71 && mv ${output_dir}/summary.tab '$output_summary' |
72 #else: | |
73 && mv ${output_dir}/summary.*.tab '$output_summary' | |
74 #end if | |
75 | |
76 #if str($plotting.generate_plots) != 'none': | |
77 ## collect all generated plots and embed them in html as base-64 encoded data | |
78 && (echo '<html><body><head><title>Copy-number variation plots (bcftools cnv)</title><style type="text/css"> | |
79 @media print { | |
80 img { | |
81 max-width:100% !important; | |
82 page-break-inside: avoid; | |
83 } | |
84 </style>' > $output_plots; | |
85 for plot in $output_dir/*.png; do | |
86 [ -f "\$plot" ] || break; | |
87 echo '<div><img src="data:image/png;base64,' >> $output_plots; | |
88 python -m base64 \$plot >> $output_plots; | |
89 echo '" /></div><hr>' >> $output_plots; | |
90 done; | |
91 echo '</body></html>' >> $output_plots;) | |
92 #end if | |
93 | |
85 ]]> | 94 ]]> |
86 </command> | 95 </command> |
87 <inputs> | 96 <inputs> |
88 <param name="output_dir" type="hidden" value="cnv_tmp"/> | |
89 <expand macro="macro_input" /> | 97 <expand macro="macro_input" /> |
98 <param argument="-s" name="query_sample" type="text" label="Query Sample" optional="True" help="The name (as used in the input) of the query sample in the input. Can be ommitted if, and only if, there is only one sample in the input." /> | |
99 <param argument="-c" name="control_sample" type="text" label="Control Sample" optional="True" help="The name (as used in the input) of an optional control sample to compare against. Note: The pairwise calling mode represents the real strength of the tool as it helps to reduce the number of false calls and also allows one to distinguish between normal and novel copy number variation." /> | |
100 <expand macro="macro_AF_file" /> | |
101 <conditional name="plotting"> | |
102 <param name="generate_plots" type="select" label="Plot results?"> | |
103 <option value="all">Yes, plot results for all chromosomes</option> | |
104 <option value="some">Yes, but plot only chromosomes with above-threshold quality of CNV status estimate</option> | |
105 <option value="none">No, do not generate plots</option> | |
106 </param> | |
107 <when value="all"> | |
108 <param name="plot_threshold" type="hidden" value="0" /> | |
109 </when> | |
110 <when value="some"> | |
111 <param argument="-p" name="plot_threshold" type="float" value="0" | |
112 label="Plot Threshold" | |
113 help="Plot aberrant chromosomes with quality at least 'float'" /> | |
114 </when> | |
115 <when value="none" /> | |
116 </conditional> | |
90 <section name="sec_restrict" expanded="false" title="Restrict to"> | 117 <section name="sec_restrict" expanded="false" title="Restrict to"> |
91 <expand macro="macro_regions" /> | 118 <expand macro="macro_restrict" /> |
92 <expand macro="macro_targets" /> | 119 <expand macro="macro_restrict" type="target" label_type="Target" /> |
93 </section> | |
94 <param name="reference_fasta" type="data" format="fasta" label="Reference Fasta" /> | |
95 <section name="sec_general" expanded="true" title="General Options"> | |
96 <param name="query_sample" type="text" label="Query Sample" optional="True" help="Query samply name" /> | |
97 <param name="control_sample" type="text" label="Control Sample" optional="True" help="Optional control sample name to highlight differences" /> | |
98 <expand macro="macro_AF_file" /> | |
99 <param name="plot_threshold" type="float" label="Plot Threshold" optional="True" help="Plot aberrant chromosomes with quality at least 'float'" /> | |
100 </section> | 120 </section> |
101 <section name="sec_hmm" expanded="false" title="HMM Options"> | 121 <section name="sec_hmm" expanded="false" title="HMM Options"> |
102 <param name="err_prob" type="float" value="1e-4" label="Err Prob" optional="True" help="Uniform error probability" /> | 122 <param argument="--aberrant" name="aberrant_query" type="float" value="1" min="0" max="1" |
103 <param name="optimize" type="float" value="" min="0." max="1." label="Optimize" optional="True" > | 123 label="Estimated purity of the query sample" |
124 help="Estimate of the fractional contribution of the desired query tissue to the (possibly control-contaminated) query sample (default: 1 = no contamination with control tissue)" /> | |
125 <param argument="--aberrant" name="aberrant_control" type="float" value="1" min="0" max="1" | |
126 label="Estimated purity of the control sample" | |
127 help="Estimate of the fractional contribution of the desired control tissue to the (possibly query-contaminated) control sample (default: 1 = no contamination with query tissue)" /> | |
128 <conditional name="aberrant_optimization"> | |
129 <param name="do_optimize" type="select" | |
130 label="Adjust sample purity estimates based on data?" | |
131 help="Instead of treating your specified estimates of the sample purities as fixed values, the tool can use them as starting values for an iterative optimization that tries to estimate the sample purities from the data. Note: With estimate optimization enabled the final estimates will be reported as cell fraction (CF) estimates in the summary report."> | |
132 <option value="no">No, leave sample purities as specified</option> | |
133 <option value="yes">Yes, adjust purity estimates</option> | |
134 </param> | |
135 <when value="no" /> | |
136 <when value="yes"> | |
137 <param argument="--optimize" name="lower_bound" type="float" value="0.3" min="1e-9" max="1" | |
138 label="Lower bound for adjusted estimate" | |
139 help="Constrains the final adjusted purity estimates not to be smaller than this value." /> | |
140 </when> | |
141 </conditional> | |
142 <conditional name="score_usage"> | |
143 <param name="compute_on" type="select" label="Use BAF and LRR annotations to call CNVs?" | |
144 help="Using LRR information in addition to BAF values is the default and helps in dealing with random noise in the data. However, the tool is also able to call CNVs from BAF values alone in case your input does not feature LRR information."> | |
145 <option value="baf+lrr">Yes (requires input with both BAF and LRR subfields)</option> | |
146 <option value="baf">No, use BAF values exclusively</option> | |
147 </param> | |
148 <when value="baf+lrr"> | |
149 <param argument="--BAF-weight" name="baf_weight" type="float" value="1" min="0" max="1" | |
150 label="Baf Weight" help="relative contribution from BAF" /> | |
151 | |
152 <param argument="--BAF-dev" name="baf_dev_query" type="float" value="0.04" min="0" max="1" | |
153 label="Query sample BAF deviation" | |
154 help="Expected BAF deviation in the query sample (default: 0.04)" /> | |
155 <param argument="--BAF-dev" name="baf_dev_control" type="float" value="0.04" min="0" max="1" | |
156 label="Control sample BAF deviation" | |
157 help="Expected BAF deviation in the control sample (default: 0.04)" /> | |
158 | |
159 <param argument="--LRR-weight" name="lrr_weight" type="float" value="0.2" min="0" max="1" | |
160 label="LRR Weight" | |
161 help="Relative contribution from LRR. This option can have a big effect on the number of calls produced. With truly random noise (such as in simulated data), the value should be set high (1.0), but in the presence of systematic noise when LRR values are not informative, lower values result in cleaner calls (default: 0.2)." /> | |
162 <param argument="--LRR-dev" name="lrr_dev_query" type="float" value="0.2" min="0" max="1" | |
163 label="Query sample LRR Deviation" | |
164 help="Expected LRR deviation in the query sample (default: 0.2)" /> | |
165 <param argument="--LRR-dev" name="lrr_dev_control" type="float" value="0.2" min="0" max="1" | |
166 label="Control sample LRR Deviation" | |
167 help="Expected LRR deviation in the control sample (default: 0.2)" /> | |
168 <param argument="--LRR-smooth-win" name="lrr_smooth_win" type="integer" value="10" | |
169 label="LRR Smoothing Window" | |
170 help="Window of LRR moving average smoothing (default: 10)" /> | |
171 </when> | |
172 <when value="baf"> | |
173 <param argument="--BAF-dev" name="baf_dev_query" type="float" value="0.04" min="0" max="1" | |
174 label="Query sample BAF deviation" | |
175 help="Expected BAF deviation in the query sample (default: 0.04)" /> | |
176 <param argument="--BAF-dev" name="baf_dev_control" type="float" value="0.04" min="0" max="1" | |
177 label="Control sample BAF deviation" | |
178 help="Expected BAF deviation in the control sample (default: 0.04)" /> | |
179 <param name="baf_weight" type="hidden" value="1" /> | |
180 <param name="lrr_weight" type="hidden" value="0" /> | |
181 </when> | |
182 </conditional> | |
183 <param argument="--err-prob" name="err_prob" type="float" value="1e-4" label="Err Prob" help="Uniform error probability" /> | |
184 <param argument="--same-prob" name="same_prob" type="float" value="0.5" min="0" max="1" label="Same Prob"> | |
104 <help> | 185 <help> |
105 Iteratively estimate the fraction of aberrant cells, down to the given fraction. | 186 The prior probability of the query and the control sample being the same. |
106 Lowering this value from the default 1.0 to say, 0.3, can help discover more events but also increases noise. | 187 Setting to 0 calls both independently, setting to 1 forces the same copy number state in both. (default: 0.5) |
107 </help> | 188 </help> |
108 </param> | 189 </param> |
109 <param name="same_prob" type="float" value="" min="0." max="1." label="Same Prob" optional="True"> | 190 <param argument="--xy-prob" name="xy_prob" type="float" min="0." max="1." label="Xy Prob" value="1e-9"> |
110 <help> | |
111 The prior probability of the query and the control sample being the same. | |
112 Setting to 0 calls both independently, setting to 1 forces the same copy number state in both. | |
113 </help> | |
114 </param> | |
115 <param name="xy_prob" type="float" min="0." max="1." label="Xy Prob" value="1e-9" optional="True"> | |
116 <help> | 191 <help> |
117 The HMM probability of transition to another copy number state. | 192 The HMM probability of transition to another copy number state. |
118 Increasing this value leads to smaller and more frequent calls. | 193 Increasing this value leads to smaller and more frequent calls. |
119 </help> | 194 </help> |
120 </param> | 195 </param> |
121 | |
122 <param name="aberrant_query" type="float" value="" min="0." max="1." label="Aberrant Query" optional="true" | |
123 help="Fraction of aberrant cells in query, defaults to 1." /> | |
124 <param name="aberrant_control" type="float" value="" min="0." max="1." label="Aberrant Control" optional="true" | |
125 help="Fraction of aberrant cells in control, defaults to 1." /> | |
126 <param name="BAF_weight" type="float" value="1." min="0." max="1." label="Baf Weight" optional="True" help="relative contribution from BAF" /> | |
127 | |
128 <param name="BAF_dev_query" type="float" value="" min="0." max="1." label="Baf Query Deviation" optional="true" | |
129 help="Expected BAF deviation in query, defaults to: 0.04" /> | |
130 <param name="BAF_dev_control" type="float" value="" min="0." max="1." label="Baf Control Deviation" optional="true" | |
131 help="Expected BAF deviation in control, defaults to: 0.04" /> | |
132 | |
133 <param name="LRR_weight" type="float" label="LRR Weight" optional="True" > | |
134 <help> | |
135 Relative contribution from LRR. | |
136 With noisy data, this option can have big effect on the number of calls produced. | |
137 In truly random noise (such as in simulated data), the value should be set high (1.0), i | |
138 but in the presence of systematic noise when LRR are not informative, lower values result in cleaner calls (0.2). | |
139 </help> | |
140 </param> | |
141 <param name="LRR_dev_query" type="float" value="" min="0." max="1." label="LRR Query Deviation" | |
142 help="Expected LRR deviation in query, default is: 0.2" /> | |
143 <param name="LRR_dev_control" type="float" value="" min="0." max="1." label="LRR Control Deviation" | |
144 help="Expected LRR deviation in control, default is: 0.2" /> | |
145 <param name="LRR_smooth_win" type="integer" label="Lrr Smooth Win" value="10" optional="True" | |
146 help="Window of LRR moving average smoothing" /> | |
147 | |
148 </section> | 196 </section> |
149 </inputs> | 197 </inputs> |
150 <outputs> | 198 <outputs> |
151 <data name="output_cn" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.cn"/> | 199 <data name="output_cn" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.cn"/> |
152 <data name="output_dat" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.dat"/> | |
153 <data name="output_summary" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.summary"/> | 200 <data name="output_summary" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.summary"/> |
154 <!-- add plot output --> | 201 <data name="output_plots" format="html" label="${input_file.name.rsplit('.',1)[0]}.plots"> |
155 <!-- script has png per chr, html of images or collect into pdf? | 202 <filter>plotting['generate_plots'] != 'none'</filter> |
156 <data name="output_plots" format="" /> | 203 </data> |
157 --> | |
158 </outputs> | 204 </outputs> |
159 <tests /> | 205 <tests> |
206 <test expect_num_outputs="3"> | |
207 <param name="input_file" ftype="vcf" value="cnv.vcf" /> | |
208 <output name="output_summary" file="cnv_summary.tab" compare="re_match" /> | |
209 </test> | |
210 <test expect_num_outputs="2"> | |
211 <param name="input_file" ftype="vcf" value="cnv.vcf" /> | |
212 <conditional name="plotting"> | |
213 <param name="generate_plots" value="none" /> | |
214 </conditional> | |
215 <output name="output_summary" file="cnv_summary.tab" compare="re_match" /> | |
216 </test> | |
217 <test expect_num_outputs="3"> | |
218 <param name="input_file" ftype="vcf" value="cnv.vcf" /> | |
219 <param name="query_sample" value="test" /> | |
220 <param name="control_sample" value="test" /> | |
221 <output name="output_summary" file="cnv_pairwise_summary.tab" compare="re_match" /> | |
222 </test> | |
223 <test expect_num_outputs="2"> | |
224 <param name="input_file" ftype="vcf" value="cnv_baf_only.vcf" /> | |
225 <conditional name="plotting"> | |
226 <param name="generate_plots" value="none" /> | |
227 </conditional> | |
228 <conditional name="score_usage"> | |
229 <param name="compute_on" value="baf" /> | |
230 </conditional> | |
231 <output name="output_summary" file="cnv_summary.tab" compare="re_match" /> | |
232 </test> | |
233 </tests> | |
160 <help><![CDATA[ | 234 <help><![CDATA[ |
161 ===================================== | 235 ===================================== |
162 bcftools @EXECUTABLE@ | 236 bcftools @EXECUTABLE@ |
163 ===================================== | 237 ===================================== |
164 | 238 |