Skip to content

Commit fd3e810

Browse files
committed
Extract variant annotation using SnpSift
1 parent 82f5ab0 commit fd3e810

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

workflow/rules/vaf.smk

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,26 @@ rule tsv_to_vcf:
137137
"../scripts/tsv_to_vcf.py"
138138

139139

140+
rule extract_vcf_fields:
141+
threads: 1
142+
conda: "../envs/snpeff.yaml"
143+
params:
144+
extract_columns = [
145+
"CHROM", "REF", "POS", "ALT", "DP",
146+
'"GEN[*].ALT_DP"', '"GEN[*].ALT_RV"', '"GEN[*].ALT_FREQ"',
147+
'"GEN[*].ALT_QUAL"', '"ANN[*].GENE"', '"ANN[*].HGVS_P"'
148+
],
149+
sep = ","
150+
input:
151+
vcf = OUTDIR/f"{OUTPUT_NAME}.vcf"
152+
output:
153+
tsv = OUTDIR/f"{OUTPUT_NAME}.vcf_fields.tsv"
154+
log:
155+
LOGDIR / "tsv_to_vcf" / "log.txt"
156+
shell:
157+
'SnpSift extractFields -s {params.sep:q} {input.vcf:q} {params.extract_columns} >{output.tsv:q} 2>{log:q}'
158+
159+
140160
rule variants_effect:
141161
threads: 1
142162
shadow: "minimal"

0 commit comments

Comments
 (0)