Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Bayesian Inference for Lineage Fate Probabilities

Branching and Lineage Models · Tutorial 419 of 700

Bayesian Inference for Lineage Fate Probabilities

Learn to specify priors for lineage proportions and branch parameters, derive their posterior distributions, and quantify uncertainty in both lineage fate probabilities and individual cell assignments.

Advanced 12 min read

What You'll Learn

  • Specify Dirichlet priors for lineage proportions and interpret their concentration.
  • Update lineage-proportion distributions when branch labels are observed.
  • Handle uncertain branch labels by averaging over their posterior allocations.
  • Update a branch-specific parameter under a conjugate Normal model.
  • Calculate posterior cell-assignment probabilities while accounting for uncertainty in lineage proportions.
  • Recognize prior sensitivity, model misspecification, and the limits of cell-level inference.

From a fitted branch model to uncertainty about fate

A fitted branching model can provide a lineage proportion and a preferred branch label for each cell. Those summaries do not, by themselves, show how uncertain the proportions or assignments are. Bayesian inference makes that uncertainty explicit by placing distributions on unknown quantities and updating those distributions with the observed data. The result is a posterior distribution for lineage proportions and branch parameters, rather than only a single fitted value.

Here, a lineage fate probability means the model-based probability that a cell from the specified starting population belongs to a particular terminal lineage. It is conditional on the model, the observed data, and the sampling context. It is not a guarantee about an individual cell’s biological destiny. The introductory material on generative models for tree-structured cell fates and the earlier material on soft lineage assignment and latent branch labels provide the model context: a cell can have an unobserved branch label, while its measured features have branch-specific distributions.

Definition: For \(K\) possible lineages, let \(\boldsymbol{\pi}=(\pi_1,\ldots,\pi_K)\), where \(\pi_k\geq 0\) and \(\sum_{k=1}^K\pi_k=1\). The quantity \(\pi_k\) is the model’s population-level probability of lineage \(k\) for a cell in the specified starting population. A cell’s branch label \(z_i\) is a latent categorical variable taking values in \(\{1,\ldots,K\}\). Branch parameters \(\boldsymbol{\theta}=(\theta_1,\ldots,\theta_K)\) determine the distribution of observed features conditional on those labels.

A standard Bayesian specification gives the lineage proportions a Dirichlet prior, \(\boldsymbol{\pi}\sim\operatorname{Dirichlet}(\alpha_1,\ldots,\alpha_K)\), with each \(\alpha_k>0\). The prior mean of \(\pi_k\) is \(\alpha_k/\alpha_0\), where \(\alpha_0=\sum_k\alpha_k\). The \(\alpha_k\) values express prior weight for each lineage; \(\alpha_0\) controls concentration. Larger total concentration means less prior spread around the prior mean. Branch parameters also receive prior distributions, chosen to reflect the parameter scale and the likelihood for the branch-specific features.

Posterior updating and the role of latent labels

First consider observed labels. If \(n_k\) cells are known to have label \(k\), and the labels are conditionally independent draws from the same lineage proportions, the likelihood for \(\boldsymbol{\pi}\) is proportional to \(\prod_k\pi_k^{n_k}\). Multiplication by the Dirichlet prior gives a posterior that is also Dirichlet. This conjugacy gives a direct way to quantify uncertainty about the lineage proportions.

$$ \boldsymbol{\pi}\mid\mathbf{z}\sim \operatorname{Dirichlet}(\alpha_1+n_1,\ldots,\alpha_K+n_K), \qquad E(\pi_k\mid\mathbf{z})=\frac{\alpha_k+n_k}{\alpha_0+n}. $$

When labels are unknown, they cannot simply be treated as observed counts. For cell \(i\), let \(y_i\) denote its measured features and let \(f_k(y_i\mid\theta_k)\) be the likelihood of those features under branch \(k\). A typical conditional-independence model has likelihood contribution \(\pi_k f_k(y_i\mid\theta_k)\) if \(z_i=k\). The posterior for proportions, labels, and branch parameters is proportional to the joint likelihood times the prior distributions. Uncertainty about labels therefore contributes to uncertainty about both \(\boldsymbol{\pi}\) and \(\boldsymbol{\theta}\).

$$ p(\boldsymbol{\pi},\boldsymbol{\theta},\mathbf{z}\mid\mathbf{y}) \propto p(\boldsymbol{\pi})\prod_{k=1}^{K}p(\theta_k) \prod_{i=1}^{n} \left\{\pi_{z_i}f_{z_i}(y_i\mid\theta_{z_i})\right\}. $$

Conditional on a particular allocation \(\mathbf{z}\), the posterior for \(\boldsymbol{\pi}\) has the Dirichlet update above. But with latent labels, the marginal posterior is a mixture over possible allocations. In general, plugging fractional label responsibilities from an EM fit into the observed-count formula does not produce the exact Bayesian posterior: those responsibilities are estimates, not observed labels, and the posterior must account for uncertainty in the allocations. Computation may use sampling or other numerical approximations to represent that uncertainty.

Assumptions behind the simple update: The Dirichlet update for known labels assumes a common lineage-proportion vector for the modeled cells, conditionally independent labels given that vector, and correctly observed labels. For the latent-label likelihood, the branch feature distributions must also be specified, and the model assumes conditional independence of cells’ observed features given their labels and branch parameters. Violations, such as unmodeled donor structure or misspecified branch distributions, can make posterior uncertainty misleadingly narrow.

Worked posterior calculations

Worked Example: A Two-Lineage Fate Probability

Suppose 15 hypothetical cells have known lineage labels: 10 are assigned to lineage A and 5 to lineage B. Let \(q=\pi_A\), so \(\pi_B=1-q\), and use the uniform prior \(q\sim\operatorname{Beta}(1,1)\). The binomial sampling model is appropriate here because, under the stated model, each cell has an independent label with the same probability \(q\).

The beta-binomial conjugate update gives \(q\mid\text{data}\sim\operatorname{Beta}(11,6)\). Its posterior mean is

$$ E(q\mid\text{data})=\frac{11}{11+6}=\frac{11}{17}\approx 0.6471. $$

The posterior mean estimates the lineage A proportion as about 0.647, but it does not describe all the uncertainty. For a probability statement about the proportion exceeding one-half, use the beta-binomial identity \(P(q>x)=P(B\leq a-1)\) for \(q\sim\operatorname{Beta}(a,b)\) and \(B\sim\operatorname{Binomial}(a+b-1,x)\). With \(a=11\), \(b=6\), and \(x=0.5\), this gives

$$ P(q>0.5\mid\text{data}) =P\{B\leq 10\},\quad B\sim\operatorname{Binomial}(16,0.5) =\frac{\sum_{j=0}^{10}{16\choose j}}{2^{16}} =\frac{58651}{65536}\approx 0.8949. $$

Thus the posterior probability that lineage A accounts for more than half of the modeled population is about 0.895. This is a probability statement about \(q\) under the specified prior and model, not a probability that the null hypothesis is true. The uniform prior and known labels make the calculation transparent; a different prior or uncertain labels could change the result.

Worked Example: Posterior Proportions Across Three Lineages

Consider 25 hypothetical cells with known labels: 12 in lineage A, 8 in lineage B, and 5 in lineage C. Assume independent labels from a common lineage-proportion vector and choose the symmetric prior \(\boldsymbol{\pi}\sim\operatorname{Dirichlet}(1,1,1)\). The prior gives equal means to the three lineages and contributes one unit of prior concentration to each.

The posterior is \(\operatorname{Dirichlet}(13,9,6)\), with total concentration 28. Its posterior means are

$$ E(\pi_A\mid\mathbf{z})=\frac{13}{28}\approx0.4643,\quad E(\pi_B\mid\mathbf{z})=\frac{9}{28}\approx0.3214,\quad E(\pi_C\mid\mathbf{z})=\frac{6}{28}\approx0.2143. $$

These means sum to one and summarize the posterior center. Each marginal proportion has a beta distribution: for example, \(\pi_A\mid\mathbf{z}\sim\operatorname{Beta}(13,15)\), since the second parameter is the sum of the other two Dirichlet parameters. A credible interval for \(\pi_A\) can therefore be obtained from the corresponding beta quantiles. Reporting only 0.4643 would omit that interval’s uncertainty; the posterior distribution, not just its mean, is the relevant inferential result. This update is justified only if these 25 labels are treated as independent draws from the same population proportions.

Worked Example: Updating a Branch Parameter

Suppose a hypothetical quantitative feature follows a Normal distribution within lineage A, with unknown mean \(\mu_A\) and known variance \(\sigma^2=0.25\). Two cells with known lineage A labels have feature values 1.2 and 1.6. Use the prior \(\mu_A\sim N(0,1)\). This conjugate model assumes independent Normal observations conditional on \(\mu_A\), a common known variance, and a Normal prior on the mean.

The posterior variance is the reciprocal of prior precision plus data precision; the posterior mean is the precision-weighted average of the prior mean and the observed values:

$$ v_A=\left(1+\frac{2}{0.25}\right)^{-1}=\frac{1}{9}, \qquad m_A=v_A\left(1\cdot 0+\frac{1.2+1.6}{0.25}\right) =\frac{11.2}{9}\approx1.244. $$

Therefore \(\mu_A\mid\text{data}\sim N(1.244,1/9)\), with posterior standard deviation \(\sqrt{1/9}=0.3333\) feature units. A central 95% credible interval is approximately \(1.244\pm1.96(0.3333)\), or \((0.591,1.897)\) feature units. Under this model and prior, the interval contains 95% of the posterior probability for the branch mean. It is not a frequentist confidence interval, and it does not account for uncertainty in the assumed variance.

Cell assignment must average over uncertainty

For a cell with features \(y\), the conditional probability of assignment to lineage \(k\), given proportions and branch parameters, is

$$ P(z=k\mid y,\boldsymbol{\pi},\boldsymbol{\theta}) =\frac{\pi_k f_k(y\mid\theta_k)} {\sum_{\ell=1}^{K}\pi_\ell f_\ell(y\mid\theta_\ell)}. $$

When \(\boldsymbol{\pi}\) and \(\boldsymbol{\theta}\) are uncertain, the posterior assignment probability averages this conditional probability over their joint posterior distribution. This is not generally equal to substituting posterior means into the formula, because the ratio is nonlinear. Branch parameters can be integrated through their posterior distributions, producing branch-specific marginal likelihoods for the observed features; the averaging must also retain dependence between parameters when the posterior induces it.

Worked Example: Averaging a Cell’s Branch Assignment

For illustration, suppose posterior computation for a hypothetical two-lineage model is summarized by a discrete approximation to the posterior for \(q=\pi_A\): \(q=0.4,0.6,0.8\) have posterior weights \(0.2,0.5,0.3\), respectively. For a particular cell, suppose the branch-specific likelihoods after accounting for branch-parameter uncertainty are \(L_A=0.7\) and \(L_B=0.3\). These are relative likelihood values for this cell’s features under the two branches.

At each posterior value of \(q\), the conditional probability of lineage A is \(qL_A/[qL_A+(1-q)L_B]\). The three values are

$$ \begin{aligned} r(0.4)&=\frac{0.4(0.7)}{0.4(0.7)+0.6(0.3)} =\frac{0.28}{0.46}\approx0.6087,\\ r(0.6)&=\frac{0.42}{0.42+0.12} =\frac{0.42}{0.54}\approx0.7778,\\ r(0.8)&=\frac{0.56}{0.56+0.06} =\frac{0.56}{0.62}\approx0.9032. \end{aligned} $$

Averaging with the posterior weights gives \(P(z=A\mid y,\text{data})\approx0.2(0.6087)+0.5(0.7778)+0.3(0.9032)=0.7816\). In contrast, substituting the posterior mean \(E(q)=0.62\) first gives \(0.62(0.7)/[0.62(0.7)+0.38(0.3)]\approx0.7920\). The difference illustrates why posterior averaging is the principled assignment calculation. The reported 0.7816 is approximate because the posterior itself was represented by a discrete approximation.

Computation, diagnostics, and alternatives

A practical Bayesian analysis must check whether the posterior calculations are numerically stable and whether the model is plausible for the data. For a latent-label model, useful diagnostics include checking convergence and mixing of the computation used to explore the posterior, comparing estimates from multiple initial values, and verifying that the reported assignment probabilities do not depend strongly on arbitrary starting labels. Sensitivity to the Dirichlet concentration and to branch-parameter priors is important when the number of cells is modest or branch likelihoods overlap substantially.

Also examine whether the assumed branch distributions are credible for the features used to assign cells. A branch model that fits poorly, or branches whose feature distributions are nearly indistinguishable, cannot support sharply identified assignments merely because a computation returns precise numbers. In that situation, posterior assignment probabilities should tend to remain diffuse or be sensitive to modeling choices. A concentrated posterior can still be wrong if the likelihood omits relevant structure or the sampling assumptions fail.

ApproachWhat it providesImportant distinction
Maximum likelihood or EMPoint estimates of proportions, parameters, and often soft label responsibilitiesDoes not by itself provide a full posterior distribution; uncertainty requires additional methods.
Bayesian posterior inferenceDistributions for proportions and branch parameters, with uncertainty propagated to assignmentsResults depend on the likelihood, prior, and computational adequacy.
Plug-in assignmentA cell probability calculated at fixed fitted parameter valuesCan understate uncertainty because it omits parameter uncertainty and is not generally equal to posterior averaging.

The Bayesian approach is useful when uncertainty in proportions, branch parameters, and labels needs to be propagated together. It does not remove the need to define the target population or to assess the model. The simple Dirichlet update is not appropriate without modification when proportions vary across groups, cells are dependent in ways the model ignores, or labels are uncertain. These issues should be represented in the model rather than hidden by treating cells as independent evidence. A posterior assignment is a measure of uncertainty under that model, not evidence of causation or a guarantee that the inferred trajectory is biologically correct.

A short justification of the conjugate update

For known labels, the multinomial likelihood kernel is \(\prod_k\pi_k^{n_k}\). The Dirichlet prior density kernel is \(\prod_k\pi_k^{\alpha_k-1}\). Multiplying them gives \(\prod_k\pi_k^{\alpha_k+n_k-1}\), which has the form of a Dirichlet density with parameters \(\alpha_k+n_k\). The posterior mean follows from the Dirichlet mean formula, so each observed label adds one count to its lineage’s prior parameter. This derivation depends on known labels; with latent labels, the likelihood must sum or integrate over their uncertainty instead of substituting a single allocation without justification.

Common pitfall: “The EM algorithm gave this cell responsibility 0.8 for lineage A, so I can count it as 0.8 of a known A label and apply the Dirichlet update.” That generally does not yield the exact Bayesian posterior. The responsibility is a fitted conditional probability, and uncertainty in the label and parameters must be propagated jointly. Use the observed-count conjugate update only for known labels, or use a Bayesian computation that represents the latent allocations.

Check Your Understanding

Answer each question using the assumptions stated in the tutorial.

  1. With a \(\operatorname{Dirichlet}(2,3)\) prior and 4 observed labels in lineage A and 6 in lineage B, what is the posterior distribution and its mean for lineage A?
  2. Why is an EM responsibility of 0.7 not automatically an observed count of 0.7 in the exact Dirichlet posterior update?
  3. For a two-lineage cell assignment, explain why averaging the conditional assignment probability over the posterior can differ from evaluating it at the posterior mean proportion.
  4. In the Normal branch-mean example, what assumption permits the stated Normal posterior update, and what uncertainty was excluded by treating the variance as known?

Solutions. (1) The posterior is \(\operatorname{Dirichlet}(2+4,3+6)=\operatorname{Dirichlet}(6,9)\). Its lineage A marginal is \(\operatorname{Beta}(6,9)\), with mean \(6/15=0.4000\). (2) The responsibility represents uncertainty about a latent label; replacing that label by a fractional count does not generally integrate over possible allocations and their parameter uncertainty. (3) The assignment formula is a nonlinear ratio in the proportion and branch likelihoods, so the expectation of the ratio need not equal the ratio evaluated at expectations. (4) The update assumes conditionally independent Normal observations with known common variance and a Normal prior on the mean. It excludes uncertainty about the variance itself.

Clinical Biostats