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