diff filter_vcf.xml @ 0:cb29f95c7b88 draft

Uploaded
author ulfschaefer
date Mon, 09 May 2016 09:27:06 -0400
parents
children 74f595df6e51
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filter_vcf.xml	Mon May 09 09:27:06 2016 -0400
@@ -0,0 +1,112 @@
+<tool id="filter_vcf" name="Filter VCF" version="1.0">
+  <description>filters a VCF file</description>
+  <requirements>
+    <requirement type="package" version="2.7.10">python</requirement>
+    <requirement type="package" version="0.6.8dev">pyvcf</requirement>
+    <requirement type="package" version="3.11">pyyaml</requirement>
+    <requirement type="package" version="2.0.2">bintrees</requirement>
+	<requirement type="package" version="1.66">biopython</requirement>
+	<requirement type="package" version="1.4">matplotlib</requirement>
+	<requirement type="package" version="0.23.1">cython</requirement>
+	<requirement type="package" version="1.0">phephenix</requirement>
+  </requirements>
+  <stdio>
+    <!-- Assume anything other than zero is an error -->
+    <exit_code range="1:" />
+    <exit_code range=":-1" />
+  </stdio>
+  <command interpreter="bash">
+    filter_vcf.sh
+	$output
+	$input
+    #if str($onlygood) == "false":
+		onlygood
+	#else
+		NOTTHERE
+	#end if
+	#for $sf in $snp_filter:
+		#for $name, $param in $sf.snp_filter_type.iteritems():
+			#if $name not in [ "__current_case__", "snp_filter_type_selector" ]:
+				${name}:"${param}"
+			#end if
+		#end for
+	#end for
+  </command>
+
+  <inputs>
+    <param name="input" type="data" format="vcf" label="VCF File to filter" />
+
+    <repeat name="snp_filter" title="SNP Filter" help="">
+        <conditional name="snp_filter_type">
+			<param name="snp_filter_type_selector" type="select" label="SNP Filter Type">
+				<option value="gq_score_option">GQ score</option>
+				<option value="dp4_ratio_option">DP4 ratio</option>
+				<option value="ad_ratio_option">AD ratio</option>
+				<option value="mq_score_option">MQ score</option>
+				<option value="min_depth_option">Minimum depth</option>
+				<option value="uncall_gt_option">Uncall GT</option>
+				<option value="mq0_ratio_option">MQ0 ratio</option>
+				<option value="qual_score_option">Quality score</option>
+				<option value="mq0f_ratio_option">MQ0F ratio</option>
+            </param>
+			<when value="gq_score_option">
+				<param name="gq_score" type="integer" value="0" label="Minimum GC score" help="Type integer"/>
+			</when>
+			<when value="dp4_ratio_option">
+				<param name="dp4_ratio" type="float" value="0.9" label="Minimum DP4 ratio" help="Type float"/>
+			</when>
+			<when value="ad_ratio_option">
+				<param name="ad_ratio" type="float" value="0.9" label="Minimum AD ratio" help="Type float"/>
+			</when>
+			<when value="mq_score_option">
+				<param name="mq_score" type="integer" value="30" label="Minimum MQ score" help="Type integer"/>
+			</when>
+			<when value="min_depth_option">
+				<param name="min_depth" type="integer" value="5" label="Minimum depth" help="Type integer"/>
+			</when>
+			<when value="uncall_gt_option">
+				<param name="uncall_gt" type="text" value="" hidden="True"/>
+			</when>
+			<when value="mq0_ratio_option">
+				<param name="mq0_ratio" type="float" value="0.05" label="Minimim MQ0 ratio" help="Type float"/>
+			</when>
+			<when value="qual_score_option">
+				<param name="qual_score" type="integer" value="30" label="Minimim quality score" help="Type integer"/>
+			</when>
+			<when value="mq0f_ratio_option">
+				<param name="mq0f_ratio" type="float" value="0.05" label="Minimum MQ0F ratio" help="Type float"/>
+			</when>
+		</conditional>
+    </repeat>
+	<param name="onlygood" type="select" label="Write only good variants to output" help="Write only variants that PASS all filters. ">
+			<option value="true" selected="true">Write all</option>
+			<option value="false">Write only good</option>
+    </param>
+  </inputs>
+
+  <outputs>
+    <data format="vcf" name="output" label="${tool.name} on ${on_string}: filtered VCF" />
+  </outputs>
+    <tests>
+        <test>
+            <param name="input" value="test_input.vcf" ftype="vcf" />
+            <param name="min_depth" value="100" />
+            <output name="output" file="test_output.vcf" ftype="vcf" />
+        </test>
+    </tests>
+  <help>
+
+usage: filter_vcf.py [-h] \-\-vcf VCF \-\-filters FILTERS \-\-output OUTPUT
+
+optional arguments:
+
+-h, \-\-help            show this help message and exit
+
+\-\-vcf VCF, -v VCF     VCF file to (re)filter.
+
+\-\-filters FILTERS, -f FILTERS	Filter(s) to apply as key:threshold pairs, separated by comma.
+
+\-\-output OUTPUT, -o OUTPUT	Location for filtered VCF to be written.
+
+  </help>
+</tool>