comparison bcftools_filter.xml @ 25:5d8b9dd955c6 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/bcftools commit f6efda26965eb73c9107d367fd5ffdf246ed0dbc
author iuc
date Tue, 02 Dec 2025 07:56:38 +0000
parents 0bb5f14a9955
children
comparison
equal deleted inserted replaced
24:0bb5f14a9955 25:5d8b9dd955c6
2 <description>Apply fixed-threshold filters</description> 2 <description>Apply fixed-threshold filters</description>
3 <macros> 3 <macros>
4 <token name="@EXECUTABLE@">filter</token> 4 <token name="@EXECUTABLE@">filter</token>
5 <import>macros.xml</import> 5 <import>macros.xml</import>
6 </macros> 6 </macros>
7 <expand macro="bio_tools" /> 7 <expand macro="bio_tools"/>
8 <expand macro="requirements" /> 8 <expand macro="requirements"/>
9 <expand macro="version_command" /> 9 <expand macro="version_command"/>
10 <command detect_errors="aggressive"><![CDATA[ 10 <command detect_errors="aggressive"><![CDATA[
11 @PREPARE_ENV@
12 @PREPARE_INPUT_FILE@ 11 @PREPARE_INPUT_FILE@
13 #set $section = $sec_restrict 12 #set $section = $sec_restrict
14 @PREPARE_TARGETS_FILE@ 13 @PREPARE_TARGETS_FILE@
15 @PREPARE_REGIONS_FILE@ 14 @PREPARE_REGIONS_FILE@
16 15
49 @INPUT_FILE@ 48 @INPUT_FILE@
50 > '$output_file' 49 > '$output_file'
51 ]]> 50 ]]>
52 </command> 51 </command>
53 <inputs> 52 <inputs>
54 <expand macro="macro_input" /> 53 <expand macro="macro_input"/>
55 <section name="sec_restrict" expanded="false" title="Restrict to"> 54 <section name="sec_restrict" expanded="false" title="Restrict to">
56 <expand macro="macro_restrict" /> 55 <expand macro="macro_region_restrict"/>
57 <expand macro="macro_restrict" type="target" label_type="Target" /> 56 <expand macro="macro_target_restrict"/>
58 <expand macro="macro_include" /> 57 <expand macro="macro_include"/>
59 <expand macro="macro_exclude" /> 58 <expand macro="macro_exclude"/>
60 </section> 59 </section>
61 <section name="sec_filter" expanded="false" title="Filter Options"> 60 <section name="sec_filter" expanded="false" title="Filter Options">
62 <param name="SnpGap" type="integer" label="Snpgap" optional="True" help="(-g) Filter SNPs within &lt;int&gt; base pairs of an indel" /> 61 <param name="SnpGap" type="integer" label="Snpgap" optional="True" help="(-g) Filter SNPs within &lt;int&gt; base pairs of an indel"/>
63 <param name="IndelGap" type="integer" label="Indelgap" optional="True" help="(-G) Filter clusters of indels separated by &lt;int&gt; or fewer base pairs allowing only one to pass" /> 62 <param name="IndelGap" type="integer" label="Indelgap" optional="True" help="(-G) Filter clusters of indels separated by &lt;int&gt; or fewer base pairs allowing only one to pass"/>
64 <param name="mode" type="select" label="Mode FILTER annotation" optional="true" multiple="true" display="checkboxes"> 63 <param name="mode" type="select" label="Mode FILTER annotation" optional="true" multiple="true" display="checkboxes">
65 <help>(-m) 64 <help>(-m)
66 The default mode replaces existing filters of failed sites with a new FILTER string 65 The default mode replaces existing filters of failed sites with a new FILTER string
67 while leaving sites which pass untouched when non-empty 66 while leaving sites which pass untouched when non-empty
68 and setting to "PASS" when the FILTER string is absent. 67 and setting to "PASS" when the FILTER string is absent.
80 <param argument="--soft-filter" type="text" value="" label="Soft Filter" optional="true"> 79 <param argument="--soft-filter" type="text" value="" label="Soft Filter" optional="true">
81 <help><![CDATA[ (-s) 80 <help><![CDATA[ (-s)
82 Annotate FILTER column with STRING or, with +, a unique filter name generated by the program ("Filter%d"). 81 Annotate FILTER column with STRING or, with +, a unique filter name generated by the program ("Filter%d").
83 ]]></help> 82 ]]></help>
84 </param> 83 </param>
85 <expand macro="macro_restrict" type="mask" label_type="Mask"/> 84 <expand macro="macro_mask_restrict"/>
86 </when> 85 </when>
87 </conditional> 86 </conditional>
88 87 <param name="select_set_GTs" type="select" label="Set genotypes of failed samples" optional="true" help="(-S)">
89 <param name="select_set_GTs" type="select" label="Set genotypes of failed samples" optional="true" help="(-S)">
90 <option value=".">to missing (.)</option> 88 <option value=".">to missing (.)</option>
91 <option value="0">to REF (0)</option> 89 <option value="0">to REF (0)</option>
92 </param> 90 </param>
93 </section> 91 </section>
94 <expand macro="macro_select_output_type" /> 92 <expand macro="macro_select_output_type"/>
95 </inputs> 93 </inputs>
96 <outputs> 94 <outputs>
97 <expand macro="macro_vcf_output"/> 95 <expand macro="macro_vcf_output"/>
98 </outputs> 96 </outputs>
99 <tests> 97 <tests>
100 <test> 98 <test>
101 <param name="input_file" ftype="vcf" value="filter.1.vcf" /> 99 <param name="input_file" ftype="vcf" value="filter.1.vcf"/>
102 <param name="mode" value="x" /> 100 <section name="sec_filter">
103 <param name="SnpGap" value="2" /> 101 <param name="mode" value="x"/>
104 <param name="IndelGap" value="2" /> 102 </section>
105 <param name="output_type" value="v" /> 103 <section name="sec_filter">
106 <output name="output_file"> 104 <param name="SnpGap" value="2"/>
107 <assert_contents> 105 <param name="IndelGap" value="2"/>
108 <has_text text="PASS" /> 106 </section>
109 <not_has_text text="1006" /> 107 <param name="output_type" value="v"/>
110 </assert_contents> 108 <output name="output_file">
111 </output> 109 <assert_contents>
112 </test> 110 <has_text text="PASS"/>
113 <test> 111 <not_has_text text="1006"/>
114 <param name="input_file" ftype="vcf" value="filter.2.vcf" /> 112 </assert_contents>
115 <param name="exclude" value="QUAL==59.2 || (INDEL=0 &amp; (FMT/GQ=25 | FMT/DP=10))" /> 113 </output>
116 <param name="soft_filter" value="Modified" /> 114 </test>
117 <param name="select_set_GTs" value="." /> 115 <test>
118 <param name="output_type" value="v" /> 116 <param name="input_file" ftype="vcf" value="filter.2.vcf"/>
119 <output name="output_file"> 117 <section name="sec_restrict">
120 <assert_contents> 118 <param name="exclude" value="QUAL==59.2 || (INDEL=0 &amp; (FMT/GQ=25 | FMT/DP=10))"/>
121 <has_text text="genotypes" /> 119 </section>
122 <has_text text="AN=2;AC=1" /> 120 <section name="sec_filter">
123 <has_text_matching expression="TAAAA\tTA,T\t61.5\tPASS" /> 121 <param name="mode" value="+"/>
124 </assert_contents> 122 <conditional name="conditional_soft_filter">
125 </output> 123 <param name="selector" value="enabled"/>
126 </test> 124 <param name="soft_filter" value="Modified"/>
127 <test> 125 </conditional>
128 <param name="input_file" ftype="vcf" value="filter.3.vcf" /> 126 <param name="select_set_GTs" value="."/>
129 <param name="exclude" value="INFO/DP=19" /> 127 </section>
130 <param name="output_type" value="v" /> 128 <param name="output_type" value="v"/>
131 <output name="output_file"> 129 <output name="output_file">
132 <assert_contents> 130 <assert_contents>
133 <not_has_text text="3162006" /> 131 <has_text text="genotypes"/>
134 <has_text text="3162007" /> 132 <has_text text="AN=2;AC=1"/>
135 </assert_contents> 133 <has_text_matching expression="TAAAA\s.*TA,T\s.*61.5\s.*Modified.+"/>
136 </output> 134 </assert_contents>
137 </test> 135 </output>
138 136 </test>
139 <test> 137 <test>
140 <param name="input_file" ftype="vcf" value="filter.3.vcf" /> 138 <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
141 <param name="exclude" value="INFO/DP=19" /> 139 <section name="sec_restrict">
142 <section name="sec_filter"> 140 <param name="exclude" value="INFO/DP=19"/>
143 <conditional name="conditional_soft_filter"> 141 </section>
144 <param name="selector" value="enabled"/> 142 <param name="output_type" value="v"/>
145 <param name="soft_filter" value="XX" /> 143 <output name="output_file">
146 </conditional> 144 <assert_contents>
147 </section> 145 <not_has_text text="3162006"/>
148 <param name="output_type" value="v" /> 146 <has_text text="3162007"/>
149 <output name="output_file"> 147 </assert_contents>
150 <assert_contents> 148 </output>
151 <has_text_matching expression="\tXX\tDP=19" /> 149 </test>
152 <has_text_matching expression="\tq20\tAO" /> 150 <test>
153 </assert_contents> 151 <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
154 </output> 152 <section name="sec_restrict">
155 </test> 153 <param name="exclude" value="INFO/DP=19"/>
156 <test> 154 </section>
157 <param name="input_file" ftype="vcf" value="filter.3.vcf" /> 155 <section name="sec_filter">
158 <param name="exclude" value="INFO/DP=19" /> 156 <conditional name="conditional_soft_filter">
159 <section name="sec_filter"> 157 <param name="selector" value="enabled"/>
160 <conditional name="conditional_soft_filter"> 158 <param name="soft_filter" value="XX"/>
161 <param name="selector" value="enabled"/> 159 </conditional>
162 <param name="soft_filter" value="XX" /> 160 </section>
163 <param name="mode" value="+" /> 161 <param name="output_type" value="v"/>
164 </conditional> 162 <output name="output_file">
165 </section> 163 <assert_contents>
166 <param name="output_type" value="v" /> 164 <has_text_matching expression="\t238\tXX\tDP=19.+"/>
167 <output name="output_file"> 165 <has_text_matching expression="\tq20\tAO.+"/>
168 <assert_contents> 166 </assert_contents>
169 <has_text_matching expression="238\tXX\tDP=19" /> 167 </output>
170 <has_text_matching expression="\tq20\tAO" /> 168 </test>
171 </assert_contents> 169 <test>
172 </output> 170 <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
173 </test> 171 <section name="sec_restrict">
174 <test> 172 <param name="exclude" value="INFO/DP=19"/>
175 <param name="input_file" ftype="vcf" value="filter.3.vcf" /> 173 </section>
176 <param name="exclude" value="INFO/DP=19" /> 174 <section name="sec_filter">
177 <section name="sec_filter"> 175 <param name="mode" value="+"/>
178 <conditional name="conditional_soft_filter"> 176 <conditional name="conditional_soft_filter">
179 <param name="selector" value="enabled"/> 177 <param name="selector" value="enabled"/>
180 <param name="soft_filter" value="XX" /> 178 <param name="soft_filter" value="XX"/>
181 <param name="mode" value="+" /> 179 </conditional>
182 </conditional> 180 </section>
183 </section> 181 <param name="output_type" value="v"/>
184 <param name="output_type" value="v" /> 182 <output name="output_file">
185 <output name="output_file"> 183 <assert_contents>
186 <assert_contents> 184 <has_text_matching expression="238\tq20;XX\tDP=19"/>
187 <has_text_matching expression="\tXX\tDP=19" /> 185 <has_text_matching expression="\tq20\tAO"/>
188 <has_text_matching expression="\tq20\tAO=52101" /> 186 </assert_contents>
189 </assert_contents> 187 </output>
190 </output> 188 </test>
191 </test> 189 <test>
192 <test> 190 <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
193 <param name="input_file" ftype="vcf" value="filter.3.vcf" /> 191 <section name="sec_restrict">
194 <param name="exclude" value="INFO/DP=19" /> 192 <param name="exclude" value="INFO/DP=19"/>
195 <section name="sec_filter"> 193 </section>
196 <conditional name="conditional_soft_filter"> 194 <section name="sec_filter">
197 <param name="selector" value="enabled"/> 195 <param name="mode" value="+"/>
198 <param name="soft_filter" value="XX" /> 196 <conditional name="conditional_soft_filter">
199 <param name="mode" value="+" /> 197 <param name="selector" value="enabled"/>
200 </conditional> 198 <param name="soft_filter" value="XX"/>
201 </section> 199 </conditional>
202 <param name="output_type" value="v" /> 200 </section>
203 <output name="output_file"> 201 <param name="output_type" value="v"/>
204 <assert_contents> 202 <output name="output_file">
205 <has_text_matching expression="\t238\tXX\tDP=19" /> 203 <assert_contents>
206 <has_text_matching expression="\t238\tq20\tAO" /> 204 <has_text_matching expression="\tq20;XX\tDP=19"/>
207 </assert_contents> 205 <has_text_matching expression="\tq20\tAO=52101"/>
208 </output> 206 </assert_contents>
209 </test> 207 </output>
210 <test> 208 </test>
211 <param name="input_file" ftype="vcf" value="filter.3.vcf" /> 209 <test>
212 <param name="exclude" value="FMT/GT=&quot;0/2&quot;" /> 210 <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
213 <param name="output_type" value="v" /> 211 <section name="sec_restrict">
214 <output name="output_file"> 212 <param name="exclude" value="INFO/DP=19"/>
215 <assert_contents> 213 </section>
216 <not_has_text text="3162006" /> 214 <section name="sec_filter">
217 <has_text text="3162007" /> 215 <param name="mode" value="+"/>
218 </assert_contents> 216 <conditional name="conditional_soft_filter">
219 </output> 217 <param name="selector" value="enabled"/>
220 </test> 218 <param name="soft_filter" value="XX"/>
221 <test> 219 </conditional>
222 <param name="input_file" ftype="vcf" value="filter.2.vcf" /> 220 </section>
223 <param name="include" value="FMT/GT=&quot;0/0&quot; &amp;&amp; AC[*]=2" /> 221 <param name="output_type" value="v"/>
224 <param name="output_type" value="v" /> 222 <output name="output_file">
225 <output name="output_file"> 223 <assert_contents>
226 <assert_contents> 224 <has_text_matching expression="\t238\tq20;XX\tDP=19"/>
227 <has_text text="AN=4;AC=2" /> 225 <has_text_matching expression="\t238\tq20\tAO"/>
228 <not_has_text text="AN=4;AC=0" /> 226 </assert_contents>
227 </output>
228 </test>
229 <test>
230 <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
231 <section name="sec_restrict">
232 <param name="exclude" value="FMT/GT=&quot;0/2&quot;"/>
233 </section>
234 <param name="output_type" value="v"/>
235 <output name="output_file">
236 <assert_contents>
237 <not_has_text text="3162006"/>
238 <has_text text="3162007"/>
239 </assert_contents>
240 </output>
241 </test>
242 <test>
243 <param name="input_file" ftype="vcf" value="filter.2.vcf"/>
244 <section name="sec_restrict">
245 <param name="include" value="FMT/GT=&quot;0/0&quot; &amp;&amp; AC[*]=2"/>
246 </section>
247 <param name="output_type" value="v"/>
248 <output name="output_file">
249 <assert_contents>
250 <has_text text="AN=4;AC=2"/>
251 <not_has_text text="AN=4;AC=0"/>
229 </assert_contents> 252 </assert_contents>
230 </output> 253 </output>
231 </test> 254 </test>
232 <!-- Test region overlap --> 255 <!-- Test region overlap -->
233 <test> 256 <test>
234 <param name="input_file" ftype="vcf" value="filter.2.vcf" /> 257 <param name="input_file" ftype="vcf" value="filter.2.vcf"/>
235 <param name="include" value="FMT/GT=&quot;0/0&quot; &amp;&amp; AC[*]=2" /> 258 <section name="sec_restrict">
236 <param name="output_type" value="v" /> 259 <param name="include" value="FMT/GT=&quot;0/0&quot; &amp;&amp; AC[*]=2"/>
237 <section name="sec_restrict"> 260 </section>
238 <param name="regions_overlap" value="1"/> 261 <param name="output_type" value="v"/>
239 </section> 262 <section name="sec_restrict">
240 <output name="output_file"> 263 <conditional name="regions">
241 <assert_contents> 264 <param name="regions_src" value="regions" />
242 <has_text text="AN=4;AC=2" /> 265 <repeat name="region_specs">
243 <not_has_text text="AN=4;AC=0" /> 266 <param name="chrom" value="1" />
267 </repeat>
268 </conditional>
269 </section>
270 <output name="output_file">
271 <assert_contents>
272 <has_text text="AN=4;AC=2"/>
273 <not_has_text text="AN=4;AC=0"/>
244 </assert_contents> 274 </assert_contents>
245 </output> 275 </output>
246 <assert_command> 276 <assert_command>
247 <has_text text="--regions-overlap" /> 277 <has_text text="--regions-overlap"/>
248 </assert_command> 278 </assert_command>
249 </test> 279 </test>
250 <!-- Test mask options--> 280 <!-- Test mask options-->
251 <test> 281 <test>
252 <param name="input_file" ftype="vcf" value="filter.3.vcf" /> 282 <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
253 <param name="exclude" value="INFO/DP=19" /> 283 <section name="sec_restrict">
254 <section name="sec_filter"> 284 <param name="exclude" value="INFO/DP=19"/>
255 <param name="mode" value="+,x" /> 285 </section>
256 <conditional name="conditional_soft_filter"> 286 <section name="sec_filter">
257 <param name="selector" value="enabled"/> 287 <param name="mode" value="+,x"/>
258 <param name="soft_filter" value="XX" /> 288 <conditional name="conditional_soft_filter">
259 <param name="masks_overlap" value="1"/> 289 <param name="selector" value="enabled"/>
260 </conditional> 290 <param name="soft_filter" value="XX"/>
261 </section> 291 <conditional name="masks">
262 292 <param name="masks_src" value="masks" />
263 <param name="output_type" value="v" /> 293 <repeat name="mask_specs">
264 <output name="output_file"> 294 <param name="chrom" value="1" />
265 <assert_contents> 295 <param name="start" value="1" />
266 <has_text_matching expression="\tq20;XX\tDP=19" /> 296 <param name="stop" value="1000" />
267 <has_text_matching expression="\tPASS\tAO" /> 297 </repeat>
298 <param name="masks_overlap" value="1"/>
299 </conditional>
300 </conditional>
301 </section>
302 <param name="output_type" value="v"/>
303 <output name="output_file">
304 <assert_contents>
305 <has_text_matching expression="\tq20;XX\tDP=19"/>
306 <has_text_matching expression="\tPASS\tAO"/>
268 </assert_contents> 307 </assert_contents>
269 </output> 308 </output>
270 <assert_command> 309 <assert_command>
271 <has_text text="--mask-overlap" /> 310 <has_text text="--mask-overlap"/>
272 </assert_command> 311 </assert_command>
273 </test> 312 </test>
274 </tests> 313 </tests>
275 <help><![CDATA[ 314 <help><![CDATA[
276 ===================================== 315 =====================================
284 @EXPRESSIONS_HELP@ 323 @EXPRESSIONS_HELP@
285 324
286 325
287 @BCFTOOLS_MANPAGE@#@EXECUTABLE@ 326 @BCFTOOLS_MANPAGE@#@EXECUTABLE@
288 327
289 @BCFTOOLS_WIKI@ 328 @BCFTOOLS_HOWTOS@
290 ]]> 329 ]]>
291 </help> 330 </help>
292 <expand macro="citations" /> 331 <expand macro="citations"/>
293 </tool> 332 </tool>