<p>No, that is not quite right. specifically, this part:</p>
<blockquote>
<p>And by &quot;hit&quot; I mean an aligned sequence fragment that includes that coordinate.</p>
</blockquote>
<p>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.</p>
<p>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.</p>
<p><strong>Investigation process</strong></p>
<p>This is one line from the Kaviar vcf file:</p>
<pre><code>1       10230   rs200279319     AC      AA,A    .       .       AF=0.0002654,0.0048525;AC=7,128;AN=26378;END=10231
</code></pre>
<p>If we look at the README attached with the Kaviar vcf file, it says,</p>
<blockquote>
<p>&quot;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.&quot;</p>
</blockquote>
<p>How many humans though? If we go to the Kaviar website it says:</p>
<blockquote>
<p>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).</p>
</blockquote>
<p>If we look at the Kaviar VCF header we see that the fields are defined:</p>
<pre><code>##INFO=&lt;ID=AF,Number=A,Type=Float,Description=&quot;Allele Frequency&quot;&gt;
##INFO=&lt;ID=AC,Number=A,Type=Integer,Description=&quot;Allele Count&quot;&gt;
##INFO=&lt;ID=AN,Number=1,Type=Integer,Description=&quot;Total number of alleles in data sources&quot;&gt;
</code></pre>
<p>If we look at these fields again, <code>AF=0.0002654,0.0048525;AC=7,128;AN=26378</code>, 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).</p>
<p>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.</p>

CC BY-SA 4.0
2021-11-08T06:35:36.647Z
Thank you so much for that clear and detailed answer!
abalter
CC BY-SA 4.0
2021-11-07T05:35:19.920Z
2021-11-07T06:51:46.557Z
2021-11-07T06:51:46.557Z
conchoecia
<p>I'm working in bioinformatics, but my computational skills far outstrip my knowledge of biology or genomics. So forgive the noobish question.</p>
<p>According to the <a href="https://samtools.github.io/hts-specs/VCFv4.2.pdf" rel="noreferrer">VCF specification</a>, the <code>INFO</code> column for each coordinate <code>[CHROM, POS]</code> can contain values for</p>
<p><strong>AC :</strong> allele count in genotypes, for each ALT allele, in the same order as listed<br />
<strong>AF :</strong> allele frequency for each ALT allele in the same order as listed: use this when estimated from primary data, not called genotypes<br />
<strong>AN :</strong> total number of alleles in called genotypes</p>
<p>For example, I'm working with the the <a href="http://db.systemsbiology.net/kaviar/Kaviar.downloads.html" rel="noreferrer">VCF file you can download from Kaviar</a>.</p>
<p>I think I understand how to calculate those numbers from raw sequences from a pileup. If for a given coordinate <code>[CHROM, POS]</code>, <span class="math-container">$N_0$</span> is the number of hits for the reference allele, <span class="math-container">$\textrm{AC}_i \equiv N_i$</span> is the number of hits for the <span class="math-container">$i^{th}$</span> variant (maybe only one), and AN is the total number of alleles counted: <span class="math-container">$\textrm{AN} \equiv \sum_0^n N_i$</span>, then the allele frequency for the <span class="math-container">$i^{th}$</span> variant is</p>
<p><span class="math-container">$$\textrm{AF}_i = \frac{\textrm{AC}_i}{\textrm{AN}} = \frac{N_i}{\sum_0^n N_i}$$</span></p>
<p>So the phrase &quot;total number of alleles in the dataset&quot; would mean &quot;total number of hits to coordinate <code>[CHROM, POS]</code> for <em>any</em> allele. And by &quot;hit&quot; I mean an aligned sequence fragment that includes that coordinate.</p>
<p>But I may not be taking into account the caveat for AF: &quot;use this when estimated from primary data, not called genotypes.&quot;</p>
<p>Am I correctly understanding AF, AC, and AN in VCF files?</p>

<vcf><allele-frequency>
Allele Count and Allele Frequency in VCF files
# Allele Count and Allele Frequency in VCF files

(Asked by: username_0 on 2021-01-29)

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](https://samtools.github.io/hts-specs/VCFv4.2.pdf), 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](http://db.systemsbiology.net/kaviar/Kaviar.downloads.html).

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?

**Tags:** vcf, allele-frequency

---

## 1 answers

### Answer by username_1 on 2021-11-07. Score: 5 | Accepted answer

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=
##INFO=
##INFO=

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.

> **Comments:**
> **username_0**: Thank you so much for that clear and detailed answer!  

---

