Mercurial > repos > jjohnson > snpsift
annotate snpSift_filter.xml @ 9:88f4997ccb02 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
author | jjohnson |
---|---|
date | Mon, 11 Apr 2016 09:31:49 -0400 |
parents | 2f40467536cf |
children |
rev | line source |
---|---|
4 | 1 <tool id="snpSift_filter" name="SnpSift Filter" version="@WRAPPER_VERSION@.0"> |
0 | 2 <description>Filter variants using arbitrary expressions</description> |
4 | 3 <macros> |
4 <import>snpSift_macros.xml</import> | |
5 </macros> | |
0 | 6 <expand macro="requirements" /> |
4 | 7 <expand macro="stdio" /> |
8 <expand macro="version_command" /> | |
8
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
9 |
4 | 10 <command><![CDATA[ |
8
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
11 java -Xmx6G -jar "\$SNPEFF_JAR_PATH/SnpSift.jar" filter -f "$input" -e "$exprFile" $inverse |
0 | 12 #if $filtering.mode == 'field': |
13 #if $filtering.replace.pass: | |
14 --pass | |
8
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
15 #if $filtering.replace.filterId and len(str($filtering.replace.filterId).strip()) > 0: |
0 | 16 --filterId "$filtering.replace.filterId" |
17 #end if | |
18 #end if | |
8
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
19 #if $filtering.addFilter and len(str($filtering.addFilter).strip()) > 0: |
0 | 20 --addFilter "$filtering.addFilter" |
21 #end if | |
8
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
22 #if $filtering.rmFilter and len(str($filtering.rmFilter).strip()) > 0: |
0 | 23 --rmFilter "$filtering.rmFilter" |
24 #end if | |
25 #end if | |
8
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
26 > "$output" |
4 | 27 ]]> |
0 | 28 </command> |
8
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
29 <configfiles> |
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
30 <configfile name="exprFile"> |
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
31 $expr#slurp |
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
32 </configfile> |
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
33 </configfiles> |
0 | 34 <inputs> |
35 <param format="vcf" name="input" type="data" label="Variant input file in VCF format"/> | |
9
88f4997ccb02
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
8
diff
changeset
|
36 <param name="expr" type="text" label="Filter criteria" help="Need help? See below a few examples." > |
88f4997ccb02
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
8
diff
changeset
|
37 <sanitizer sanitize="False"/> |
88f4997ccb02
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
8
diff
changeset
|
38 </param> |
0 | 39 <param name="inverse" type="boolean" truevalue="--inverse" falsevalue="" checked="false" label="Inverse filter" help="Show lines that do not match filter expression" /> |
40 <conditional name="filtering"> | |
41 <param name="mode" type="select" label="Filter mode"> | |
42 <option value="entries" selected="true">Retain entries that pass filter, remove other entries</option> | |
43 <option value="field">Change the FILTER field, but retain all entries</option> | |
44 </param> | |
45 <when value="entries"/> | |
46 <when value="field"> | |
47 <conditional name="replace"> | |
48 <param name="pass" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Set matching entry FILTER to 'PASS'" | |
49 help="appends an ID tag to non-matching entry FILTER "/> | |
50 <when value="no"/> | |
51 <when value="yes"> | |
6
824f78c0d0df
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 915e0f28e6bc2701ca8f333d7b30cf399cd6e9da-dirty
jjohnson
parents:
4
diff
changeset
|
52 <param name="filterId" type="text" value="" optional="true" label="ID appended to non-matching (##FILTER tag in header and FILTER VCF field)." |
0 | 53 help="Default ID is 'SnpSift'"/> |
54 </when> | |
55 </conditional> | |
6
824f78c0d0df
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 915e0f28e6bc2701ca8f333d7b30cf399cd6e9da-dirty
jjohnson
parents:
4
diff
changeset
|
56 <param name="addFilter" type="text" value="" optional="true" label="Add a string to FILTER VCF field if 'expression' is true." /> |
824f78c0d0df
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 915e0f28e6bc2701ca8f333d7b30cf399cd6e9da-dirty
jjohnson
parents:
4
diff
changeset
|
57 <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)." /> |
0 | 58 </when> |
59 </conditional> | |
60 </inputs> | |
61 | |
62 <outputs> | |
63 <data format="vcf" name="output" /> | |
64 </outputs> | |
65 <tests> | |
66 <test> | |
67 <param name="input" ftype="vcf" value="test01.vcf"/> | |
68 <param name="expr" value="QUAL >= 50"/> | |
69 <param name="mode" value="entries"/> | |
70 <output name="output"> | |
71 <assert_contents> | |
72 <has_text text="28837706" /> | |
73 <not_has_text text="NT_166464" /> | |
74 </assert_contents> | |
75 </output> | |
76 </test> | |
77 | |
78 <test> | |
79 <param name="input" ftype="vcf" value="test01.vcf"/> | |
80 <param name="expr" value="(CHROM = '19')"/> | |
81 <param name="mode" value="entries"/> | |
82 <output name="output"> | |
83 <assert_contents> | |
84 <has_text text="3205820" /> | |
85 <not_has_text text="NT_16" /> | |
86 </assert_contents> | |
87 </output> | |
88 </test> | |
89 | |
90 <test> | |
91 <param name="input" ftype="vcf" value="test01.vcf"/> | |
8
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
92 <param name="expr" value="(POS >= 20175) & (POS <= 35549)"/> |
0 | 93 <param name="mode" value="entries"/> |
94 <output name="output"> | |
95 <assert_contents> | |
96 <has_text text="20175" /> | |
97 <has_text text="35549" /> | |
98 <has_text text="22256" /> | |
99 <not_has_text text="18933" /> | |
100 <not_has_text text="37567" /> | |
101 </assert_contents> | |
102 </output> | |
103 </test> | |
104 | |
105 <test> | |
106 <param name="input" ftype="vcf" value="test01.vcf"/> | |
8
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
107 <param name="expr" value="( DP >= 5 )"/> |
0 | 108 <param name="mode" value="entries"/> |
109 <output name="output"> | |
110 <assert_contents> | |
111 <has_text text="DP=5;" /> | |
112 <has_text text="DP=6;" /> | |
113 <not_has_text text="DP=1;" /> | |
114 </assert_contents> | |
115 </output> | |
116 </test> | |
117 </tests> | |
4 | 118 <help><![CDATA[ |
0 | 119 |
120 **SnpSift filter** | |
121 | |
4 | 122 You can filter a 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. |
0 | 123 |
124 Some examples: | |
125 | |
1 | 126 - *I want just the variants from the second million bases of chr1*: |
127 | |
128 :: | |
129 | |
4 | 130 ( CHROM = 'chr1' ) & ( POS > 1000000 ) & ( POS < 2000000 ) |
1 | 131 |
132 - *Filter value is either 'PASS' or it is missing*: | |
133 | |
134 :: | |
135 | |
136 (FILTER = 'PASS') | ( na FILTER ) | |
137 | |
4 | 138 - *I want to filter lines with an ANN annotation EFFECT of 'frameshift_variant' ( for vcf files using Sequence Ontology terms )*: |
1 | 139 |
140 :: | |
141 | |
4 | 142 ( ANN[*].EFFECT has 'frameshift_variant' ) |
143 | |
144 **Important** According to the specification, there can be more than one EFFECT separated by & (e.g. 'missense_variant&splice_region_variant', thus using has operator is better than using equality operator (=). For instance 'missense_variant&splice_region_variant' = 'missense_variant' is false, whereas 'missense_variant&splice_region_variant' has 'missense_variant' is true. | |
1 | 145 |
146 - *I want to filter lines with an EFF of 'FRAME_SHIFT' ( for vcf files using Classic Effect names )*: | |
147 | |
148 :: | |
149 | |
150 ( EFF[*].EFFECT = 'FRAME_SHIFT' ) | |
151 | |
0 | 152 - *I want to filter out samples with quality less than 30*: |
153 | |
154 :: | |
155 | |
4 | 156 ( QUAL > 30 ) |
1 | 157 |
0 | 158 - *...but we also want InDels that have quality 20 or more*: |
159 | |
160 :: | |
161 | |
4 | 162 (( exists INDEL ) & (QUAL >= 20)) | (QUAL >= 30 ) |
0 | 163 |
164 - *...or any homozygous variant present in more than 3 samples*: | |
165 | |
166 :: | |
167 | |
4 | 168 (countHom() > 3) | (( exists INDEL ) & (QUAL >= 20)) | (QUAL >= 30 ) |
0 | 169 |
170 - *...or any heterozygous sample with coverage 25 or more*: | |
171 | |
172 :: | |
173 | |
4 | 174 ((countHet() > 0) & (DP >= 25)) | (countHom() > 3) | (( exists INDEL ) & (QUAL >= 20)) | (QUAL >= 30 ) |
0 | 175 |
176 - *I want to keep samples where the genotype for the first sample is homozygous variant and the genotype for the second sample is reference*: | |
177 | |
178 :: | |
179 | |
4 | 180 (isHom( GEN[0] ) & isVariant( GEN[0] ) & isRef( GEN[1] )) |
0 | 181 |
182 | |
1 | 183 **For information regarding HGVS and Sequence Ontology terms versus classic names**: |
0 | 184 |
1 | 185 - http://snpeff.sourceforge.net/SnpEff_manual.html#cmdline for the options: -classic, -hgvs, and -sequenceOntology |
186 - http://snpeff.sourceforge.net/SnpEff_manual.html#input for the table containing the classic name and sequence onology term for each effect | |
187 | |
0 | 188 |
189 @EXTERNAL_DOCUMENTATION@ | |
190 http://snpeff.sourceforge.net/SnpSift.html#filter | |
191 | |
4 | 192 ]]> |
0 | 193 </help> |
8
2f40467536cf
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpsift/snpsift commit 93465571cf180554c3548338a68fa0f1604985dc-dirty
jjohnson
parents:
7
diff
changeset
|
194 <expand macro="citations" /> |
0 | 195 </tool> |