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