10
|
1 <tool id="filter_vcf" name="Filter VCF" version="1.0">
|
|
2 <description>filters a VCF file</description>
|
|
3 <requirements>
|
|
4 <requirement type="package" version="2.7.10">python</requirement>
|
|
5 <requirement type="package" version="0.6.8dev">pyvcf</requirement>
|
|
6 <requirement type="package" version="3.11">pyyaml</requirement>
|
|
7 </requirements>
|
|
8 <stdio>
|
|
9 <!-- Assume anything other than zero is an error -->
|
|
10 <exit_code range="1:" />
|
|
11 <exit_code range=":-1" />
|
|
12 </stdio>
|
|
13 <command interpreter="bash">
|
|
14 filter_vcf.sh
|
|
15 $output
|
|
16 $input
|
|
17 #for $sf in $snp_filter:
|
|
18 #for $name, $param in $sf.snp_filter_type.iteritems():
|
|
19 #if $name not in [ "__current_case__", "snp_filter_type_selector" ]:
|
|
20 ${name}:"${param}"
|
|
21 #end if
|
|
22 #end for
|
|
23 #end for
|
|
24 </command>
|
|
25
|
|
26 <inputs>
|
|
27 <param name="input" type="data" format="vcf" label="VCF File to filter" />
|
|
28
|
|
29 <repeat name="snp_filter" title="SNP Filter" help="">
|
|
30 <conditional name="snp_filter_type">
|
|
31 <param name="snp_filter_type_selector" type="select" label="SNP Filter Type">
|
|
32 <option value="gq_score_option">GQ score</option>
|
|
33 <option value="dp4_ratio_option">DP4 ratio</option>
|
|
34 <option value="ad_ratio_option">AD ratio</option>
|
|
35 <option value="mq_score_option">MQ score</option>
|
|
36 <option value="min_depth_option">Minimum depth</option>
|
|
37 <option value="uncall_gt_option">Uncall GT</option>
|
|
38 <option value="mq0_ratio_option">MQ0 ratio</option>
|
|
39 <option value="qual_score_option">Quality score</option>
|
|
40 <option value="mq0f_ratio_option">MQ0F ratio</option>
|
|
41 </param>
|
|
42 <when value="gq_score_option">
|
|
43 <param name="gq_score" type="integer" value="0" label="Minimum GC score" help="Type integer"/>
|
|
44 </when>
|
|
45 <when value="dp4_ratio_option">
|
|
46 <param name="dp4_ratio" type="float" value="0.9" label="Minimum DP4 ratio" help="Type float"/>
|
|
47 </when>
|
|
48 <when value="ad_ratio_option">
|
|
49 <param name="ad_ratio" type="float" value="0.9" label="Minimum AD ratio" help="Type float"/>
|
|
50 </when>
|
|
51 <when value="mq_score_option">
|
|
52 <param name="mq_score" type="integer" value="30" label="Minimum MQ score" help="Type integer"/>
|
|
53 </when>
|
|
54 <when value="min_depth_option">
|
|
55 <param name="min_depth" type="integer" value="5" label="Minimum depth" help="Type integer"/>
|
|
56 </when>
|
|
57 <when value="uncall_gt_option">
|
|
58 <param name="uncall_gt" type="text" value="" hidden="True"/>
|
|
59 </when>
|
|
60 <when value="mq0_ratio_option">
|
|
61 <param name="mq0_ratio" type="float" value="0.05" label="Minimim MQ0 ratio" help="Type float"/>
|
|
62 </when>
|
|
63 <when value="qual_score_option">
|
|
64 <param name="qual_score" type="integer" value="30" label="Minimim quality score" help="Type integer"/>
|
|
65 </when>
|
|
66 <when value="mq0f_ratio_option">
|
|
67 <param name="mq0f_ratio" type="float" value="0.05" label="Minimum MQ0F ratio" help="Type float"/>
|
|
68 </when>
|
|
69 </conditional>
|
|
70 </repeat>
|
|
71
|
|
72 </inputs>
|
|
73
|
|
74 <outputs>
|
|
75 <data format="vcf" name="output" label="${tool.name} on ${on_string}: filtered VCF" />
|
|
76 </outputs>
|
|
77 <tests>
|
|
78 <test>
|
|
79 <param name="input" value="test_input.vcf" ftype="vcf" />
|
|
80 <param name="min_depth" value="100" />
|
|
81 <output name="output" file="test_output.vcf" ftype="vcf" />
|
|
82 </test>
|
|
83 </tests>
|
|
84 <help>
|
|
85
|
|
86 usage: filter_vcf.py [-h] \-\-vcf VCF \-\-filters FILTERS \-\-output OUTPUT
|
|
87
|
|
88 optional arguments:
|
|
89
|
|
90 -h, \-\-help show this help message and exit
|
|
91
|
|
92 \-\-vcf VCF, -v VCF VCF file to (re)filter.
|
|
93
|
|
94 \-\-filters FILTERS, -f FILTERS Filter(s) to apply as key:threshold pairs, separated by comma.
|
|
95
|
|
96 \-\-output OUTPUT, -o OUTPUT Location for filtered VCF to be written.
|
|
97
|
|
98 </help>
|
|
99 </tool>
|