0
|
1 <tool id="vcftools_annotate" name="Annotate" version="0.1">
|
|
2 <description>a VCF dataset with custom filters</description>
|
|
3
|
|
4 <requirements>
|
|
5 <requirement type="binary">echo</requirement>
|
|
6 <requirement type="package" version="0.1.11">vcftools</requirement>
|
|
7 </requirements>
|
|
8
|
|
9 <command>
|
|
10 ## Generate filter file.
|
|
11 echo "{ tag => '${tag}', name => '${filter}', desc => '${description}', test => sub { my @t = split('%', @\\$MATCH[0]); return @t[0] $condition ? \\$PASS : \\$FAIL }, }," > f.txt ;
|
|
12
|
|
13 ## Annotate.
|
|
14 vcf-annotate -f f.txt ${input} > ${output}
|
|
15 </command>
|
|
16 <inputs>
|
|
17 <param name="input" label="Input" type="data" format="vcf"/>
|
|
18 <param name="tag" label="Tag name" type="text"/>
|
|
19 <param name="description" label="Tag description" type="text">
|
|
20 <sanitizer sanitize="False"/>
|
|
21 </param>
|
|
22 <param name="filter" label="Filter name" type="text"/>
|
|
23 <param name="condition" label="Filter condition" type="text">
|
|
24 <sanitizer sanitize="False"/>
|
|
25 </param>
|
|
26 </inputs>
|
|
27
|
|
28 <outputs>
|
|
29 <data name="output" format="vcf"/>
|
|
30 </outputs>
|
|
31
|
|
32 <stdio>
|
|
33 <regex match=".*" source="both" level="log" description="tool progress"/>
|
|
34 </stdio>
|
|
35
|
|
36 <tests>
|
|
37 <test>
|
|
38 <param name="input" value="test_in1.vcf" />
|
|
39 <param name="tag" value="FORMAT/FREQ" />
|
|
40 <param name="description" value="MinAF [7]"/>
|
|
41 <param name="filter" value="MinAF" />
|
|
42 <param name="condition" value=">= 7" />
|
|
43 <!-- 2 lines diff because command line with full file path is included in output VCF, and
|
|
44 it not possible to match full file path. -->
|
|
45 <output name="output" file="test_out1.vcf" lines_diff="2" />
|
|
46 </test>
|
|
47 </tests>
|
|
48
|
|
49 <help>
|
|
50 Annotates VCF dataset with custom annotations. For example, if this format tag is used for allele frequency:
|
|
51
|
|
52 ##FORMAT=<ID=FREQ,Number=1,Type=String,Description="Variant allele frequency">
|
|
53
|
|
54 you can add a filter for allele frequency using "FORMAT/FREQ" as the tag name and the condition ">= [desired allele freq]"
|
|
55
|
|
56 Please see the VCFtools `documentation`__ for help and further information.
|
|
57
|
|
58 .. __: http://vcftools.sourceforge.net/perl_module.html#vcf-annotate
|
|
59 </help>
|
|
60 </tool>
|