Count all variants from vcf file
2
0
Entering edit mode
5 months ago
t.ali • 0

I have vcf files from gatk pipleline, now I want to count all the variants in a file. Can anyone help? Thanks

variants vcf Count • 286 views
ADD COMMENT
0
Entering edit mode
zgrep -cv "^#" <vcf_file>
ADD REPLY
1
Entering edit mode
5 months ago
raphael.B ▴ 200

Hello! You can use bcftools query -f "A\n" <your_vcf> | wc -l

ADD COMMENT
0
Entering edit mode

I tried this and it worked. Thanks alot

ADD REPLY
1
Entering edit mode
5 months ago
bcftools query -f '.' in.vcf | wc -c

or

  bcftools index -s indexed.vcf.gz |  cut -f 3 |  paste -s -d '+' | bc
ADD COMMENT

Login before adding your answer.

Traffic: 1280 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