0
|
1 <tool id="vcf_filter" name="VCF Filter">
|
|
2 <description>Extracts lines from a vcf variant file based on field-specific filters</description>
|
|
3 <version_command>mimodd version -q</version_command>
|
|
4 <command>
|
|
5 mimodd vcf-filter
|
|
6 "$inputfile"
|
|
7 -o "$outputfile"
|
|
8 #if len($datasets):
|
|
9 -s
|
|
10 #for $i in $datasets
|
|
11 "$i.sample"
|
|
12 #end for
|
|
13 --gt
|
|
14 #for $i in $datasets
|
|
15 ## remove whitespace from free-text input
|
|
16 "#echo ("".join($i.GT.split()) or "ANY")#"
|
|
17 #echo " "
|
|
18 #end for
|
|
19 --dp
|
|
20 #for $i in $datasets
|
|
21 "$i.DP"
|
|
22 #end for
|
|
23 --gq
|
|
24 #for $i in $datasets
|
|
25 "$i.GQ"
|
|
26 #end for
|
|
27 #end if
|
|
28 #if len($regions):
|
|
29 -r
|
|
30 #for $i in $regions
|
|
31 #if $i.stop:
|
|
32 "$i.chrom:$i.start-$i.stop"
|
|
33 #else:
|
|
34 "$i.chrom:$i.start"
|
|
35 #end if
|
|
36 #end for
|
|
37 #end if
|
|
38 #if $vfilter:
|
|
39 --vfilter
|
|
40 ## remove ',' (and possibly adjacent whitespace) and replace with ' '
|
|
41 "#echo ('" "'.join($vfilter.split(',')))#"
|
|
42 #end if
|
|
43 $vartype
|
|
44 </command>
|
|
45
|
|
46 <inputs>
|
|
47 <param name="inputfile" type="data" format="vcf" label="VCF input file" />
|
|
48 <repeat name="datasets" title="Sample-specific Filter" default="0" min="0">
|
|
49 <param name="sample" type="text" label="sample" help="name of a sample as it appears in the VCF input file and that indicates the sample that this filter should be applied to." />
|
|
50 <param name="GT" type="text" label="genotype pattern(s) for the inclusion of variants" help="keep only variants for which the genotype of the sample matches the specified pattern; format: x/x where x = 0 is wildtype and x = 1 is mutant. Multiple genotypes can be specified as a comma-separated list." />
|
|
51 <param name="DP" type="integer" label="depth of coverage for the sample at the variant site" value = "0" help="keep only variants with at least this sample-specific coverage at the variant site" />
|
|
52 <param name="GQ" type="integer" label="genotype quality for the variant in the sample" value = "0" help="keep only variants for which the genotype prediction for the sample has at least this quality" />
|
|
53 </repeat>
|
|
54 <repeat name="regions" title="Region Filter" default="0" min="0" help = "Filter variant sites by their position in the genome. If multiple Region Filters are specified, all variants that fall in ONE of the regions are reported.">
|
|
55 <param name="chrom" type="text" label="Chromosome" />
|
|
56 <param name="start" type="text" label="Region Start" />
|
|
57 <param name="stop" type="text" label="Region End" />
|
|
58 </repeat>
|
|
59 <param name="vartype" type="select" label="Select the types of variants to include in the output">
|
|
60 <option value="">all types of variants</option>
|
|
61 <option value="--no-indels">exclude indels</option>
|
|
62 <option value="--indels-only">only indels</option>
|
|
63 </param>
|
|
64 <param name="vfilter" type="text" label="sample" help="Filter output by sample name; only the sample-specific columns with their sample name matching any of the comma separated filters will be retained in the output." />
|
|
65 </inputs>
|
|
66
|
|
67 <outputs>
|
|
68 <data name="outputfile" format="vcf" />
|
|
69 </outputs>
|
|
70
|
|
71 <help>
|
|
72 .. class:: infomark
|
|
73
|
|
74 **What it does**
|
|
75
|
|
76 The tool filters a variant file in VCF format to generate a new VCF file with only a subset of the original variants.
|
|
77
|
|
78 The following types of variant filters can be set up:
|
|
79
|
|
80 1) Sample-specific filters:
|
|
81
|
|
82 Filter variants based on their characteristics in the sequenced reads of a specific sample. Multiple sample-specific filters are combined by logical AND, i.e., only variants that pass ALL sample-specific filters are kept.
|
|
83
|
|
84 2) Region filters:
|
|
85
|
|
86 Filter variants based on the genomic region they affect. Multiple region filters are combined by logical OR, i.e., variants passing ANY region filter are kept.
|
|
87
|
|
88 3) Variant type filter:
|
|
89
|
|
90 Filter variants by their type, i.e. whether they are single nucleotide variations (SNVs) or indels
|
|
91
|
|
92 In addition, the *sample* filter can be used to reduce the samples encoded in a multi-sample VCF file to just those specified by the filter.
|
|
93 The *sample* filter is included mainly for compatibility reasons: if an external tool cannot deal with the multisample file format, but instead looks only at the first sample-specific column of the file, you can use the filter to turn the multi-sample file into a single-sample file. Besides, the filter can also be used to change the order of the samples since it will sort the samples in the order specified in the filter field.
|
|
94
|
|
95 **Examples of sample-specific filters:**
|
|
96
|
|
97 *Simple genotype pattern*
|
|
98
|
|
99 genotype pattern: 1/1 ==> keep all variants in the vcf input file for which the specified sample's genotype is homozygous mutant
|
|
100
|
|
101 *Complex genotype pattern*
|
|
102
|
|
103 genotype pattern: 0/1, 0/0 ==> keep all variants for which the sample's genotype is either heterozygous or homozygous wildtype
|
|
104
|
|
105 *Multiple sample-specific filters*
|
|
106
|
|
107 Filter 1: genotype pattern: 0/0, Filter 2: genotype pattern 1/1:
|
|
108 ==> keep all variants for which the first sample's gentoype is homozygous wildtype **and** the second sample's genotype is homozygous mutant
|
|
109
|
|
110 *Combining sample-specific filter criteria*
|
|
111
|
|
112 genotype pattern: 1/1, depth of coverage: 3, genotype quality: 9
|
|
113 ==> keep variants for which the sample's genotype is homozygous mutant **and** for which this genotype assignment is corroborated by a genotype quality score of at least 9
|
|
114 **and** at least three reads from the sample cover the variant site
|
|
115
|
|
116 **TIP:**
|
|
117
|
|
118 As in the example above, genotype quality is typically most useful in combination with a genotype pattern.
|
|
119 It acts then, effectively, to make the genotype filter more stringent.
|
|
120
|
|
121
|
|
122
|
|
123 </help>
|
|
124 </tool>
|