Use the forward population from the first notebook. Fit a local tree and its node ages from a short window, then allow the tree to change along a chromosome. The simulation’s recorded ancestry supplies the reference for each check.
library(hpgR)
options(repr.plot.width = 10, repr.plot.height = 4.5,
repr.plot.pointsize = 14, warn = 1)
truth_color <- "#B33B32"
estimate_color <- "#265991"
drawFigure <- function(name, draw, width = 10, height = 4.5) {
options(repr.plot.width = width, repr.plot.height = height)
directory <- Sys.getenv("P8149_FIGURE_DIR")
if (nzchar(directory)) {
dir.create(directory, recursive = TRUE, showWarnings = FALSE)
pdf(file.path(directory, paste0(name, ".pdf")), width = width,
height = height, pointsize = 14, family = "Helvetica",
useDingbats = FALSE, bg = "white")
tryCatch(draw(), finally = dev.off())
}
if ("IRkernel" %in% loadedNamespaces()) {
par(bg = "white")
draw()
}
invisible(NULL)
}
blue <- "#265991"; orange <- "#D65F22"Source
ancestry_truth <- readRDS("data/population_history/ancestry_truth.rds")
observed <- readRDS("data/population_history/observed.rds")Observe the final DNA¶
The simulation starts at size 100. It goes through 20 generations at size 20 and expands to 1,000 over the next 40 generations. The full sample contains 64 diploid people and eight 10,000-base chromosomes. Each chromosome has a 0.2-Morgan map and the mutation rate is 2.5 × 10⁻⁵ per base per generation.
Use the first six people on chromosome 1. H1–H12 identify their paired haplotypes. The copying model uses sites that vary among the twelve copies. The mutation clock uses the full sequence span, including invariant sites.
panel <- observed
calibration <- populationHistoryDesign()$design
chromosome_length <- 10000L
chromosome <- panel$haplotypes[1:12, seq_len(chromosome_length), drop = FALSE]
polymorphic <- colSums(chromosome) > 0 & colSums(chromosome) < nrow(chromosome)
linked_sample <- list(
haplotypes = chromosome[, polymorphic, drop = FALSE],
positions = which(polymorphic) - 1L,
sequenceLength = chromosome_length
)
print(c(sampled_haplotypes = nrow(chromosome),
variable_sites = sum(polymorphic), analyzed_bases = chromosome_length))sampled_haplotypes variable_sites analyzed_bases
12 276 10000
Why polymorphic sites favor older genealogies¶
For a fixed rate, longer branches have a higher probability of carrying a mutation. That is why conditioning on variable sites favors older genealogies. For two copies with a shared ancestor generations ago, the probability of at least one mutation at one base is when is small. Under a neutral model, mutations shared by many copies tend to lie on deeper branches. Different trees can yield the same carrier count at different mutation ages. In humans, heterozygous sites can reflect mutations hundreds of thousands of years old (Pritchard, Sec. 2.2, note 164).
Start with four copies¶
Use H1–H4 from the same chromosome. Shared derived alleles constrain which copies descend from the same branch. Mutation counts also give information about how far back the branches meet.
Infer topology from shared alleles¶
Study chromosome 1, bases 1–250. This window has five variable sites. The data support the clade containing H1 and H3 and leave three compatible binary trees under a single-tree infinite-sites model.
samples <- 1:4
mu <- calibration$mutation_rate
L <- 250L
four_copy_window <- chromosome[samples, seq_len(L), drop = FALSE]
consensus3 <- ptiConsensus(four_copy_window)
keep3 <- colSums(four_copy_window)>0 & colSums(four_copy_window)<4
print(list(variable_sites=sum(keep3), supported_clades=consensus3$supported_clades,
compatible_binary_trees=consensus3$compatible_count))$variable_sites
[1] 5
$supported_clades
$supported_clades[[1]]
[1] 1 3
$compatible_binary_trees
[1] 3
cladeNodes <- function(tree) {
clades <- ptiTreeClades(tree)
keys <- vapply(clades, ptiKey, character(1))
root <- ptiKey(sort(as.integer(unlist(tree))))
parent <- setNames(rep(NA_character_, length(keys)), keys)
for (key in setdiff(keys, root)) {
child <- clades[[match(key, keys)]]
larger <- Filter(function(x) length(x) > length(child) && all(child %in% x), clades)
parent[key] <- ptiKey(larger[[which.min(lengths(larger))]])
}
list(clades = clades, keys = keys, parent = parent, root = root)
}
drawFourCopyTree <- function(tree, ages = NULL, maximum = NULL, title = "") {
if (is.null(tree)) {
plot.new()
title(main = title)
text(0.5, 0.5, "No single compatible tree")
return(invisible(NULL))
}
nodes <- cladeNodes(tree)
order <- as.integer(unlist(tree))
x <- setNames(vapply(nodes$clades, function(c) mean(match(c, order)), numeric(1)),
nodes$keys)
if (is.null(ages)) {
ages <- setNames(lengths(nodes$clades) - 1, nodes$keys)
y_label <- ""
} else {
ages <- c(setNames(rep(0, 4), as.character(1:4)), ages)
y_label <- "Generations before sampling"
}
if (is.null(maximum)) maximum <- max(ages) * 1.18
plot(NA, xlim = c(.6, 4.4), ylim = c(0, max(1, maximum)),
xaxt = "n", yaxt = if (nzchar(y_label)) "s" else "n", bty = "n",
xlab = "", ylab = y_label, main = title)
axis(1, 1:4, paste0("H", order), tick = FALSE)
for (key in setdiff(nodes$keys, nodes$root)) {
parent <- nodes$parent[key]
segments(x[key], ages[key], x[key], ages[parent], lwd = 2, col = blue)
segments(x[key], ages[parent], x[parent], ages[parent], lwd = 2, col = blue)
}
}
drawCarriers <- function(G, positions = NULL, key = FALSE) {
keep <- colSums(G) > 0 & colSums(G) < nrow(G)
G <- G[, keep, drop = FALSE]
if (is.null(positions)) positions <- seq_len(ncol(G)) else positions <- positions[keep]
plot(NA, xlim = range(c(positions, 0)), ylim = c(.6, if (key) 5.5 else 4.4), yaxt = "n",
xlab = if (max(positions) > 30) "Position (bases)" else "Variable site",
ylab = "", bty = "n")
axis(2, 4:1, paste0("H", 1:4), las = 1, tick = FALSE)
for (i in 1:4) {
points(positions, rep(5-i, length(positions)), pch = ifelse(G[i, ] == 1, 16, 1),
col = ifelse(G[i, ] == 1, blue, "gray65"), cex = 1.15)
}
if (key) legend("topright", c("Allele 1", "Allele 0"), pch = c(16, 1),
col = c(blue, "gray65"), bty = "n", ncol = 2, cex = .85)
}
drawFigure("p6_supported_clades", function() {
par(mfrow = c(1, 2), mar = c(4.6, 3, 2.2, .8), bg = "white")
drawCarriers(four_copy_window, key = TRUE)
title("Chr 1: bases 1-250")
drawFourCopyTree(consensus3$tree, title = "Supported branches")
}, width = 9, height = 3.6)

Date ancestors with the mutation clock¶
Under a one-tree infinite-sites model, assign each derived pattern to its branch. Let count mutations on branch over all bases, including invariant sites. With the supplied mutation rate ,
Sample ages are zero. On the supported tree, let be the age of the H1–H3 ancestor and the additional time to the root. Three mutations lie on the branch above the H1–H3 ancestor, and two lie on the H4 branch. The tree has total branch length . Multiplying the five branch likelihoods gives
H1 and H3 have zero observed differences in this window. Their fitted ancestor age is on the boundary. Unsupported internal edges can have zero length in compatible binary refinements. The interval shows how much time can pass while still producing zero differences.
For any pair , . The root age is . Form six exact Poisson intervals, each at level . By the union bound, all six cover jointly with probability at least 0.95 under this model. Taking the maxima of the six lower endpoints and the six upper endpoints gives the root-age interval. Use the same rule for pairs within a smaller clade. Shared branches make pairwise counts dependent. The union bound still applies.
These are conditional intervals under the supplied mutation rate and one error-free infinite-sites tree across the window. Recombination or recurrent mutation in the forward DNA changes that model.
fit3 <- ptiFitAges(four_copy_window, mu, L)
# Check the optimized ages against the two-parameter calculation.
fitted_ages <- setNames(fit3$node_ages$estimate_min, fit3$node_ages$clade)
stopifnot(abs(fitted_ages[["1,3"]]) < 1e-5,
abs(fitted_ages[["1,2,3,4"]] - 5 / (3 * mu * L)) < 1e-3)
pairs3 <- ptiPairIntervals(four_copy_window, mu, L)
intervals3 <- lapply(fit3$node_ages$clade, function(key)
ptiCladeInterval(pairs3,as.integer(strsplit(key,",",fixed=TRUE)[[1]])))
age_table <- fit3$node_ages
age_table$lower <- vapply(intervals3,`[[`,0,"lower")
age_table$upper <- vapply(intervals3,`[[`,0,"upper")
truth3 <- ancestry_truth$four[["125"]]
age_table$recorded_age <- unname(truth3$ages[age_table$clade])
print(age_table,row.names=FALSE) clade estimate_min estimate_max same_height_across_best_fits lower upper recorded_age
1,3 0.0000 0.0000 TRUE 0.00000 438.4511 44
1,2,3,4 266.6667 266.6667 TRUE 82.52364 1153.4474 301
drawFigure("p6_ancestral_time_intervals", function() {
par(mar = c(4.3, 7.7, 1.3, 1), bg = "white")
table <- age_table[2:1, ]
plot(NA, xlim = range(c(0, table$upper)), ylim = c(.5, 2.8), yaxt = "n",
xlab = "Generations before sampling", ylab = "", bty = "n")
axis(2, 1:2, c("All four copies", "H1, H3"), las = 1, tick = FALSE)
segments(table$lower, 1:2, table$upper, 1:2, lwd = 3, col = blue)
points(table$estimate_min, 1:2, pch = 16, col = blue)
points(table$recorded_age, 1:2, pch = 4, cex = 1.2, lwd = 2, col = orange)
legend("topright", c("Estimate and simultaneous 95% interval", "Recorded age"),
col = c(blue, orange), pch = c(16, 4), bty = "n", y.intersp = 1.8, cex = .85)
}, width = 9, height = 3.1)

drawFigure("p6_tree_time_inference", function() {
par(mfrow = c(1, 2), mar = c(3, 4.5, 2.4, .8), bg = "white")
estimated <- setNames(age_table$estimate_min, age_table$clade)
maximum <- max(c(estimated, truth3$ages)) * 1.2
drawFourCopyTree(consensus3$tree, estimated, maximum, "Mutation-likelihood estimate")
drawFourCopyTree(truth3$tree, truth3$ages, maximum, "Recorded ancestors, revealed")
}, width = 9, height = 3.6)

Check the mutation likelihood conditionally¶
Hold the recorded midpoint tree fixed and simulate 200 independent infinite-sites mutation overlays with the same rate and 250-base length. This isolates the clock model from recombination and recurrent mutation; it is a conditional check, using ancestry already generated by the main population. Include uninformative and unresolved draws.
fixed_tree <- pgMakeTree(ancestry_truth$trees[["125"]]$nodes,
ancestry_truth$trees[["125"]]$edges,
ancestry_truth$trees[["125"]]$sample_nodes,
ancestry_truth$trees[["125"]]$sample_ids,"recorded midpoint")
# Restrict the existing tree to the four observed labels.
fixed <- recordedSubset(fixed_tree)
keys <- ptiTreeClades(fixed$tree)
ids <- setNames(seq_along(keys),vapply(keys,ptiKey,""))
ages <- c(setNames(rep(0,4),as.character(1:4)),fixed$ages)
parents <- cladeNodes(fixed$tree)$parent
edges <- data.frame(parent=unname(ids[parents[!is.na(parents)]]),
child=unname(ids[names(parents)[!is.na(parents)]]))
conditional_tree <- pgMakeTree(data.frame(id=seq_along(ids),time=unname(ages[names(ids)])),
edges,unname(ids[as.character(1:4)]),paste0("H",1:4),"fixed recorded midpoint tree")
recovery <- do.call(rbind,lapply(1:200,function(i){
dna<-pgMutateTree(conditional_tree,L,mu,mutation_seed=11814900L+i)
f<-ptiFitAges(dna$haplotypes,mu,L)
interval<-ptiCladeInterval(ptiPairIntervals(dna$haplotypes,mu,L),1:4)
root<-fixed$ages["1,2,3,4"]
data.frame(compatible=f$consensus$compatible_count,
estimated_root=f$node_ages$estimate_min[f$node_ages$clade=="1,2,3,4"],
recorded_root=unname(root),covered=interval$lower<=root & root<=interval$upper)
}))
print(c(replicates=nrow(recovery),simultaneous_root_coverage=mean(recovery$covered)))
replicates simultaneous_root_coverage
200 1
drawFigure("p6_tree_recovery",function(){
par(mfrow=c(1,2),mar=c(4.4,4.6,1.8,.8))
hist(recovery$estimated_root,breaks=20,col=blue,border="white",
xlab="Root age estimated from 250 bases",main="Conditional mutation draws")
abline(v=recovery$recorded_root[1],col="#B33B32",lwd=3)
legend("topright","Recorded midpoint root",col="#B33B32",lwd=3,bty="n",cex=.8)
barplot(table(factor(recovery$compatible,levels=c(1,3,5,9,15))),col=blue,
xlab="Compatible binary trees",ylab="Mutation draws")
}, width = 9, height = 3.6)

Simulate linked ancestry under the same size history¶
Use the same twelve-copy sample size, 10,000-base chromosome, 0.2-Morgan map and symmetric binary mutation rate. The Hudson simulation follows sampled ancestors backward under the same 60 recent generations of size history. It uses an ancestral size of 100 beyond them. The continuous clock and ancestral-equilibrium tail approximate the discrete forward simulation, which used 1,000 generations of burn-in at size 100.
For the coalescent run, draw the graph under the specified size history and recombination rate . Then draw the sequences by putting mutations on the graph at rate :
With the whole chromosome shares one tree. This run is a fresh coalescent draw. The earlier fits use the original forward DNA.
design <- populationHistoryDesign()
schedule <- populationSizeSchedule(design$candidates$recent_founding, calibration)
recent_sizes <- head(c(design$design$founder_size, schedule[-1L]), -1L)
coalescent <- simulateAncestry(samples=6L,populationSize=100,
sequenceLength=10000,recombinationRate=.2/9999,
populationSizes=rev(recent_sizes),seed=20261104L,recordFullArg=TRUE)
coalescent_dna <- mutateAncestry(coalescent,calibration$mutation_rate,
seed=20261105L,model="binary")
coalescent_data <- ancestryData(coalescent_dna)
print(c(sampled_copies=coalescent_data$nHaplotypes,
mutation_sites=coalescent_data$nSites,local_trees=coalescent_data$nTrees,
recorded_intervals=coalescent_data$nRecordedTrees))
stopifnot(coalescent_data$nHaplotypes==12L,coalescent_data$nTrees>1L)
sampled_copies mutation_sites local_trees recorded_intervals
12 252 149 193
Optional: compare short windows¶
Keep the same four haplotypes and inspect chromosome 1 bases 1–1,000. Overlapping nonnested carrier groups cannot be clades of one tree under infinite sites. Find the fewest compatible blocks, keeping all equally minimal partitions. These are data constraints under that model; recurrent mutations can also create conflicts.
positions4 <- 0:999
linked_window <- chromosome[samples, seq_len(1000L), drop = FALSE]
constraints4 <- ptiLinkedConstraints(linked_window,positions4)
quarters <- seq(0,1000,length.out=5)
local_consensus <- lapply(1:4,function(i)ptiConsensus(linked_window[,positions4>=quarters[i] &
positions4<quarters[i+1],drop=FALSE]))
print(data.frame(quarter=1:4,compatible_trees=vapply(local_consensus,`[[`,0L,"compatible_count")))
print(list(minimum_blocks=constraints4$minimum_blocks,
minimal_partitions=length(constraints4$minimal_cut_sets))) quarter compatible_trees
1 1 3
2 2 3
3 3 1
4 4 1
$minimum_blocks
[1] 3
$minimal_partitions
[1] 22
drawFigure("p6_linked_carriers", function() {
par(mar = c(4, 3.5, 1.5, 1), bg = "white")
drawCarriers(linked_window, positions4)
abline(v = quarters[2:4], lty = 3, col = "gray70")
w <- constraints4$disjoint_witnesses
for (i in seq_len(nrow(w))) {
segments(w$left[i], .82, w$right[i], .82, col = orange, lwd = 3)
segments(c(w$left[i], w$right[i]), .72, c(w$left[i], w$right[i]), .92,
col = orange, lwd = 2)
}
mtext("Orange: incompatible carrier groups under infinite sites", 3, line = .1, adj = 0)
})
drawFigure("p6_local_constraints", function() {
par(mfrow = c(1, 4), mar = c(2, .6, 2.3, .4), bg = "white")
for (i in 1:4) drawFourCopyTree(local_consensus[[i]]$tree,
title = paste0("Quarter ", i, ": ", local_consensus[[i]]$compatible_count,
if (local_consensus[[i]]$compatible_count == 1) " tree" else " trees"))
}, width = 10, height = 3.1)

Compare fixed windows of the same chromosome¶
Fit bases 1–250 and 9,751–10,000 without consulting the ancestry. The red marks identify the recorded tree at each window midpoint. They do not imply that its genealogy is constant across all 250 bases. No breakpoint or root age was prescribed to generate this example.
windows <- list(first=c(1L,250L),last=c(9751L,10000L))
local_fits <- lapply(windows,function(w)ptiFitAges(chromosome[samples,
seq.int(w[1],w[2]),drop=FALSE],mu,diff(w)+1L))
local_truth <- ancestry_truth$four[c("125","9875")]
drawFigure("local_tree_change",function(){
par(mar=c(4.6,3.5,2.5,.8))
drawCarriers(linked_window,positions4)
w<-constraints4$disjoint_witnesses
for(i in seq_len(nrow(w))) segments(w$left[i],.75,w$right[i],.75,col=orange,lwd=3)
points(125,4.9,pch=18,col="#B33B32",xpd=NA)
text(125,4.9,"Recorded tree at base 125",pos=4,cex=.8,col="#B33B32",xpd=NA)
},height=4)
drawFigure("inferred_local_tree_times",function(){
par(mfrow=c(1,2),mar=c(4.4,4.8,2.1,.8))
ymax<-max(unlist(lapply(local_truth,function(t)t$ages)))*1.15
for(j in 1:2){
f<-local_fits[[j]]
ages<-setNames(f$node_ages$estimate_min,f$node_ages$clade)
drawFourCopyTree(f$consensus$tree,ages,ymax,c("Bases 1-250","Bases 9751-10000")[j])
abline(h=local_truth[[j]]$ages["1,2,3,4"],col="#B33B32",lwd=2)
}
},width=7.5,height=3.6)

Fit the whole chromosome¶
Return to H1–H12. Fit relationships first, then date the inferred nodes. A tree sequence stores each node once. Each edge identifies a parent, a child, and the interval over which they are connected. At one position, read the local tree from the edges whose intervals contain that position. If copy inherits from and from , one edge stores each interval. Read ’s parent at from the second edge. This representation shares edges across adjacent trees (Kelleher et al., 2016).
Infer the local genealogies¶
Shared derived variants identify candidate ancestors. The source ancestor builder groups focal sites by their carrier patterns and derived frequencies, then extends each ancestor using consensus among those carriers.
Match older ancestors first with the Li–Stephens copying HMM. Then match the observed copies against the ancestral sequences. The hidden state is the copied ancestor. The fitted copying paths give parent–child edges over genomic intervals. Initial node times give an ordering of ancestors. The matcher probabilities control copying and mismatch.
inferred <- inferAncestry(linked_sample$haplotypes, linked_sample$positions,
linked_sample$sequenceLength, recombinationProbability = .01,
mismatchProbability = .001)
reconstructed <- ancestryData(inferred)
stopifnot(identical(reconstructed$observed$haplotypes, linked_sample$haplotypes),
identical(reconstructed$observed$positions, linked_sample$positions))
print(c(inferred_local_trees = reconstructed$nTrees,
observed_alleles_reconstructed = length(linked_sample$haplotypes))) inferred_local_trees observed_alleles_reconstructed
62 3312
Estimate ages from mutations¶
For an edge spanning bases with child age and parent age ,
The inside–outside method combines edge likelihoods with conditional coalescent priors. A rootward pass uses descendant evidence; a leafward pass uses the rest of the inferred graph. The resulting grid gives each node’s age probabilities. Parent–child constraints give positive branch lengths.
Use the supplied mutation rate and the full panel’s diversity-based size summary, . The full panel gives , the same diversity estimate used in the Lecture 9 population-size notebook. The node-age probabilities condition on this value and the fitted topology.
The constant-size prior is a fitted approximation to this changing population. The main forward model allows recurrent mutations; the copying mismatch probability is an inference setting, distinct from the biological recombination rate.
mutation_rate <- calibration$mutation_rate
prior_size <- estimateDiversitySize(panel$haplotypes, mutation_rate,
sequenceLength = panel$sequenceLength)$Ne
dated <- dateAncestry(inferred, mutationRate = mutation_rate,
populationSize = prior_size, timepoints = 40L)
estimated <- ancestryData(dated)
stopifnot(all(is.finite(dated$nodes$time)),
all(abs(rowSums(dated$dating$posterior) - 1) < 1e-8),
identical(estimated$observed$haplotypes, linked_sample$haplotypes))
print(c(prior_Ne_from_observed_diversity = prior_size,
dated_ancestral_nodes = sum(!dated$nodes$id %in% dated$sampleIds)))prior_Ne_from_observed_diversity dated_ancestral_nodes
73.22944 52.00000
recorded_maximum <- max(vapply(ancestry_truth$trees,
function(tree) max(tree$nodes$time), numeric(1)))
drawFigure("population_arg_ages", function() {
par(mfrow = c(1, 2), mar = c(4.7, 4.6, 2.6, .7), oma = c(0, 0, 2.4, 0))
for (field in c("pair_time", "tmrca")) {
node_field <- if (field == "pair_time") "pair_node" else "root_node"
interval <- estimated$intervals
nodes <- interval[[node_field]]
bounds <- t(vapply(nodes, function(node) {
p <- dated$dating$posterior[node + 1L, ]
vapply(c(.025, .975), function(q)
dated$dating$timepoints[which(cumsum(p) >= q)[1L]], 0)
}, c(0, 0)))
x <- c(interval$left, tail(interval$right, 1L))/1000
y <- c(interval[[field]], tail(interval[[field]], 1L))
plot(NA, xlim = c(0, linked_sample$sequenceLength/1000),
ylim = c(0, max(recorded_maximum, bounds) * 1.08),
xlab = "Chromosome position (kb)", ylab = "Generations before sample",
main = if (field == "pair_time") "Ancestor of H1 and H2" else
"Ancestor of all sampled copies", cex.main = .95)
for (j in seq_len(nrow(interval))) rect(interval$left[j]/1000, bounds[j,1],
interval$right[j]/1000, bounds[j,2], col = "#DCE6F2", border = NA)
lines(x, y, type = "s", col = estimate_color, lwd = 2)
true_positions <- c(125L,2500L,5000L,7500L,9875L)
true_ages <- vapply(ancestry_truth$trees[as.character(true_positions)],function(t){
q<-pgTreeSummaries(t)
if(field=="pair_time")q$pair_time else q$TMRCA
},0)
points((true_positions-1)/1000,true_ages,pch=18,col=truth_color,cex=1.1)
}
par(xpd = NA)
legend(grconvertX(.5, "ndc", "user"), grconvertY(.99, "ndc", "user"),
c("Recorded truth", "Estimated age", "Conditional 95% interval"),
col = c(truth_color, estimate_color, "#DCE6F2"),
lty = c(NA,1,NA), lwd = c(2,2,NA), pch = c(18,NA,15),
xjust = .5, yjust = 1, horiz = TRUE, bty = "n", cex = .75)
})
# Refining the time grid checks numerical resolution.
finer <- dateAncestry(inferred, mutation_rate, prior_size, timepoints = 80L)
grid_change <- mean(abs(dated$dating$mean - finer$dating$mean)[
!dated$nodes$id %in% dated$sampleIds])
print(c(mean_age_change_with_finer_grid = grid_change))
mean_age_change_with_finer_grid
0.5939651
The curves date the ancestor of H1 and H2 and the root of the twelve-copy tree along the chromosome. Red points show recorded ages at five fixed positions. The intervals condition on the fitted topology and on the mutation rate and constant-size prior used to date it.
Methods for local genealogies¶
ARGweaver samples graphs under a coalescent and mutation model. Its Markov chain Monte Carlo (MCMC) draws represent uncertainty in relationships and branch times. ARGweaver-D adds population splits and migrant paths.
tsinfer uses haplotype matching for topology. tsdate uses the mutation clock and a coalescent prior to date the inferred nodes.
Relate estimates local topologies and times at large sample sizes. SINGER samples approximate posterior genealogies to represent uncertainty in relationships and times.
Coalescence times carry information about past population sizes. A region with unusual branching times can motivate a test for selection. Both analyses inherit uncertainty in the local trees.
Compare model predictions for allele frequencies, LD, and sharing with observed summaries. Check sensitivity to phasing, the recombination map, genotype errors, and sample composition.
Sources: Rasmussen et al. (2014), Kelleher et al. (2019), Speidel et al. (2019), Hubisz et al. (2020), Wohns et al. (2022), and Deng et al. (2025).