This is a test version of Biostars. For the public version, visit https://www.biostars.org.
adding allele frequencies to a vcf

Hi all, I have a vcf file generated from a few hundred samples. For each variant within the file, I would like to calculate the allele frequency of each allele and then add that information as a field into the 'INFO' field of the file. I know that I can use vcftools to generate the allele frequencies, but I'm at a bit of a loss as to how I can add that back into the INFO section of the vcf. Alternatively, is there an annotation tool (such as SnpSift, VEP, or some other) that can calculate and do this. If not, I would be left to creating my own script to do it, which I would prefer to avoid. Thanks for any help

allele vcf maf frequencies

1 answer

Try this

bcftools +fill-tags in.bcf -Ob -o out.bcf -- -t all

Thanks. that works. I was unaware of that option in bcftools!

Log in to answer this question.