Counting variants with SnpEff
1
0
Entering edit mode
23 months ago
gubrins ▴ 290

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 • 796 views
ADD COMMENT
2
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

I've just seen it, thanks Pierre!

ADD REPLY
0
Entering edit mode
23 months ago

not tested:

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

Login before adding your answer.

Traffic: 1663 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6