annotate snpSift_filter.xml @ 0:e8adfc4c0a6b draft

Uploaded
author iuc
date Wed, 11 Dec 2013 08:53:32 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
1 <tool id="snpSift_filter" name="SnpSift Filter" version="3.4">
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
2 <options sanitize="False" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
3 <description>Filter variants using arbitrary expressions</description>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
4 <expand macro="requirements" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
5 <macros>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
6 <import>snpEff_macros.xml</import>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
7 </macros>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
8 <command>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
9 java -Xmx6G -jar \$SNPEFF_JAR_PATH/SnpSift.jar filter -f $input -e $exprFile $inverse
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
10 #if $filtering.mode == 'field':
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
11 #if $filtering.replace.pass:
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
12 --pass
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
13 #if $filtering.replace.filterId and len($filtering.replace.filterId.__str__.strip()) > 0:
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
14 --filterId "$filtering.replace.filterId"
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
15 #end if
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
16 #end if
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
17 #if $filtering.addFilter and len($filtering.addFilter.__str__.strip()) > 0:
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
18 --addFilter "$filtering.addFilter"
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
19 #end if
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
20 #if $filtering.rmFilter and len($filtering.rmFilter.__str__.strip()) > 0:
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
21 --rmFilter "$filtering.rmFilter"
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
22 #end if
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
23 #end if
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
24 > $output
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
25 </command>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
26 <inputs>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
27 <param format="vcf" name="input" type="data" label="Variant input file in VCF format"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
28 <param name="expr" type="text" label="Filter criteria" size="160" help="Need help? See below a few examples." />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
29 <param name="inverse" type="boolean" truevalue="--inverse" falsevalue="" checked="false" label="Inverse filter" help="Show lines that do not match filter expression" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
30 <conditional name="filtering">
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
31 <param name="mode" type="select" label="Filter mode">
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
32 <option value="entries" selected="true">Retain entries that pass filter, remove other entries</option>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
33 <option value="field">Change the FILTER field, but retain all entries</option>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
34 </param>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
35 <when value="entries"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
36 <when value="field">
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
37 <conditional name="replace">
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
38 <param name="pass" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Set matching entry FILTER to 'PASS'"
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
39 help="appends an ID tag to non-matching entry FILTER "/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
40 <when value="no"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
41 <when value="yes">
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
42 <param name="filterId" type="text" value="" optional="true" label="ID appended to non-matching (##FILTER tag in header and FILTER VCF field)." size="10"
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
43 help="Default ID is 'SnpSift'"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
44 </when>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
45 </conditional>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
46 <param name="addFilter" type="text" value="" optional="true" label="Add a string to FILTER VCF field if 'expression' is true." size="10"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
47 <param name="rmFilter" type="text" value="" optional="true" label="Remove a string from FILTER VCF field if 'expression' is true (and 'str' is in the field)." size="10"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
48 </when>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
49 </conditional>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
50 </inputs>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
51 <configfiles>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
52 <configfile name="exprFile">
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
53 $expr
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
54 </configfile>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
55 </configfiles>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
56
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
57 <outputs>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
58 <data format="vcf" name="output" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
59 </outputs>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
60 <expand macro="stdio" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
61 <tests>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
62 <test>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
63 <param name="input" ftype="vcf" value="test01.vcf"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
64 <param name="expr" value="QUAL >= 50"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
65 <param name="mode" value="entries"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
66 <output name="output">
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
67 <assert_contents>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
68 <has_text text="28837706" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
69 <not_has_text text="NT_166464" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
70 </assert_contents>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
71 </output>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
72 </test>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
73
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
74 <test>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
75 <param name="input" ftype="vcf" value="test01.vcf"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
76 <param name="expr" value="(CHROM = '19')"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
77 <param name="mode" value="entries"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
78 <output name="output">
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
79 <assert_contents>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
80 <has_text text="3205820" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
81 <not_has_text text="NT_16" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
82 </assert_contents>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
83 </output>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
84 </test>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
85
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
86 <test>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
87 <param name="input" ftype="vcf" value="test01.vcf"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
88 <param name="expr" value="(POS >= 20175) &amp; (POS &lt;= 35549)"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
89 <param name="mode" value="entries"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
90 <output name="output">
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
91 <assert_contents>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
92 <has_text text="20175" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
93 <has_text text="35549" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
94 <has_text text="22256" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
95 <not_has_text text="18933" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
96 <not_has_text text="37567" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
97 </assert_contents>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
98 </output>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
99 </test>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
100
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
101 <test>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
102 <param name="input" ftype="vcf" value="test01.vcf"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
103 <param name="expr" value="( DP >= 5 )"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
104 <param name="mode" value="entries"/>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
105 <output name="output">
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
106 <assert_contents>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
107 <has_text text="DP=5;" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
108 <has_text text="DP=6;" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
109 <not_has_text text="DP=1;" />
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
110 </assert_contents>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
111 </output>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
112 </test>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
113 </tests>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
114 <help>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
115
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
116 **SnpSift filter**
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
117
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
118 You can filter ia vcf file using arbitrary expressions, for instance "(QUAL > 30) | (exists INDEL) | ( countHet() > 2 )". The actual expressions can be quite complex, so it allows for a lot of flexibility.
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
119
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
120 Some examples:
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
121
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
122 - *I want to filter out samples with quality less than 30*:
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
123
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
124 * **( QUAL &gt; 30 )**
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
125
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
126 - *...but we also want InDels that have quality 20 or more*:
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
127
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
128 * **(( exists INDEL ) &amp; (QUAL >= 20)) | (QUAL >= 30 )**
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
129
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
130 - *...or any homozygous variant present in more than 3 samples*:
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
131
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
132 * **(countHom() > 3) | (( exists INDEL ) &amp; (QUAL >= 20)) | (QUAL >= 30 )**
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
133
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
134 - *...or any heterozygous sample with coverage 25 or more*:
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
135
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
136 * **((countHet() > 0) &amp; (DP >= 25)) | (countHom() > 3) | (( exists INDEL ) &amp; (QUAL >= 20)) | (QUAL >= 30 )**
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
137
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
138 - *I want to keep samples where the genotype for the first sample is homozygous variant and the genotype for the second sample is reference*:
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
139
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
140 * **isHom( GEN[0] ) &amp; isVariant( GEN[0] ) &amp; isRef( GEN[1] )**
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
141
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
142
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
143 @EXTERNAL_DOCUMENTATION@
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
144
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
145 @CITATION_SECTION@
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
146
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
147 </help>
e8adfc4c0a6b Uploaded
iuc
parents:
diff changeset
148 </tool>