How can HbS persist when it causes severe disease in homozygotes?
Let pS be the HbS frequency before selection. Under random mating, AA, AS and SS have probabilities (1-pS)², 2pS(1-pS) and pS². Their fitnesses predict
A finite next generation would then draw Binomial(2Ne, pS,sel). We compare the clinical data with the fitness model, then iterate the deterministic update.
library(hpgR)
options(repr.plot.width = 9, repr.plot.height = 3.8)
drawFigure <- function(name, draw, height = 3.6) {
draw()
figureDir <- Sys.getenv("P8149_FIGURE_DIR")
if (nzchar(figureDir)) {
dir.create(figureDir, recursive = TRUE, showWarnings = FALSE)
pdf(file.path(figureDir, paste0(name, ".pdf")), width = 9,
height = height, family = "Helvetica", pointsize = 12,
useDingbats = FALSE)
tryCatch(draw(), finally = dev.off())
}
}
Connect the fitness model to observed malaria protection¶
At the Mali site in the MalariaGEN study, HbAS occurred in 4 of 453 severe-malaria cases and 28 of 344 controls. These counts measure one clinical outcome. Filling the genotype-fitness table also requires survival and reproductive contribution over the life course.
For this unadjusted comparison, the odds ratio is .
count <- matrix(
c(4, 449, 28, 316),
nrow = 2, byrow = TRUE,
dimnames = list(group = c('Severe malaria', 'Control'),
genotype = c('HbAS', 'Non-HbAS'))
)
oddsRatio <- (count[1, 'HbAS'] / count[1, 'Non-HbAS']) /
(count[2, 'HbAS'] / count[2, 'Non-HbAS'])
hbASFraction <- count[, 'HbAS'] / rowSums(count)
stopifnot(sum(count[1, ]) == 453, sum(count[2, ]) == 344)
c(raw_oddsRatio = oddsRatio, hb_as_cases = hbASFraction[1],
hb_as_controls = hbASFraction[2])barplot(hbASFraction, col = c('#B44A3A', '#306C9A'), ylim = c(0, 0.10),
ylab = 'HbAS fraction', names.arg = names(hbASFraction))
mtext(sprintf('Raw odds ratio = %.2f', oddsRatio), side = 3, line = 0.2)
Why the odds ratio does not determine an equilibrium¶
For the idealized heterozygote-advantage model , , and , the HbS equilibrium is . The case–control table does not provide either selection coefficient. Two teaching fitness tables can therefore agree that HbAS has the highest fitness and still imply different equilibria.
fitnessModel <- data.frame(
model = c('Model 1', 'Model 2'),
wAA = c(0.90, 0.60),
wAS = c(1.00, 1.00),
wSS = c(0.20, 0.20)
)
fitnessModel$pSEquilibrium <- apply(
fitnessModel[, c("wSS", "wAS", "wAA")], 1, balancedFrequency
)
fitnessModelThe two models give different equilibria because the genotype fitnesses differ. The Mali sample informs the clinical odds ratio. Both fitness tables are teaching values.
Sources. Malaria Genomic Epidemiology Network (2014), Nature Genetics 46:1197–1204, Supplementary Table 11. Pritchard, An Owner’s Guide to the Human Genome, Section 2.6.
Hold the starting allele fixed and change the fitnesses¶
Start at pS=0.02. The malaria setting uses (AA, AS, SS)=(0.92, 1, 0.25); the other setting uses (1, 0.98, 0.25). These are teaching values. With heterozygote advantage the internal equilibrium is
The function expects SS, AS, AA because we are tracking S.
generations <- 150L
malaria <- c(AA = .92, AS = 1, SS = .25)
noMalaria <- c(AA = 1, AS = .98, SS = .25)
equilibrium <- balancedFrequency(rev(malaria))
withMalaria <- selectionFrequencies(.02, rev(malaria), generations)
withoutMalaria <- selectionFrequencies(.02, rev(noMalaria), generations)
drawFigure("selection_sickle_environment", function() {
par(mar = c(4.2, 4.3, 1.2, .8))
plot(0:generations, withMalaria, type = "l", lwd = 2, col = "#B33B32",
ylim = c(0, .13), xlab = "Generation", ylab = "Deterministic HbS frequency")
lines(0:generations, withoutMalaria, lwd = 2, col = "#306C9A")
abline(h = equilibrium, lty = 2, col = "#B33B32")
legend("right", c("Malaria setting", "Other setting", "Equilibrium"),
col = c("#B33B32", "#306C9A", "#B33B32"), lty = c(1, 1, 2), bty = "n")
})

stopifnot(withMalaria[2] > .02, withoutMalaria[2] < .02,
abs(selectedFrequency(equilibrium, rev(malaria)) - equilibrium) < 1e-12)
c(initial = .02, malariaEquilibrium = equilibrium)
Stable and unstable equilibria¶
In Pritchard’s Fig. 2.107, track the frequency of allele from starting values . Use fitnesses in the order . Both panels use 999 selection updates after the starting point. The dashed lines mark the internal equilibria.
With heterozygote advantage, frequencies on either side of approach it. With heterozygote disadvantage, the trajectory that starts at 0.40 stays there, while the others move away.
p0 <- c(.10, .30, .40, .50, .90)
fitness <- list("Heterozygote advantage" = c(aa = 1.01, Aa = 1.02, AA = 1),
"Heterozygote disadvantage" = c(aa = 1.01, Aa = .98, AA = 1))
pStar <- c(2/3, .40)
for (i in seq_along(fitness)) {
stopifnot(abs(selectedFrequency(pStar[i], fitness[[i]]) - pStar[i]) < 1e-12)
}
drawFigure("selection_pritchard_2_107", function() {
par(mfrow = c(1, 2), mar = c(4.2, 4.3, 3.6, 1.6))
colors <- c("#171717", "#265991", "#238046", "#B33B32", "#996130")
for (i in seq_along(fitness)) {
paths <- vapply(p0, selectionFrequencies, numeric(1000L),
w = fitness[[i]], generations = 999L)
matplot(seq_len(1000L), paths, type = "n", xlim = c(0, 1000),
ylim = c(0, 1), xlab = "Generation", ylab = "Frequency of a",
main = "")
title(main = names(fitness)[i], line = 1.75, cex.main = .95)
abline(h = pStar[i], col = "gray50", lty = 2)
matlines(seq_len(1000L), paths, lty = 1, lwd = 1.6, col = colors)
mtext(sprintf("w(aa, Aa, AA) = (%.2f, %.2f, %.2f)", fitness[[i]][1],
fitness[[i]][2], fitness[[i]][3]), side = 3, line = .25,
cex = .8)
}
})