Algorithm Search⌘K

Definitioncore

Genotype likelihood

Also called GL.

The probability of the reads at a site given each possible genotype, computed from base qualities under an independent error model.

A genotype likelihood is the probability of the reads that cover one site of one sample, computed once for each genotype that the sample could have there. It is a likelihood: a function of the genotype for fixed data, not a probability distribution over the genotypes. The usual model takes the bases of the pileup column as independent given the genotype and reads the error rate of each base from its Phred quality. Callers combine the likelihoods with a prior in Bayesian genotype calling, and VCF stores them in the fields GL and PL.

Definition

Fix a site with reference allele rr and alternate allele aa, and a sample of ploidy mm, which is 2 for a diploid. The genotype g∈{0,1,…,m}g \in \{0, 1, \dots, m\} is the number of copies of aa. The data DD are the read bases b1,…,bnb_1, \dots, b_n at the site with their qualities Q1,…,QnQ_1, \dots, Q_n, and ei=10−Qi/10e_i = 10^{-Q_i/10}.

The error model. A read that comes from a chromosome with allele AA shows the base bb with probability

P(b∣A)={1−eif b=A,e/3otherwise,P(b \mid A) = \begin{cases} 1 - e & \text{if } b = A, \\ e / 3 & \text{otherwise,} \end{cases}

so an error turns the base into each of the three others with the same probability.

The genotype likelihood. Each read comes from one of the mm chromosomes, chosen uniformly, and the reads are independent given gg. Then

L(g)=P(D∣g)=∏i=1n(gmP(bi∣a)+m−gmP(bi∣r)).L(g) = P(D \mid g) = \prod_{i=1}^{n} \left( \frac{g}{m} P(b_i \mid a) + \frac{m - g}{m} P(b_i \mid r) \right).

For a diploid, the three values are L(0)=∏iP(bi∣r)L(0) = \prod_i P(b_i \mid r), L(2)=∏iP(bi∣a)L(2) = \prod_i P(b_i \mid a), and L(1)=∏i12(P(bi∣r)+P(bi∣a))L(1) = \prod_i \frac{1}{2}\bigl(P(b_i \mid r) + P(b_i \mid a)\bigr). For several alternate alleles, the genotype is a multiset of mm alleles and the factor of read ii is the mean of P(bi∣A)P(b_i \mid A) over the alleles AA of the multiset.

Log and Phred forms. VCF stores GL(g)=log⁡10L(g)\mathrm{GL}(g) = \log_{10} L(g), and PL(g)=−10log⁡10L(g)\mathrm{PL}(g) = -10 \log_{10} L(g) rounded to an integer and shifted so that the smallest value is 0. The shift does not lose anything that a caller needs, because the posterior of Bayesian genotype calling depends only on the ratios L(g)/L(g′)L(g) / L(g').

Other terms in the model. Many callers add more to P(b∣A)P(b \mid A): the chance 10−M/1010^{-M/10} that the read is mapped to the wrong place, from its mapping quality MM, or a cap of each base quality at the read's mapping quality. Haplotype-based callers replace the factor of each base with the probability of the whole read given a candidate haplotype, computed with a pair HMM.

Examples and non-examples

A heterozygous site. Six reads cover a site with r=Ar = A and a=Ga = G: three show A with qualities 30, 30, 20, and three show G with qualities 30, 20, 10. For a diploid:

gg genotype L(g)L(g) log⁡10L(g)\log_{10} L(g) PL
0 A/A 3.659×10−83.659 \times 10^{-8} −7.4366-7.4366 56
1 A/G 0.0143610.014361 −1.8428-1.8428 0
2 G/G 3.297×10−103.297 \times 10^{-10} −9.4819-9.4819 76

For g=1g = 1 each factor is close to 1/21/2, so L(1)L(1) is close to 2−6=0.0156252^{-6} = 0.015625. For g=0g = 0, the three G bases each contribute ei/3e_i / 3, which is small, and the Q10 base contributes the most of them, 0.1/30.1 / 3. The likelihoods favor the heterozygote by a factor of about 4×1054 \times 10^5 over A/A.

Two reads. Two G reads of quality 30 at a site with r=Ar = A give L(2)=(1−0.001)2=0.998L(2) = (1 - 0.001)^2 = 0.998, L(1)=0.2497L(1) = 0.2497 and L(0)=1.11×10−7L(0) = 1.11 \times 10^{-7}. The likelihood of G/G is only 4 times that of A/G, since a heterozygote shows G on both reads with probability about 1/41/4. With low depth, the likelihoods alone cannot tell a heterozygote from a homozygote, which is why the prior matters there.

Non-example: the likelihoods do not sum to 1. In the first example, the three values sum to 0.0144. They are probabilities of the data, one for each genotype, not probabilities of the genotypes. Turning them into genotype probabilities needs a prior, as in Bayes' theorem.

Non-example: dependent reads. If three of the six reads are PCR copies of one fragment, an error in that fragment appears three times, and the product over the reads counts it three times. The model assumes independent reads, which is one reason for duplicate marking before calling.

Non-example: a wrong quality. If the Q30 bases are really wrong 1 time in 200, the model overstates how unlikely an error is, and a few errors at one site look like a heterozygote. Base quality score recalibration corrects the qualities before the likelihoods are computed.

  • Read pileup. The likelihood is a function of one pileup column; see read pileup.
  • Prior and posterior. With a prior P(g)P(g), such as the Hardy-Weinberg prior from an allele frequency, the posterior is P(g∣D)=L(g)P(g)/∑g′L(g′)P(g′)P(g \mid D) = L(g) P(g) / \sum_{g'} L(g') P(g'); see Bayesian genotype calling.
  • Counts form. If all bases have the same error rate ee and kk of the nn bases show aa, then for a heterozygote each base shows aa with probability about 1/21/2, and the likelihood is a binomial term in kk up to a factor that does not depend on gg.
  • Use without calling. Imputation and population methods can use the likelihoods directly, without first calling a genotype, which keeps the uncertainty of low-coverage data; see genotype imputation and Li (2011).
  • VCF fields. GL and PL, and the order of the genotypes for several alternate alleles, are on Variant Call Format.

References

  1. Heng Li, A statistical framework for SNP calling, mutation discovery, association mapping and population genetical parameter estimation from sequencing data, Bioinformatics 27(21), 2011, pp. 2987 to 2993, Section 2 (the likelihood of the reads at a site for a sample of ploidy m, with g copies of the alternate allele)
  2. Rasmus Nielsen, Joshua S. Paul, Anders Albrechtsen and Yun S. Song, Genotype and SNP calling from next-generation sequencing data, Nature Reviews Genetics 12(6), 2011, pp. 443 to 451, the section on genotype calling (genotype likelihoods from base qualities, and their use in single-sample and multi-sample calling)
  3. Heng Li, Jue Ruan and Richard Durbin, Mapping short DNA sequencing reads and calling variants using mapping quality scores, Genome Research 18(11), 2008, pp. 1851 to 1858, Methods (the consensus genotype calling of Maq from the bases and qualities at a site)
  4. The Variant Call Format Specification, VCFv4.3, hts-specs, Section 1.6.2 (the genotype fields GL and PL and the order of the genotypes)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/RS20ZP/text.yaml