changeset 4:6b935ab36d7b draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/vcflib/vcffilter commit bd03161519b5a55c4395ae9715688799319427b2
author iuc
date Mon, 26 Mar 2018 10:21:29 -0400
parents 952059348a30
children de885f4afb7f
files vcffilter.xml
diffstat 1 files changed, 55 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/vcffilter.xml	Fri Sep 30 10:35:47 2016 -0400
+++ b/vcffilter.xml	Mon Mar 26 10:21:29 2018 -0400
@@ -1,44 +1,72 @@
-<tool id="vcffilter2" name="VCFfilter:" version="@WRAPPER_VERSION@.0">
+<tool id="vcffilter2" name="VCFfilter:" version="@WRAPPER_VERSION@+galaxy1">
     <description>filter VCF data in a variety of attributes</description>
     <macros>
         <import>macros.xml</import>
     </macros>
     <expand macro="requirements">
-        <requirement type="package" version="1.3">htslib</requirement>
+        <requirement type="package" version="1.7">htslib</requirement>
     </expand>
     <expand macro="stdio" />
-    <command>
-        <!-- This tools depends on tabix functionality, which is currently distributed with Galaxy itself via a pysam egg -->
-        ln -s "${input1}" input1.vcf &amp;&amp;
-        bgzip input1.vcf &amp;&amp;
-        tabix -p vcf input1.vcf.gz &amp;&amp;
-        vcffilter ${filterList} input1.vcf.gz  > "${out_file1}"
-    </command>
-
+    <command><![CDATA[
+ln -s '$input1' input1.vcf &&
+bgzip input1.vcf &&
+tabix -p vcf input1.vcf.gz &&
+vcffilter
+#for $filter_el in $filter_repeat:
+    $filter_el.filter_type '$filter_el.filter_value'
+#end for
+$filter_sites
+$tag_pass
+$tag_fail
+$append_filter
+$allele_tag
+$invert
+$or
+#if str($region):
+    --region '$region'
+#end if
+input1.vcf.gz
+> '${out_file1}'
+    ]]></command>
     <inputs>
-        <param name="filterList" type="text" value="-f &quot;DP &gt; 10&quot;" label="Specify filterting expression" help="See explanation of filtering options below">
-            <sanitizer>
-                <valid initial="string.printable">
-                    <remove value="&apos;"/>
-                </valid>
-                <mapping initial="none">
-                    <add source="&apos;" target="__sq__"/>
-                </mapping>
-            </sanitizer>
-        </param>
-        <param format="vcf" name="input1" type="data" label="VCF dataset to filter"/>
+        <param name="input1" type="data" format="vcf" label="VCF dataset to filter"/>
+        <repeat name="filter_repeat" title="Add filters">
+            <param name="filter_type" type="select" label="Select the filter type">
+                <option value="-f">Info filter (-f)</option>
+                <option value="-g">Genotype filter (-g)</option>
+            </param>
+            <param name="filter_value" type="text" value="DP &gt; 10" label="Specify filterting value" help="See explanation of filtering options below">
+                <sanitizer>
+                    <valid initial="string.printable">
+                        <remove value="&apos;"/>
+                    </valid>
+                    <mapping initial="none">
+                        <add source="&apos;" target="__sq__"/>
+                    </mapping>
+                </sanitizer>
+            </param>
+        </repeat>
+        <param name="filter_sites" argument="--filter-sites" type="boolean" truevalue="--filter-sites" falsevalue="" label="Filter entire records, not just alleles"/>
+        <param name="tag_pass" argument="--tag-pass" type="boolean" truevalue="--tag-pass" falsevalue="" label="Tag vcf records as positively filtered with this tag, print all records"/>
+        <param name="tag_fail" argument="--tag-fail" type="boolean" truevalue="--tag-fail" falsevalue="" label="Tag vcf records as negatively filtered with this tag, print all records"/>
+        <param name="append_filter" argument="--append-filter" type="boolean" truevalue="--append-filter" falsevalue="" label="Append the existing filter tag, don't just replace it"/>
+        <param name="allele_tag" argument="--allele-tag" type="boolean" truevalue="--allele-tag" falsevalue="" label="Apply --tag-pass on a per-allele basis, adds or sets the corresponding INFO field tag"/>
+        <param argument="--invert" type="boolean" truevalue="--invert" falsevalue="" label="Inverts the filter, e.g. grep -v"/>
+        <param argument="--or" type="boolean" truevalue="--or" falsevalue="" label="Use logical OR instead of AND to combine filters"/>
+        <param argument="--region" type="text" label="Specify a region on which to target the filtering" help="Regions should be specified as chr:start-end, e.g X:1000-2000"/>
     </inputs>
     <outputs>
-        <data format="vcf" name="out_file1" />
+        <data name="out_file1" format="vcf" />
     </outputs>
     <tests>
         <test>
-            <param name="filterList" value="-f &quot;DP &gt; 10&quot;"/>
+            <param name="filter_repeat_0|filter_type" value="-f"/>
+            <param name="filter_repeat_0|filter_value" value="DP &gt; 10"/>
             <param name="input1" value="vcflib.vcf"/>
             <output name="out_file1" file="vcffilter-test1.vcf"/>
         </test>
     </tests>
-    <help>
+    <help><![CDATA[
 You can specify the following options within the **Specify filtering expression** box in any combination::
 
     -f, --info-filter     specifies a filter to apply to the info fields of records, removes alleles which do not pass the filter
@@ -60,8 +88,9 @@
 
 Any number of filters may be specified.  They are combined via logical AND unless the --or option is specified. For convenience, you can specify "QUAL" to refer to the quality of the site, even though it does not appear in the INFO fields.
 
-Operators can be any of: =, !, &lt;, &gt;, pipe, &amp;
+Operators can be any of::
 
+   =, !, <, >, |, &
 
 To restrict output to a specific location use the -r option (must be used in conjunction with -g or -f)::
 
@@ -71,6 +100,6 @@
 -----
 
 Vcffilter @IS_PART_OF_VCFLIB@
-    </help>
+    ]]></help>
     <expand macro="citations" />
 </tool>