Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Trace the Sample through Its Parents

Read the genealogy at one position in the same forward sample. Then compare discrete Wright–Fisher waiting times with the Kingman coalescent and use the mutation clock to connect an ancestor’s age to sequence differences. Keep both RDS inputs under data/population_history/.

Source

Follow the earlier simulation at a fixed site

Replay the original size history, founder sampling, mutation, recombination and seed. Record which parental copy supplied site 5,000 during every meiosis. Recording consumes no additional random draws. Check that all sampled DNA exactly matches the earlier observed matrix before opening its ancestry.

The displayed window is generations 14–20 after founding, during the 20-individual bottleneck. Gray dots show all 40 copies in each generation; blue paths connect the ancestors of the twelve sampled haplotypes. Time runs downward. The DNA is sampled later, after expansion to 1,000 individuals.

        chromosome               site sampled_haplotypes           pair_age           root_age 
                 1               5000                 12                461                461 
Plot with title “Bottleneck: 20 individuals”

Read ages and branch lengths on the recorded tree

Collapse paths with a single child while keeping branching ancestors and all twelve sampled-copy labels. Integer-time simultaneous mergers remain. The simulation recorded the ancestral burn-in as well as the founder event and expansion, so ancestors older than founding are part of the same record.

T1,2T_{1,2} is the age of H1 and H2’s common ancestor. TMRCAT_{\rm MRCA} is the root age for all twelve copies. Here both are 461 generations: H1 and H2 meet at the root. A branch spans its parent age minus its child age. A node age and a waiting interval are different quantities.

plot without title
Loading...
plot without title

Founder identity and allele differences

As a mechanism check, isolate the same 20-individual, 20-generation bottleneck. Set mutation to zero and follow founder labels and binary alleles through the same parental draws. This control checks E(1−Ft)=E(Ht)/H0=(1−1/(2N))tE(1-F_t)=E(H_t)/H_0=(1-1/(2N))^t; it is not a new observed DNA dataset.

plot without title

Simulate the sample’s ancestors

Two distinct lineages choose the same parent copy with probability 1/(2N)1/(2N) in each discrete generation. For constant size, their waiting time has geometric survival Pr⁡(Tpair>t)=(1−1/(2N))t\Pr(T_{\rm pair}>t)=(1-1/(2N))^t. Its mean is 2N2N generations.

The large-population Kingman coalescent joins a uniformly chosen pair at each ancestral event. With kk lineages and constant size, the waiting time is exponential with rate (k2)/(2Ne)\binom{k}{2}/(2N_e). When size varies with ancestral age tt, use the current rate

λk(t)=(k2)2Ne(t).\lambda_k(t)=\frac{\binom{k}{2}}{2N_e(t)}.

Update this rate when population size changes and continue to the sample MRCA. A branch of length bb receives a Poisson number of mutations with mean μLb\mu Lb; its descendants inherit those mutations. The later comparison uses independent random genealogies from each model.

A pair sampled before founding

For a constant-size reference, use the same ancestral Ne=100N_e=100, mutation rate 2.5×10−52.5\times10^{-5} and 10,000-base chromosome length. Turn recombination off to isolate a single genealogy. The mean pairwise age is 200 generations. The Poisson clock predicts 100 differences on average. This calculation is conditional on the nonrecombining infinite-sites approximation.

        mean_wait        model_wait  mean_differences model_differences 
        199.14800         200.00000          99.53933         100.00000 
Plot with title “”

Compare discrete WF ancestry with the Kingman approximation

Draw 200 genealogies per model, with twelve sampled haplotypes and the same founder, bottleneck and expansion history. The discrete Wright–Fisher calculation follows sampled ancestors backward, one generation at a time. Kingman uses continuous waiting times with the same generation-specific population sizes.

The second experiment multiplies all population sizes and durations by ten: ancestral size 100 to 1,000, founders 20 to 200, final size 1,000 to 10,000, bottleneck duration 20 to 200 generations and growth duration 40 to 400 generations. The sample stays at twelve copies. Divide the mutation rate by ten to keep mutation exposure comparable in the sequence comparison below.

This tests the Kingman approximation as the sample becomes a smaller fraction of the population. The plot shows actual generations; compare the two models within each panel. Each branch receives the same symmetric binary mutation model.

 scale       model pair_time     TMRCA       S pi_region multifurcation
     1 Discrete WF  128.3500  278.0400 228.320  70.03432          0.185
    10 Discrete WF 1448.4200 2739.5950 227.415  70.48591          0.025
     1     Kingman  148.5218  290.1132 231.140  73.49530          0.000
    10     Kingman 1323.1169 2656.7747 224.020  68.04977          0.000
Plot with title “200 founders; growth to 10,000
200 bottleneck + 400 growth generations”

Simultaneous mergers

Discrete generations can merge more than two lineages at once. Kingman joins one pair per event. Compare the frequency of multifurcating nodes in the same repeated histories; the tenfold size-and-time scaling reduces them. For nn distinct copies in one generation, the no-merger probability is ∏j=0n−1(1−j/(2N))\prod_{j=0}^{n-1}(1-j/(2N)).

 scale       model multifurcation
     1 Discrete WF          0.185
    10 Discrete WF          0.025
     1     Kingman          0.000
    10     Kingman          0.000
plot without title

Sequence variation on these genealogies

Both models use symmetric recurrent binary mutations on integer sites. The red curve is the infinite-sites coalescent expectation under the actual size schedule, computed from the demographic SFS expectation. It is an approximation to the finite-site mutations, not heta/i heta/i for a constant population. A root state of zero specifies the mutation overlay; main-DNA analyses use the original forward states, including mutations older than the sample MRCA.

Both ancestry comparisons use the same Poisson branch-mutation overlay. It approximates the main forward simulator’s per-generation parental mutation step.

plot without title

Constant-size summaries of a changing history

Apply H^/(4μ)\widehat H/(4\mu) and S/(4μLan−1)S/(4\mu L a_{n-1}) to the same repeated histories. Red lines show their infinite-sites expectations under the generating history; neither must equal the ancestral size of 100. For the fixed pair, also compare T^1,2=M/(2μL)\widehat T_{1,2}=M/(2\mu L) with its recorded age. Recurrent mutation makes this Poisson clock approximate.

Plot with title “History scale = 10”
plot without title

The recorded tree describes the same sampled DNA at chromosome 1, site 5,000. Its ancestral ages can be read directly from the forward transmission record. The later repeated simulations check how well a coalescent approximation reproduces discrete inheritance. Population size and sample fraction affect that approximation, especially for recent mergers.