This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Counting variants with SnpEff

Heys, I am working with snpEff and I want to calculate the number of variants for specific categories. I am following this code:

cat output.ann.vcf \
| cut -f 8 \
| tr ";" "\n" \
| grep ^EFF= \
| cut -f 2 -d = \
| tr "," "\n" \
| grep MODIFIER \
| wc -l

But it does not work. It seems when I try to look for the EFF fields, I do not have any. Do you know why is that?

Thanks in advance!

snpeff

if you're using a modern SNPEFF, this should be ANN= , not EFF=

furthermore, you're not counting the number of variants but the number of transcripts.

I've just seen it, thanks Pierre!

1 answer

not tested:

bcftools query -f '.'  -i 'ANN ~ "MODIFIER" ' in.vcf | wc -c

Log in to answer this question.