Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Unequal Cell Sampling Across Lineages

Branching and Lineage Models · Tutorial 423 of 700

Unequal Cell Sampling Across Lineages

Learn how lineage-specific capture probabilities distort observed branch proportions, when inverse-probability weighting can recover population frequencies, and what assumptions and diagnostics that correction requires.

Advanced 10 min read

What You'll Learn

  • Derive the relationship between population lineage frequencies and observed sample proportions.
  • Recover lineage frequencies using inverse capture-probability weights.
  • Identify the positivity, calibration, and within-lineage sampling assumptions needed for correction.
  • Compare weighted estimates with raw proportions and sampling-model likelihoods.
  • Diagnose instability and recognize when the population frequencies are not identifiable.

Why observed branch proportions can be misleading

A lineage model may assign cells to distinct branches and estimate how frequent each fate is in the population of interest. But the cells available for analysis are not necessarily a representative sample of that population. A branch whose cells are easier to dissociate, survive, capture, or pass quality control can be overrepresented. The observed fraction of cells on a branch may therefore describe the captured sample, not the underlying lineage frequency.

The distinction matters when branch proportions are interpreted as fate frequencies. Correcting unequal sampling is possible only when the sampling mechanism is sufficiently characterized. In particular, the data alone generally cannot separate a common lineage from one that is simply sampled more readily.

Definition: Suppose there are \(K\) mutually exclusive and exhaustive lineages in a defined population at a defined time. Let \(\pi_k\) be the population frequency of lineage \(k\), so \(\pi_k \geq 0\) and \(\sum_{k=1}^{K}\pi_k=1\). Let \(q_k\) be the probability that a cell from lineage \(k\) is captured and included in the analysis. The observed sample proportion of lineage \(k\) is denoted \(\hat{r}_k\). The population frequencies \(\pi_k\) and observed proportions \(\hat{r}_k\) are different quantities unless sampling is equal across lineages.

Here, “population” must be defined by the scientific question—for example, cells present in a specified tissue at a specified time—not merely the cells recovered by the experiment. The \(q_k\) values refer to inclusion in the analyzed data, so they may combine capture, survival, and prespecified filtering. The calculation does not reveal which stage caused unequal inclusion.

How lineage-specific sampling changes proportions

Assume that a cell from lineage \(k\) is included with probability \(q_k\), and that, conditional on its lineage, inclusion does not depend on other cell characteristics relevant to the estimand. Assume also that the lineage labels are correctly assigned, the lineages cover the target population, and \(q_k>0\) for every lineage with positive population frequency. If the analysis conditions on the number of captured cells, the branch label of a captured cell has probability

$$ r_k = P(\text{lineage }k \mid \text{captured}) = \frac{\pi_k q_k}{\sum_{j=1}^{K}\pi_j q_j}. $$

The numerator is the population fraction in lineage \(k\) multiplied by its inclusion probability. The denominator is the overall probability of inclusion, averaged across lineages. Thus \(\hat{r}_k\), the observed fraction, estimates \(r_k\), not \(\pi_k\). If every lineage has the same inclusion probability, the common factor cancels and \(r_k=\pi_k\). Otherwise the observed distribution is tilted toward lineages with higher \(q_k\).

Key result: If all \(q_k\) are known and positive, population frequencies can be recovered from the observed distribution by \( \pi_k = (r_k/q_k)\big/\sum_{j=1}^{K}(r_j/q_j) \). Replacing \(r_k\) with the observed proportion \(\hat{r}_k\) gives the inverse-probability weighted estimate \( \hat{\pi}_k = (\hat{r}_k/q_k)\big/\sum_{j=1}^{K}(\hat{r}_j/q_j) \).

If \(n_k\) cells from lineage \(k\) are observed, then \(\hat{r}_k=n_k/n\), where \(n=\sum_k n_k\). Multiplying every observed cell in lineage \(k\) by \(1/q_k\) gives it more representation when it was less likely to be included. The normalized weighted estimate is therefore

$$ \hat{\pi}_k = \frac{n_k/q_k}{\sum_{j=1}^{K}n_j/q_j}. $$

This is a ratio estimator: the weighted count for one lineage is divided by the total weighted count. It is generally not exactly unbiased in a finite sample, because the denominator is random. Under the stated sampling model and adequate sample size, it is consistent: as the number of captured cells grows, it converges to the population frequency.

Why the weighting formula works

The correction can be justified directly from the observed sampling probabilities. For each lineage, divide its captured probability by its inclusion probability:

$$ \frac{r_k}{q_k} = \frac{\pi_k q_k}{q_k\sum_{j=1}^{K}\pi_jq_j} = \frac{\pi_k}{\sum_{j=1}^{K}\pi_jq_j}. $$

The right-hand side is proportional to \(\pi_k\), with the same proportionality factor for every lineage. Normalizing these quantities to sum to one cancels that factor:

$$ \frac{r_k/q_k}{\sum_{j=1}^{K}r_j/q_j} = \frac{\pi_k/\sum_j\pi_jq_j} {\sum_j\pi_j/\sum_j\pi_jq_j} = \pi_k. $$

In a sample, \(\hat{r}_k\) replaces \(r_k\). Under independent sampling from the captured-cell distribution, the observed proportions approach \(r_k\) as \(n\) increases. Since the correction is a continuous ratio when its denominator is positive, the weighted estimate approaches \(\pi_k\) as well. This justification depends on having valid inclusion probabilities; weighting cannot repair misspecified probabilities or a lineage that has zero chance of being observed.

Worked Example: Two Lineages With Unequal Capture

Suppose a hypothetical population has 60% of its cells in lineage A and 40% in lineage B. The respective capture probabilities are \(q_A=0.50\) and \(q_B=0.25\). What proportions should be expected among captured cells, and how would weighting recover the population frequencies?

The unnormalized captured fractions are \(0.60(0.50)=0.30\) for A and \(0.40(0.25)=0.10\) for B. The overall capture probability is \(0.30+0.10=0.40\). Thus the expected captured proportions are \(r_A=0.30/0.40=0.75\) and \(r_B=0.10/0.40=0.25\). The observed sample overrepresents A, even though A makes up 60% of the population.

For a hypothetical sample of 400 captured cells, suppose 300 are assigned to A and 100 to B. The weighted counts are \(300/0.50=600\) and \(100/0.25=400\). Normalizing gives \(\hat{\pi}_A=600/(600+400)=0.60\) and \(\hat{\pi}_B=400/(600+400)=0.40\). These recover the assumed population proportions in this illustrative calculation.

Worked correction with several branches

Inverse-probability weighting applies to any finite number of lineages. Each lineage is upweighted according to its own inclusion probability, and the weighted counts are then normalized together. The weights need not be absolute probabilities if only their relative values are known: multiplying all \(q_k\) by the same positive constant leaves the normalized estimate unchanged. Their relative values, however, must be correct.

Worked Example: Three Branches and Weighted Frequencies

In a hypothetical experiment, 400 captured cells are assigned to three branches. The counts are \(n_1=240\), \(n_2=120\), and \(n_3=40\). Independently calibrated capture probabilities are \(q_1=0.80\), \(q_2=0.40\), and \(q_3=0.20\). Calculate raw and weighted proportions.

The raw proportions are \(240/400=0.600\), \(120/400=0.300\), and \(40/400=0.100\). The inverse-probability weighted counts are \(240/0.80=300\), \(120/0.40=300\), and \(40/0.20=200\). Their sum is \(800\), so the estimated population frequencies are \(300/800=0.375\), \(300/800=0.375\), and \(200/800=0.250\).

The weights change the interpretation: the raw proportions summarize the captured cells, while the weighted proportions estimate the target population distribution under the assumed capture model. The weighted estimates do not establish that the capture probabilities were correctly calibrated; that requires information beyond these branch counts.

Assumptions, calibration, and identifiability

The weighting result is useful only when its assumptions match the study. First, the target population and time point must be meaningful, and the lineage categories must form a complete, nonoverlapping partition of that population. Second, each relevant lineage must have positive inclusion probability. Third, the capture probabilities must be known or estimated from appropriate external or experimental information. Fourth, within a lineage, the inclusion mechanism must not selectively favor cells in a way that changes the target distribution. If capture varies substantially within a branch, a single \(q_k\) is insufficient unless it correctly represents the average inclusion probability for the target.

A simple example shows why the capture rates cannot generally be learned from observed branch proportions alone. Suppose the observed sample is 80% A and 20% B. If capture is equal, these data are compatible with population frequencies of 80% and 20%. But if \(q_A=0.50\) and \(q_B=0.25\), the weighted frequencies are proportional to \(0.80/0.50=1.60\) and \(0.20/0.25=0.80\), giving \(2/3\) for A and \(1/3\) for B. Both population distributions can produce the same observed proportions under different capture probabilities. Without calibration or design information, the population frequencies are not identified.

Worked Example: Sensitivity to Unknown Capture Rates

A hypothetical dataset contains 80 A cells and 20 B cells. Compare the inferred population frequencies under two possible capture assumptions.

If \(q_A=q_B\), the common inclusion probability cancels in the weighting formula. The estimated population frequencies are therefore \(80/(80+20)=0.80\) for A and \(0.20\) for B.

Alternatively, suppose an external calibration indicates \(q_A=0.50\) and \(q_B=0.25\). The weighted counts are \(80/0.50=160\) for A and \(20/0.25=80\) for B. The normalized estimates are \(160/240=0.667\) for A and \(80/240=0.333\) for B. The observed counts did not change; the inference changed because the assumed capture mechanism changed. The contrast demonstrates why uncertainty about \(q_k\) should be reported rather than hidden.

Diagnostics and alternative approaches

A defensible analysis examines both the capture model and the consequences of weighting. Useful checks include comparing estimated capture probabilities across batches or processing conditions, checking whether calibration data represent the relevant cell types and workflow, and comparing raw with weighted proportions. Large differences are not automatically evidence that weighting is wrong; they indicate that the result depends materially on the sampling correction. Very small \(q_k\) values create large weights, so a few captured cells can dominate an estimate. Report the range of weights and the number of observed cells in each lineage, and consider sensitivity analyses over plausible capture rates.

If capture probabilities are estimated rather than known, their uncertainty should also contribute to uncertainty in the lineage-frequency estimates. Treating estimated \(q_k\) values as fixed can make intervals too narrow. An appropriate analysis may resample or model the calibration data jointly with the lineage counts. If the model is expressed as a multinomial distribution for captured labels, the cell probabilities are \(r_k=\pi_kq_k/\sum_j\pi_jq_j\); with known \(q_k\), this likelihood provides an alternative way to estimate \(\pi_k\). It encodes the same sampling mechanism and does not solve the problem of unknown capture probabilities by itself.

Raw proportions are appropriate when inclusion is equal across lineages, or when the target is explicitly the distribution among captured cells. Inverse-probability weighting is appropriate when lineage-specific inclusion probabilities are credible and positive. A more detailed sampling model is needed when inclusion depends on measured cell characteristics within lineages or on batch, and the relevant probabilities can be modeled or calibrated. No method can recover the frequency of a lineage that is never observed without additional assumptions or external information.

Common pitfall

A common error is to treat the fraction of captured cells in each branch as the branch’s population fate probability, then explain discrepancies only through biological mechanisms. That reasoning silently assumes equal inclusion probabilities. The correction is to define the target population, state or estimate \(q_k\), and distinguish the observed sample proportions from the population frequencies. If the probabilities are unavailable, report the observed proportions as sample summaries and describe population-frequency conclusions as dependent on unverified sampling assumptions.

Key takeaway: Observed lineage proportions are proportional to population frequencies multiplied by capture probabilities. Inverse-probability weighting can recover population frequencies when the lineage-specific probabilities are valid, positive, and appropriately calibrated; it cannot identify those frequencies from branch counts alone.

Check Your Understanding

Answer the questions, then compare your reasoning with the solutions.

  1. A population has frequencies \(\pi_A=0.30\) and \(\pi_B=0.70\), with capture probabilities \(q_A=0.20\) and \(q_B=0.80\). What proportions are expected among captured cells?
  2. A sample has 50 cells in lineage A and 50 in lineage B. The capture probabilities are \(q_A=0.50\) and \(q_B=0.25\). Calculate the weighted population-frequency estimates.
  3. Why can’t observed branch proportions alone usually determine both the population frequencies and the capture probabilities?
  4. What happens to the weighting correction if a lineage has \(q_k=0\)?

Solutions. (1) The unnormalized captured fractions are \(0.30(0.20)=0.06\) and \(0.70(0.80)=0.56\), with total \(0.62\). The captured proportions are \(0.06/0.62=0.0968\) for A and \(0.56/0.62=0.903\) for B. (2) The weighted counts are \(50/0.50=100\) and \(50/0.25=200\), so the estimates are \(100/300=0.333\) for A and \(200/300=0.667\) for B. (3) The observed probabilities depend on the products \(\pi_kq_k\), normalized by their sum; multiple frequency and capture-probability combinations can yield the same observed distribution. (4) A zero inclusion probability violates positivity: no observed cell can represent that lineage, so inverse weighting is undefined and its frequency cannot be recovered from the captured sample alone.

Clinical Biostats