This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Calculate allele frequency from many VCF files in specific locus

Dear all,

I have 100 VCF files (100 different samples). I would like to calculate allele frequency in specific sites.

In one specific locus I have three genotypes (GATK best practices workflow):

rs-xxxxx:
A/A occurring in 30 samples (ref hom)
A/G occurring in 21 samples (het)
G/G occurring in 49 samples (alt hom)

Frequency of genotype would be:

A/A = 0.3
A/G = 0.21
G/G = 0.49

But how do I calculate allele frequency of A/G ?

dbSNP define this like: (sum of chromosome counts over all member) / (total chromosome counts over all member)

Thank you for any educative example.

Paul.

genotyp vcf next-gen freq

hello, I am also lost in finding the solution for this, can u please suggest me how to go about it?

1 answer

use bcftools merge to combine your vcf at this position and extract the INFO/AF field with bcftools query

Yes bcftools merge is good idea. You can also use GATK Combinegvcf. bcftools query - (bcftools query -f '%CHROM %POS[\t%DP\t%AD]\n' ) gaves you DP and AD, and you would be able calculate frequencies. But frequency from all samples - just to get one number like in dbSNP. What about one genotype divide sum of other genotypes?

Log in to answer this question.