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