2
$\begingroup$

I'm working in bioinformatics, but my computational skills far outstrip my knowledge of biology or genomics. So forgive the noobish question.

According to the VCF specification, the INFO column for each coordinate [CHROM, POS] can contain values for

AC : allele count in genotypes, for each ALT allele, in the same order as listed
AF : allele frequency for each ALT allele in the same order as listed: use this when estimated from primary data, not called genotypes
AN : total number of alleles in called genotypes

For example, I'm working with the the VCF file you can download from Kaviar.

I think I understand how to calculate those numbers from raw sequences from a pileup. If for a given coordinate [CHROM, POS], $N_0$ is the number of hits for the reference allele, $\textrm{AC}_i \equiv N_i$ is the number of hits for the $i^{th}$ variant (maybe only one), and AN is the total number of alleles counted: $\textrm{AN} \equiv \sum_0^n N_i$, then the allele frequency for the $i^{th}$ variant is

$$\textrm{AF}_i = \frac{\textrm{AC}_i}{\textrm{AN}} = \frac{N_i}{\sum_0^n N_i}$$

So the phrase "total number of alleles in the dataset" would mean "total number of hits to coordinate [CHROM, POS] for any allele. And by "hit" I mean an aligned sequence fragment that includes that coordinate.

But I may not be taking into account the caveat for AF: "use this when estimated from primary data, not called genotypes."

Am I correctly understanding AF, AC, and AN in VCF files?

$\endgroup$
2
$\begingroup$

No, that is not quite right. specifically, this part:

And by "hit" I mean an aligned sequence fragment that includes that coordinate.

To get data on how many reads contributed to calling a specific allele at a given position, one would use the DP field, for example, which isn't included in the Kaviar VCF.

The AC, AN, and AF fields in a VCF file are meant to be used to show the allele's frequency in the context of all of the samples used when making that VCF file.

Investigation process

This is one line from the Kaviar vcf file:

1       10230   rs200279319     AC      AA,A    .       .       AF=0.0002654,0.0048525;AC=7,128;AN=26378;END=10231

If we look at the README attached with the Kaviar vcf file, it says,

"Kaviar is a compilation of SNVs, indels, and comlex variants observed in humans, designed to facilitate testing for the novelty and frequency of observed variants."

How many humans though? If we go to the Kaviar website it says:

Kaviar contains 162 million SNV sites (including 25M not in dbSNP) and incorporates data from 35 projects encompassing 77,781 individuals (13.2K whole genome, 64.6K exome).

If we look at the Kaviar VCF header we see that the fields are defined:

##INFO=<ID=AF,Number=A,Type=Float,Description="Allele Frequency">
##INFO=<ID=AC,Number=A,Type=Integer,Description="Allele Count">
##INFO=<ID=AN,Number=1,Type=Integer,Description="Total number of alleles in data sources">

If we look at these fields again, AF=0.0002654,0.0048525;AC=7,128;AN=26378, the AN=26378 tells us that for this locus, the Kaviar dataset contains information from 26378/2=13189 humans. That's the 13.2K whole genomes the Kaviar website was talking about. This site I'm looking at must be a non-coding region, because there is no exome data (protein-coding regions).

For this same site, AC=7,128 means that out of 13189 humans (26378 haplotypes), we saw the variants 7 and 128 times. Out of 26378 haplotypes, this is a frequency of AF=0.0002654,0.0048525.

$\endgroup$
1
  • $\begingroup$ Thank you so much for that clear and detailed answer! $\endgroup$
    – abalter
    Nov 8 '21 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.