diff 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
line wrap: on
line diff
--- a/bcftools_filter.xml	Sun Aug 18 09:56:05 2024 +0000
+++ b/bcftools_filter.xml	Tue Dec 02 07:56:38 2025 +0000
@@ -4,11 +4,10 @@
         <token name="@EXECUTABLE@">filter</token>
         <import>macros.xml</import>
     </macros>
-    <expand macro="bio_tools" />
-    <expand macro="requirements" />
-    <expand macro="version_command" />
+    <expand macro="bio_tools"/>
+    <expand macro="requirements"/>
+    <expand macro="version_command"/>
     <command detect_errors="aggressive"><![CDATA[
-@PREPARE_ENV@
 @PREPARE_INPUT_FILE@
 #set $section = $sec_restrict
 @PREPARE_TARGETS_FILE@
@@ -51,16 +50,16 @@
 ]]>
     </command>
     <inputs>
-        <expand macro="macro_input" />
+        <expand macro="macro_input"/>
         <section name="sec_restrict" expanded="false" title="Restrict to">
-            <expand macro="macro_restrict" />
-            <expand macro="macro_restrict" type="target" label_type="Target" />
-            <expand macro="macro_include" />
-            <expand macro="macro_exclude" />
+            <expand macro="macro_region_restrict"/>
+            <expand macro="macro_target_restrict"/>
+            <expand macro="macro_include"/>
+            <expand macro="macro_exclude"/>
         </section>
         <section name="sec_filter" expanded="false" title="Filter Options">
-            <param name="SnpGap" type="integer" label="Snpgap" optional="True" help="(-g) Filter SNPs within &lt;int&gt; base pairs of an indel" />
-            <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" />
+            <param name="SnpGap" type="integer" label="Snpgap" optional="True" help="(-g) Filter SNPs within &lt;int&gt; base pairs of an indel"/>
+            <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"/>
             <param name="mode" type="select" label="Mode FILTER annotation" optional="true" multiple="true" display="checkboxes">
                 <help>(-m)
                  The default mode replaces existing filters of failed sites with a new FILTER string 
@@ -82,193 +81,233 @@
                            Annotate FILTER column with STRING or, with +, a unique filter name generated by the program ("Filter%d").
                         ]]></help>
                     </param>
-                    <expand macro="macro_restrict" type="mask" label_type="Mask"/>
+                    <expand macro="macro_mask_restrict"/>
                 </when>
             </conditional>
-
-            <param name="select_set_GTs" type="select" label="Set genotypes of failed samples"  optional="true" help="(-S)">
+            <param name="select_set_GTs" type="select" label="Set genotypes of failed samples" optional="true" help="(-S)">
                 <option value=".">to missing (.)</option>
                 <option value="0">to REF (0)</option>
             </param>
         </section>
-        <expand macro="macro_select_output_type" />
+        <expand macro="macro_select_output_type"/>
     </inputs>
     <outputs>
         <expand macro="macro_vcf_output"/>
     </outputs>
     <tests>
         <test>
-            <param name="input_file" ftype="vcf" value="filter.1.vcf" />
-            <param name="mode" value="x" />
-            <param name="SnpGap" value="2" />
-            <param name="IndelGap" value="2" />
-            <param name="output_type" value="v" />
+            <param name="input_file" ftype="vcf" value="filter.1.vcf"/>
+            <section name="sec_filter">
+                <param name="mode" value="x"/>
+            </section>
+            <section name="sec_filter">
+                <param name="SnpGap" value="2"/>
+                <param name="IndelGap" value="2"/>
+            </section>
+            <param name="output_type" value="v"/>
             <output name="output_file">
                 <assert_contents>
-                    <has_text text="PASS" />
-                    <not_has_text text="1006" />
+                    <has_text text="PASS"/>
+                    <not_has_text text="1006"/>
                 </assert_contents>
             </output>
         </test>
         <test>
-            <param name="input_file" ftype="vcf" value="filter.2.vcf" />
-            <param name="exclude" value="QUAL==59.2 || (INDEL=0 &amp; (FMT/GQ=25 | FMT/DP=10))" />
-            <param name="soft_filter" value="Modified" />
-            <param name="select_set_GTs" value="." />
-            <param name="output_type" value="v" />
+            <param name="input_file" ftype="vcf" value="filter.2.vcf"/>
+            <section name="sec_restrict">
+                <param name="exclude" value="QUAL==59.2 || (INDEL=0 &amp; (FMT/GQ=25 | FMT/DP=10))"/>
+            </section>
+            <section name="sec_filter">
+                <param name="mode" value="+"/>
+                <conditional name="conditional_soft_filter">
+                    <param name="selector" value="enabled"/>
+                    <param name="soft_filter" value="Modified"/>
+                </conditional>
+                <param name="select_set_GTs" value="."/>
+            </section>
+            <param name="output_type" value="v"/>
             <output name="output_file">
                 <assert_contents>
-                    <has_text text="genotypes" />
-                    <has_text text="AN=2;AC=1" />
-                    <has_text_matching expression="TAAAA\tTA,T\t61.5\tPASS" />
+                    <has_text text="genotypes"/>
+                    <has_text text="AN=2;AC=1"/>
+                    <has_text_matching expression="TAAAA\s.*TA,T\s.*61.5\s.*Modified.+"/>
                 </assert_contents>
             </output>
         </test>
         <test>
-            <param name="input_file" ftype="vcf" value="filter.3.vcf" />
-            <param name="exclude" value="INFO/DP=19" />
-            <param name="output_type" value="v" />
+            <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
+            <section name="sec_restrict">
+                <param name="exclude" value="INFO/DP=19"/>
+            </section>
+            <param name="output_type" value="v"/>
             <output name="output_file">
                 <assert_contents>
-                    <not_has_text text="3162006" />
-                    <has_text text="3162007" />
+                    <not_has_text text="3162006"/>
+                    <has_text text="3162007"/>
                 </assert_contents>
             </output>
         </test>
-
         <test>
-            <param name="input_file" ftype="vcf" value="filter.3.vcf" />
-            <param name="exclude" value="INFO/DP=19" />
+            <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
+            <section name="sec_restrict">
+                <param name="exclude" value="INFO/DP=19"/>
+            </section>
             <section name="sec_filter">
                 <conditional name="conditional_soft_filter">
                     <param name="selector" value="enabled"/>
-                    <param name="soft_filter" value="XX" />
+                    <param name="soft_filter" value="XX"/>
                 </conditional>
             </section>
-            <param name="output_type" value="v" />
+            <param name="output_type" value="v"/>
             <output name="output_file">
                 <assert_contents>
-                    <has_text_matching expression="\tXX\tDP=19" />
-                    <has_text_matching expression="\tq20\tAO" />
+                    <has_text_matching expression="\t238\tXX\tDP=19.+"/>
+                    <has_text_matching expression="\tq20\tAO.+"/>
                 </assert_contents>
             </output>
         </test>
         <test>
-            <param name="input_file" ftype="vcf" value="filter.3.vcf" />
-            <param name="exclude" value="INFO/DP=19" />
+            <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
+            <section name="sec_restrict">
+                <param name="exclude" value="INFO/DP=19"/>
+            </section>
             <section name="sec_filter">
+                <param name="mode" value="+"/>
                 <conditional name="conditional_soft_filter">
                     <param name="selector" value="enabled"/>
-                    <param name="soft_filter" value="XX" />
-                    <param name="mode" value="+" />
+                    <param name="soft_filter" value="XX"/>
                 </conditional>
             </section>
-            <param name="output_type" value="v" />
+            <param name="output_type" value="v"/>
             <output name="output_file">
                 <assert_contents>
-                    <has_text_matching expression="238\tXX\tDP=19" />
-                    <has_text_matching expression="\tq20\tAO" />
+                    <has_text_matching expression="238\tq20;XX\tDP=19"/>
+                    <has_text_matching expression="\tq20\tAO"/>
                 </assert_contents>
             </output>
         </test>
         <test>
-            <param name="input_file" ftype="vcf" value="filter.3.vcf" />
-            <param name="exclude" value="INFO/DP=19" />
+            <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
+            <section name="sec_restrict">
+                <param name="exclude" value="INFO/DP=19"/>
+            </section>
             <section name="sec_filter">
+                <param name="mode" value="+"/>
                 <conditional name="conditional_soft_filter">
                     <param name="selector" value="enabled"/>
-                    <param name="soft_filter" value="XX" />
-                    <param name="mode" value="+" />
+                    <param name="soft_filter" value="XX"/>
                 </conditional>
             </section>
-            <param name="output_type" value="v" />
+            <param name="output_type" value="v"/>
             <output name="output_file">
                 <assert_contents>
-                    <has_text_matching expression="\tXX\tDP=19" />
-                    <has_text_matching expression="\tq20\tAO=52101" />
+                    <has_text_matching expression="\tq20;XX\tDP=19"/>
+                    <has_text_matching expression="\tq20\tAO=52101"/>
                 </assert_contents>
             </output>
         </test>
         <test>
-            <param name="input_file" ftype="vcf" value="filter.3.vcf" />
-            <param name="exclude" value="INFO/DP=19" />
+            <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
+            <section name="sec_restrict">
+                <param name="exclude" value="INFO/DP=19"/>
+            </section>
             <section name="sec_filter">
+                <param name="mode" value="+"/>
                 <conditional name="conditional_soft_filter">
                     <param name="selector" value="enabled"/>
-                    <param name="soft_filter" value="XX" />
-                    <param name="mode" value="+" />
+                    <param name="soft_filter" value="XX"/>
                 </conditional>
             </section>
-            <param name="output_type" value="v" />
+            <param name="output_type" value="v"/>
             <output name="output_file">
                 <assert_contents>
-                    <has_text_matching expression="\t238\tXX\tDP=19" />
-                    <has_text_matching expression="\t238\tq20\tAO" />
+                    <has_text_matching expression="\t238\tq20;XX\tDP=19"/>
+                    <has_text_matching expression="\t238\tq20\tAO"/>
                 </assert_contents>
             </output>
         </test>
         <test>
-            <param name="input_file" ftype="vcf" value="filter.3.vcf" />
-            <param name="exclude" value="FMT/GT=&quot;0/2&quot;" />
-            <param name="output_type" value="v" />
+            <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
+            <section name="sec_restrict">
+                <param name="exclude" value="FMT/GT=&quot;0/2&quot;"/>
+            </section>
+            <param name="output_type" value="v"/>
             <output name="output_file">
                 <assert_contents>
-                    <not_has_text text="3162006" />
-                    <has_text text="3162007" />
+                    <not_has_text text="3162006"/>
+                    <has_text text="3162007"/>
                 </assert_contents>
             </output>
         </test>
         <test>
-            <param name="input_file" ftype="vcf" value="filter.2.vcf" />
-            <param name="include" value="FMT/GT=&quot;0/0&quot; &amp;&amp; AC[*]=2" />
-            <param name="output_type" value="v" />
+            <param name="input_file" ftype="vcf" value="filter.2.vcf"/>
+            <section name="sec_restrict">
+                <param name="include" value="FMT/GT=&quot;0/0&quot; &amp;&amp; AC[*]=2"/>
+            </section>
+            <param name="output_type" value="v"/>
             <output name="output_file">
                 <assert_contents>
-                    <has_text text="AN=4;AC=2" />
-                    <not_has_text text="AN=4;AC=0" />
+                    <has_text text="AN=4;AC=2"/>
+                    <not_has_text text="AN=4;AC=0"/>
                 </assert_contents>
             </output>
         </test>
         <!-- Test region overlap -->
         <test>
-            <param name="input_file" ftype="vcf" value="filter.2.vcf" />
-            <param name="include" value="FMT/GT=&quot;0/0&quot; &amp;&amp; AC[*]=2" />
-            <param name="output_type" value="v" />
+            <param name="input_file" ftype="vcf" value="filter.2.vcf"/>
+            <section name="sec_restrict">
+                <param name="include" value="FMT/GT=&quot;0/0&quot; &amp;&amp; AC[*]=2"/>
+            </section>
+            <param name="output_type" value="v"/>
             <section name="sec_restrict">
-                <param name="regions_overlap" value="1"/>
+                <conditional name="regions">
+                    <param name="regions_src" value="regions" />
+                    <repeat name="region_specs">
+                        <param name="chrom" value="1" />
+                    </repeat>
+                </conditional>
             </section>
             <output name="output_file">
                 <assert_contents>
-                    <has_text text="AN=4;AC=2" />
-                    <not_has_text text="AN=4;AC=0" />
+                    <has_text text="AN=4;AC=2"/>
+                    <not_has_text text="AN=4;AC=0"/>
                 </assert_contents>
             </output>
             <assert_command>
-                <has_text text="--regions-overlap" />
+                <has_text text="--regions-overlap"/>
             </assert_command>
         </test>
         <!-- Test mask options-->
         <test>
-            <param name="input_file" ftype="vcf" value="filter.3.vcf" />
-            <param name="exclude" value="INFO/DP=19" />
+            <param name="input_file" ftype="vcf" value="filter.3.vcf"/>
+            <section name="sec_restrict">
+                <param name="exclude" value="INFO/DP=19"/>
+            </section>
             <section name="sec_filter">
-                <param name="mode" value="+,x" />
+                <param name="mode" value="+,x"/>
                 <conditional name="conditional_soft_filter">
                     <param name="selector" value="enabled"/>
-                    <param name="soft_filter" value="XX" />
-                    <param name="masks_overlap" value="1"/>
+                    <param name="soft_filter" value="XX"/>
+                    <conditional name="masks">
+                        <param name="masks_src" value="masks" />
+                        <repeat name="mask_specs">
+                            <param name="chrom" value="1" />
+                            <param name="start" value="1" />
+                            <param name="stop" value="1000" />
+                        </repeat>
+                        <param name="masks_overlap" value="1"/>
+                    </conditional>
                 </conditional>
             </section>
-
-            <param name="output_type" value="v" />
+            <param name="output_type" value="v"/>
             <output name="output_file">
                 <assert_contents>
-                    <has_text_matching expression="\tq20;XX\tDP=19" />
-                    <has_text_matching expression="\tPASS\tAO" />
+                    <has_text_matching expression="\tq20;XX\tDP=19"/>
+                    <has_text_matching expression="\tPASS\tAO"/>
                 </assert_contents>
             </output>
             <assert_command>
-                <has_text text="--mask-overlap" />
+                <has_text text="--mask-overlap"/>
             </assert_command>
         </test>
     </tests>
@@ -286,8 +325,8 @@
 
 @BCFTOOLS_MANPAGE@#@EXECUTABLE@
 
-@BCFTOOLS_WIKI@
+@BCFTOOLS_HOWTOS@
 ]]>
     </help>
-    <expand macro="citations" />
+    <expand macro="citations"/>
 </tool>