annotate snpSift_filter.xml @ 1:796388c291d3

Update for snpeff version 4.0
author Jim Johnson <jj@umn.edu>
date Mon, 20 Oct 2014 08:43:00 -0500
parents 1ae5526db990
children baf6602903e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
1 <tool id="snpSift_filter" name="SnpSift Filter" version="4.0.0">
0
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
2 <options sanitize="False" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
3 <description>Filter variants using arbitrary expressions</description>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
4 <expand macro="requirements" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
5 <macros>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
6 <import>snpEff_macros.xml</import>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
7 </macros>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
8 <command>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
9 java -Xmx6G -jar \$SNPEFF_JAR_PATH/SnpSift.jar filter -f $input -e $exprFile $inverse
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
10 #if $filtering.mode == 'field':
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
11 #if $filtering.replace.pass:
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
12 --pass
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
13 #if $filtering.replace.filterId and len($filtering.replace.filterId.__str__.strip()) > 0:
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
14 --filterId "$filtering.replace.filterId"
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
15 #end if
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
16 #end if
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
17 #if $filtering.addFilter and len($filtering.addFilter.__str__.strip()) > 0:
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
18 --addFilter "$filtering.addFilter"
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
19 #end if
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
20 #if $filtering.rmFilter and len($filtering.rmFilter.__str__.strip()) > 0:
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
21 --rmFilter "$filtering.rmFilter"
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
22 #end if
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
23 #end if
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
24 > $output
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
25 </command>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
26 <inputs>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
27 <param format="vcf" name="input" type="data" label="Variant input file in VCF format"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
28 <param name="expr" type="text" label="Filter criteria" size="160" help="Need help? See below a few examples." />
1ae5526db990 Uploaded
jjohnson
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" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
30 <conditional name="filtering">
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
31 <param name="mode" type="select" label="Filter mode">
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
32 <option value="entries" selected="true">Retain entries that pass filter, remove other entries</option>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
33 <option value="field">Change the FILTER field, but retain all entries</option>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
34 </param>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
35 <when value="entries"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
36 <when value="field">
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
37 <conditional name="replace">
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
38 <param name="pass" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Set matching entry FILTER to 'PASS'"
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
39 help="appends an ID tag to non-matching entry FILTER "/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
40 <when value="no"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
41 <when value="yes">
1ae5526db990 Uploaded
jjohnson
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"
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
43 help="Default ID is 'SnpSift'"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
44 </when>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
45 </conditional>
1ae5526db990 Uploaded
jjohnson
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"/>
1ae5526db990 Uploaded
jjohnson
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"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
48 </when>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
49 </conditional>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
50 </inputs>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
51 <configfiles>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
52 <configfile name="exprFile">
1
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
53 $expr#slurp
0
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
54 </configfile>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
55 </configfiles>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
56
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
57 <outputs>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
58 <data format="vcf" name="output" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
59 </outputs>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
60 <expand macro="stdio" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
61 <tests>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
62 <test>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
63 <param name="input" ftype="vcf" value="test01.vcf"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
64 <param name="expr" value="QUAL >= 50"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
65 <param name="mode" value="entries"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
66 <output name="output">
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
67 <assert_contents>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
68 <has_text text="28837706" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
69 <not_has_text text="NT_166464" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
70 </assert_contents>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
71 </output>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
72 </test>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
73
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
74 <test>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
75 <param name="input" ftype="vcf" value="test01.vcf"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
76 <param name="expr" value="(CHROM = '19')"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
77 <param name="mode" value="entries"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
78 <output name="output">
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
79 <assert_contents>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
80 <has_text text="3205820" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
81 <not_has_text text="NT_16" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
82 </assert_contents>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
83 </output>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
84 </test>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
85
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
86 <test>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
87 <param name="input" ftype="vcf" value="test01.vcf"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
88 <param name="expr" value="(POS >= 20175) &amp; (POS &lt;= 35549)"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
89 <param name="mode" value="entries"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
90 <output name="output">
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
91 <assert_contents>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
92 <has_text text="20175" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
93 <has_text text="35549" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
94 <has_text text="22256" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
95 <not_has_text text="18933" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
96 <not_has_text text="37567" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
97 </assert_contents>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
98 </output>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
99 </test>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
100
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
101 <test>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
102 <param name="input" ftype="vcf" value="test01.vcf"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
103 <param name="expr" value="( DP >= 5 )"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
104 <param name="mode" value="entries"/>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
105 <output name="output">
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
106 <assert_contents>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
107 <has_text text="DP=5;" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
108 <has_text text="DP=6;" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
109 <not_has_text text="DP=1;" />
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
110 </assert_contents>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
111 </output>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
112 </test>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
113 </tests>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
114 <help>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
115
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
116 **SnpSift filter**
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
117
1ae5526db990 Uploaded
jjohnson
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.
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
119
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
120 Some examples:
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
121
1
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
122 - *I want just the variants from the second million bases of chr1*:
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
123
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
124 ::
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
125
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
126 ( CHROM = 'chr1' ) &amp; ( POS &gt; 1000000 ) &amp; ( POS &lt; 2000000 )
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
127
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
128 - *Filter value is either 'PASS' or it is missing*:
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
129
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
130 ::
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
131
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
132 (FILTER = 'PASS') | ( na FILTER )
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
133
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
134 - *I want to filter lines with an EFF of 'frameshift_variant' ( for vcf files using Sequence Ontology terms )*:
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
135
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
136 ::
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
137
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
138 ( EFF[*].EFFECT = 'frameshift_variant' )
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
139
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
140 - *I want to filter lines with an EFF of 'FRAME_SHIFT' ( for vcf files using Classic Effect names )*:
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
141
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
142 ::
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
143
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
144 ( EFF[*].EFFECT = 'FRAME_SHIFT' )
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
145
0
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
146 - *I want to filter out samples with quality less than 30*:
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
147
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
148 ::
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
149
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
150 ( QUAL &gt; 30 )
1
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
151
0
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
152 - *...but we also want InDels that have quality 20 or more*:
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
153
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
154 ::
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
155
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
156 (( exists INDEL ) &amp; (QUAL >= 20)) | (QUAL >= 30 )
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
157
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
158 - *...or any homozygous variant present in more than 3 samples*:
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
159
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
160 ::
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
161
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
162 (countHom() > 3) | (( exists INDEL ) &amp; (QUAL >= 20)) | (QUAL >= 30 )
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
163
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
164 - *...or any heterozygous sample with coverage 25 or more*:
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
165
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
166 ::
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
167
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
168 ((countHet() > 0) &amp; (DP >= 25)) | (countHom() > 3) | (( exists INDEL ) &amp; (QUAL >= 20)) | (QUAL >= 30 )
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
169
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
170 - *I want to keep samples where the genotype for the first sample is homozygous variant and the genotype for the second sample is reference*:
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
171
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
172 ::
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
173
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
174 (isHom( GEN[0] ) &amp; isVariant( GEN[0] ) &amp; isRef( GEN[1] ))
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
175
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
176
1
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
177 **For information regarding HGVS and Sequence Ontology terms versus classic names**:
0
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
178
1
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
179 - http://snpeff.sourceforge.net/SnpEff_manual.html#cmdline for the options: -classic, -hgvs, and -sequenceOntology
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
180 - http://snpeff.sourceforge.net/SnpEff_manual.html#input for the table containing the classic name and sequence onology term for each effect
796388c291d3 Update for snpeff version 4.0
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
181
0
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
182
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
183 @EXTERNAL_DOCUMENTATION@
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
184 http://snpeff.sourceforge.net/SnpSift.html#filter
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
185
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
186 @CITATION_SECTION@
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
187
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
188 </help>
1ae5526db990 Uploaded
jjohnson
parents:
diff changeset
189 </tool>