• 0 views
•
link
Count all variants from vcf file
I have vcf files from gatk pipleline, now I want to count all the variants in a file. Can anyone help? Thanks
• 1,712 views
•
link
2 answers
Hello! You can use bcftools query -f "A\n" <your_vcf> | wc -l
• 0 views
•
link
I tried this and it worked. Thanks alot
• 0 views
•
link
bcftools query -N -f '.' in.vcf | wc -c
or
bcftools index -s indexed.vcf.gz | cut -f 3 | paste -s -d '+' | bc
EDIT 2024: there is now a new behavior in bcftools query:
-N, --disable-automatic-newline Disable automatic addition of newline character when not present
• 0 views
•
link
Log in to answer this question.