This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Variation Count Based On Chromosome

I have a VCF file and i want the count of variations per chromosome i.e. for each chromosome how many variations found. i am aware that the command lc - w <filename> will give the count of total lines in the VCF but how could i indicate the chromosome number such as chr1, chr2 etc...

help much appreciated.

vcf

2 answers

 grep -v -E '^#'  your.vcf | cut -f 1 | sort | uniq -c
awk '! /\#/' varaints.vcf | awk '{print $1}' | sort | uniq -c

Log in to answer this question.