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.

Mutations on Trees and Population Size History

A mutation on a terminal branch is a singleton; a mutation on an internal branch is present in every sample descended from that branch. Start with a known tree, then use the frequency spectrum from the shared forward sample to fit ancestral size, growth and bottleneck parameters.

Keep the observed DNA RDS under data/population_history/.

Source

A specified-tree calculation

Suppose copies 1 and 2 share an internal branch. Put one mutation on that branch and one on each terminal branch. This gives five segregating sites, four singletons and one doubleton. These constructed sites are a schematic for reading SFS bins, not another population simulation.

Loading...

Let sis_i count sites with ii derived copies. The same matrix gives SS and πregion\pi_{\rm region}, the average pairwise difference. Averaged over neutral constant-size genealogies, E(si)=θ/iE(s_i)=\theta/i; a single small tree can differ from that expectation.

Loading...
plot without title

The shared-branch mutation contributes more to pairwise diversity than a singleton; both count once toward SS. To check why an SFS alone cannot identify a labeled tree, change only which samples carry the first site’s derived allele.

Same SFS; supported clade changes from {H1,H2} to {H1,H3}.

Fit a population size history from the same sample

Use the first twelve rows of the same haplotype matrix across all eight 10-kb chromosomes. These are H1,…,H12\mathrm H_1,\ldots,\mathrm H_{12}: both chromosome copies from each of the first six sampled people. Let siobss_i^{\rm obs} count sites with allele 1 in exactly ii of these twelve copies, for i=1,…,11i=1,\ldots,11.

Ancestral size NancN_{\rm anc} and growth duration gg define the candidate history Ne(t;Nanc,g)N_e(t;N_{\rm anc},g). The fixed history inputs are founder size Nb=20N_{\rm b}=20, bottleneck duration d=20d=20 generations and present size Nnow=1,000N_{\rm now}=1{,}000, with exponential growth from 20 to 1,0001{,}000 over gg generations:

Ne(u)=round⁡ ⁣[20(1,000/20)u/g],0≤u≤g.N_e(u)=\operatorname{round}\!\left[20(1{,}000/20)^{u/g}\right], \qquad 0\leq u\leq g.

Here uu counts generations since growth began. The growth curve is specified; gg is its duration in generations. The known sample and calibration inputs are n=12n=12, Ltot=80,000L_{\rm tot}=80{,}000 bases and μ=2.5×10−5\mu=2.5\times10^{-5} per base per generation.

Under the neutral infinite-sites coalescent, each candidate history predicts an expected SFS:

λi(Nanc,g)=E[si∣Nanc,g,Nb,d,Nnow,n,μ,Ltot]=μLtot E[Bi∣Nanc,g,Nb,d,Nnow,n].\begin{aligned} \lambda_i(N_{\rm anc},g) &=E[s_i\mid N_{\rm anc},g,N_{\rm b},d,N_{\rm now},n,\mu,L_{\rm tot}]\\ &=\mu L_{\rm tot}\,E[B_i\mid N_{\rm anc},g,N_{\rm b},d,N_{\rm now},n]. \end{aligned}

Here BiB_i sums the lengths of all branches with exactly ii sampled descendants in a local genealogy, in generations. For example, B1B_1 sums all terminal branch lengths. The expectation averages over the random genealogies generated by the candidate history. The fitted quantities are ancestral size and growth duration; each candidate history generates a distribution of possible trees. Linearity of expectation sums mutation opportunities across the analyzed chromosomes.

For fitting, use a Poisson composite likelihood with these means:

si∣Nanc,g,Nb,d,Nnow,n,μ,Ltot∼workingPoisson⁡{λi(Nanc,g)},s_i\mid N_{\rm anc},g,N_{\rm b},d,N_{\rm now},n,\mu,L_{\rm tot} \overset{\rm working}{\sim} \operatorname{Poisson}\{\lambda_i(N_{\rm anc},g)\},
ℓC(Nanc,g)=∑i=111log⁡pPois{siobs;λi(Nanc,g)}.\ell_{\rm C}(N_{\rm anc},g) =\sum_{i=1}^{11}\log p_{\rm Pois} \{s_i^{\rm obs};\lambda_i(N_{\rm anc},g)\}.

Vary NancN_{\rm anc} and gg to maximize this composite log likelihood; all fixed inputs stay unchanged. The expectation calculation calls Daniel Nachun’s .sfs_expected_single_pop through expectedHistorySFS().

Shared genealogies couple the SFS bins. The Poisson factors provide a working likelihood for the fit. The expectation uses infinite sites and ancestral equilibrium; the forward DNA includes recurrent mutation and finite burn-in. Compare the predicted spectrum with the observed counts to assess this approximation.

Resampling whole chromosomes and refitting measures chromosome-to-chromosome variation within this realized sample. The shared pedigree and the model approximation also contribute to uncertainty.

         parameter truth estimate    lower    upper
     ancestralSize   100 102.3788 85.96609 124.8254
 growthGenerations    40  30.0000 25.00000  35.1250
plot without title

Estimate bottleneck size and date

Use the same twelve haplotypes and eight chromosome spectra. The classical SFS composite likelihood follows Pritchard, Section 3.3, Equation 3.22, and the Handbook of Statistical Genomics, Chapter 8, Equation 8.15. The count form separates total variation from the relative spectrum:

∏iPois⁡(si;λi)=Pois⁡(S;Λ) Multinomial⁡ ⁣({si};S,{λi/Λ}),S=∑isi,Λ=∑iλi.\prod_i \operatorname{Pois}(s_i;\lambda_i) =\operatorname{Pois}(S;\Lambda)\, \operatorname{Multinomial}\!\left(\{s_i\};S,\{\lambda_i/\Lambda\}\right), \qquad S=\sum_i s_i,\quad\Lambda=\sum_i\lambda_i.

Keep bottleneck duration d=20d=20 generations and present size Nnow=1,000N_{\rm now}=1{,}000 supplied. Estimate bottleneck size NbN_{\rm b} and growth duration gg. The growth phase now starts at the unknown bottleneck size:

Ne(u)=round⁡ ⁣[Nb(NnowNb)u/g],0≤u≤g.N_e(u)=\operatorname{round}\!\left[ N_{\rm b}\left(\frac{N_{\rm now}}{N_{\rm b}}\right)^{u/g}\right], \qquad 0\leq u\leq g.

Here uu counts generations since growth began. The preceding fit fixed Nb=20N_{\rm b}=20; this fit estimates it alongside NancN_{\rm anc} and gg. The expected spectrum is

λi(Nanc,Nb,g)=μLtotE[Bi∣Nanc,Nb,g,d,Nnow,n].\lambda_i(N_{\rm anc},N_{\rm b},g) =\mu L_{\rm tot}E[B_i\mid N_{\rm anc},N_{\rm b},g,d,N_{\rm now},n].

At every bottleneck-size and growth-duration pair, optimize ancestral size:

ℓprof(Nb,g)=max⁡Nanc≥Nb∑i=111log⁡pPois{siobs;λi(Nanc,Nb,g)}.\ell_{\rm prof}(N_{\rm b},g) =\max_{N_{\rm anc}\geq N_{\rm b}} \sum_{i=1}^{11}\log p_{\rm Pois} \{s_i^{\rm obs};\lambda_i(N_{\rm anc},N_{\rm b},g)\}.

The bottleneck ended gg generations before sampling and began g+20g+20 generations before sampling. These event dates describe the size trajectory; TMRCAT_{\rm MRCA} dates a sampled genealogy’s root.

Search Nb=2,4,…,100N_{\rm b}=2,4,\ldots,100 and g=5,10,…,120g=5,10,\ldots,120, with ancestral size between NbN_{\rm b} (at least 2) and 10,000. The package composes Dan Nachun’s inspected .sfs_expected_single_pop expectation, through expectedHistorySFS(), with ordinary likelihood profiling. The expected spectrum is affine in ancestral tail size, so two kernel calls per grid cell cache that dependence for the fits and chromosome bootstrap.

The plot shows the informative part of the full search. Contours label composite log-likelihood drops; points show 200 whole-chromosome refits. The printed ranges are marginal 2.5–97.5% chromosome-bootstrap quantiles. This describes genomic variation conditional on this sampled pedigree, the supplied rates and the demographic model. Finite ancestral burn-in and recurrent mutations in the forward DNA also affect the fit.

         parameter truth estimate    lower    upper
    bottleneckSize    20 28.00000  6.00000  36.0500
 growthGenerations    40 25.00000 20.00000  50.1250
     ancestralSize   100 86.18105 74.66579 438.4663
   bottleneckBegan    60 45.00000 40.00000  70.1250
plot without title

Check the jointly fitted history against the observed spectrum

Compare the joint fit’s expected SFS with the same twelve-haplotype counts used for fitting. Black points show the observations; blue shows the fitted-history expectation. The red curve is the expectation under the generating history.

This is an in-sample fit diagnostic. The earlier reserved-chromosome and independent-simulation checks assess separate validation questions.

 alleleCount observed  jointFit generatingHistory
           1      695 682.68758         780.67178
           2      221 230.76808         221.06666
           3      133 162.67914         145.55135
           4      135 133.34348         119.33831
           5      150 114.77703         105.10239
           6      115 101.09418          95.36233
           7       91  90.26959          87.82096
           8       72  81.37124          81.56512
           9       43  73.88452          76.16169
          10       71  67.48905          71.37654
          11       77  61.96801          67.06969
plot without title

Sources. Pritchard, An Owner’s Guide to the Human Genome, Sections 2.2 and 3.3; the expected frequency spectrum uses the demographic calculation in Daniel Nachun’s demographyTools.