Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Sampling Models for Cell-Type Counts

Differential Abundance and Compositional Effects · Tutorial 523 of 700

Sampling Models for Cell-Type Counts

Learn when a multinomial model is appropriate for cell-type counts and how to distinguish its sampling variation from variation in the underlying compositions across donors.

Advanced 11 min read

What You'll Learn

  • State the assumptions behind a multinomial model for cell-type counts.
  • Calculate expected counts, variances, and covariances under that model.
  • Explain why cell-type counts within one sample are not independent.
  • Separate conditional sampling variation from variation in donor compositions.
  • Recognize when a multinomial sampling model does not describe the full biological process.
  • Compare joint multinomial counts with simpler marginal summaries.

Why a Sampling Model Is Needed

A cell-type count table records how many captured cells fall into each category. Those counts are not the composition itself: even if the underlying cell-type proportions were fixed, a different set of sampled cells would usually produce different counts. A sampling model describes this variation and makes clear which part of an observed difference could arise from cell sampling alone.

The distinction matters in single-cell studies because cells from one donor share biological characteristics. The multinomial model describes variation in the counts conditional on a donor’s composition. It does not, by itself, describe how that composition varies between donors. Treating those as separate sources of variation prevents a precise count model from being mistaken for a complete model of biological replication.

Definition: Suppose a sample contains \(K\) mutually exclusive and exhaustive cell types. Let \(n\) be the number of sampled cells, \(C_j\) the count assigned to type \(j\), and \(p_j\) the probability that a sampled cell is assigned to type \(j\). If the \(n\) cell classifications are independent and each has the same probabilities \(p_1,\ldots,p_K\), then the count vector \((C_1,\ldots,C_K)\) has a multinomial distribution: $$ (C_1,\ldots,C_K)\sim \operatorname{Multinomial}(n;p_1,\ldots,p_K), \qquad \sum_{j=1}^{K}p_j=1. $$ The observed proportion for type \(j\) is \(C_j/n\).

Assumptions and Consequences

The multinomial model is a model for counts conditional on a specified total \(n\). Its assumptions are that each sampled cell is classified into exactly one of the \(K\) categories; the categories cover all included cells; and, conditional on the probabilities, classifications are independent with the same category probabilities for every cell. The model also treats the total number of classified cells as fixed for the sampling calculation. If the total is itself random, this multinomial model applies conditionally on its observed value, not as a model for that total.

Under these assumptions, the expected count for type \(j\) is \(np_j\), and its variance is \(np_j(1-p_j)\). For two distinct types \(j\) and \(k\), the count covariance is \(-np_jp_k\). Thus, counts for different categories are not independent: with a fixed total, an increase in one category’s count leaves fewer cells available for the others. For the observed proportion \(C_j/n\), the expectation is \(p_j\) and the variance is \(p_j(1-p_j)/n\).

$$ E(C_j)=np_j,\qquad \operatorname{Var}(C_j)=np_j(1-p_j),\qquad \operatorname{Cov}(C_j,C_k)=-np_jp_k\quad(j\ne k). $$

The negative covariance is a feature of the fixed-total sampling design, not evidence that one cell type biologically suppresses another. Since the counts sum to \(n\), their deviations from their expected values must sum to zero. The proportions also sum to one, so their variation is constrained: the \(K\) proportions cannot vary freely in all \(K\) directions.

Deriving the Multinomial Variance and Covariance

For one sampled cell, define \(I_j=1\) if it is assigned to type \(j\), and \(I_j=0\) otherwise. Its expectation is \(p_j\), and because \(I_j\) is an indicator, its variance is \(p_j(1-p_j)\). The count \(C_j\) is the sum of these indicators over the \(n\) cells. Independence between cells makes the variance of that sum \(n\) times the variance of one indicator.

For two different types, a single cell cannot be assigned to both. Therefore \(I_jI_k=0\) for \(j\ne k\), and the covariance for one cell is \(0-p_jp_k=-p_jp_k\). Summing over \(n\) independent cells gives the count covariance. This derivation identifies where the result comes from: independence is assumed across cells, while dependence between category counts is induced by their shared fixed total.

$$ C_j=\sum_{\ell=1}^{n}I_{\ell j}, \qquad \operatorname{Var}(C_j) =\sum_{\ell=1}^{n}\operatorname{Var}(I_{\ell j}) =np_j(1-p_j), $$
$$ \operatorname{Cov}(C_j,C_k) =\sum_{\ell=1}^{n}\operatorname{Cov}(I_{\ell j},I_{\ell k}) =n(0-p_jp_k) =-np_jp_k. $$

Worked Example: Expected Counts and Sampling Variation

Suppose, hypothetically, that a donor’s captured cells are sampled independently from three cell types with probabilities \(0.60\), \(0.30\), and \(0.10\), and that \(n=100\) cells are classified. The observed counts are 58, 32, and 10. Calculate the expected counts and the standard deviations under the multinomial model, then compare the observations with those expectations.

The expected counts are \(np_j\). They are \(100(0.60)=60\), \(100(0.30)=30\), and \(100(0.10)=10\) cells. The model’s count variances are \(np_j(1-p_j)\): \(100(0.60)(0.40)=24\), \(100(0.30)(0.70)=21\), and \(100(0.10)(0.90)=9\) cells squared.

Taking square roots gives standard deviations of \(\sqrt{24}=4.899\), \(\sqrt{21}=4.583\), and \(\sqrt{9}=3.000\) cells. The observed counts differ from their expectations by \(-2\), \(+2\), and \(0\) cells. These differences are modest relative to the model-based standard deviations. This comparison illustrates sampling variation; it is not a test of a biological hypothesis.

Worked Example: Why the Counts Are Not Independent

Consider a hypothetical sample of \(n=20\) cells, with probabilities \(p_1=0.50\), \(p_2=0.30\), and \(p_3=0.20\). Find the variances of the first two counts and their covariance.

For the first count, \(\operatorname{Var}(C_1)=20(0.50)(1-0.50)=5.000\) cells squared. For the second, \(\operatorname{Var}(C_2)=20(0.30)(1-0.30)=4.200\) cells squared. Their covariance is \(\operatorname{Cov}(C_1,C_2)=-20(0.50)(0.30)=-3.000\) cells squared.

For proportions, divide the count covariance by \(n^2\): \(\operatorname{Cov}(C_1/20,C_2/20)=-3/400=-0.007500\). The negative value follows because the total is fixed at 20. Modelling these two counts as independent would discard a dependence that is part of the sampling model.

Sampling Variation Versus Donor Variation

A donor’s composition can differ from another donor’s composition even before any finite set of cells is sampled. Write \(p_{ij}\) for the probability of cell type \(j\) in donor \(i\), and \(C_{ij}\) for its observed count among \(n_i\) cells. The multinomial model is then conditional on that donor’s composition: \((C_{i1},\ldots,C_{iK})\mid(p_{i1},\ldots,p_{iK})\sim\operatorname{Multinomial}(n_i;p_{i1},\ldots,p_{iK})\). The conditional variance describes sampling uncertainty around that donor’s underlying proportion. Variation in \(p_{ij}\) across donors is a different source of variation.

This separation can be expressed using the law of total variance. Let \(Q_{ij}=C_{ij}/n_i\) be the observed proportion for type \(j\), and consider a randomly selected donor with a common fixed cell count \(n\). Conditional on that donor’s proportion, the expected observed proportion is \(p_{ij}\), and its conditional variance is \(p_{ij}(1-p_{ij})/n\). The total variance is the average conditional variance plus the variance of the conditional expectation.

$$ \operatorname{Var}(Q_{ij}) =E\!\left[\operatorname{Var}(Q_{ij}\mid p_{ij})\right] +\operatorname{Var}\!\left(E[Q_{ij}\mid p_{ij}]\right) =E\!\left[\frac{p_{ij}(1-p_{ij})}{n}\right] +\operatorname{Var}(p_{ij}). $$

The first term is within-donor sampling variation; the second is donor-to-donor variation in the underlying proportion. If donors have different cell counts, the conditional contribution is \(E[p_{ij}(1-p_{ij})/n_i]\), with the expectation taken over donors. A larger \(n_i\) reduces the conditional sampling variance, but it does not remove genuine variation in \(p_{ij}\) across donors.

Worked Example: Separating Two Sources of Variation

Imagine a hypothetical population consisting of two equally common donor types. Their underlying proportions of a particular cell type are \(0.20\) and \(0.60\), respectively. Suppose 100 cells are sampled from each donor. The observed counts are 18 and 62, giving observed proportions \(0.18\) and \(0.62\). Calculate the two variance components for the donor-level observed proportion.

The mean underlying proportion across the two donor types is \((0.20+0.60)/2=0.40\). Their donor-to-donor variance is the average squared deviation from \(0.40\): \(\{(0.20-0.40)^2+(0.60-0.40)^2\}/2=(0.04+0.04)/2=0.0400\).

The conditional sampling variances are \(0.20(0.80)/100=0.001600\) and \(0.60(0.40)/100=0.002400\). Their average is \(0.002000\). The total variance for the observed proportion of a randomly selected donor is therefore \(0.0400+0.002000=0.04200\), with standard deviation \(\sqrt{0.04200}=0.2049\). In this hypothetical population, donor variation is much larger than cell-sampling variation.

The two observed proportions, \(0.18\) and \(0.62\), are each close to their respective underlying proportions. Their difference mainly reflects the assumed difference between donor compositions, not an unexpectedly large sampling fluctuation. For comparison, treating all 200 cells as independent draws from one shared probability of \(0.40\) would give a pooled-proportion variance of \(0.40(0.60)/200=0.001200\). That calculation assumes a common composition and therefore does not represent the stated donor heterogeneity.

What the Model Captures—and What It Does Not

The multinomial model is useful as a conditional sampling description: given a fixed composition and a fixed number of classified cells, it specifies the joint distribution of the counts. A one-category view can be described by a binomial distribution, since \(C_j\) alone has a binomial marginal distribution with size \(n\) and probability \(p_j\). But analysing categories one at a time does not preserve the full joint structure: the multinomial model also accounts for the constraint that all counts sum to \(n\).

A multinomial model with one common probability vector is not a model for donor-to-donor heterogeneity. Nor does the model automatically describe every stage of a single-cell experiment. Its interpretation can fail if cells are dependent conditional on the stated composition, if cell-type assignment is systematically inaccurate, or if the categories do not cover the cells being analysed. For example, if some cells are excluded but the denominator still includes them, the stated categories are not exhaustive for that denominator.

The cell total also needs a clear interpretation. If totals differ because samples have different sequencing or recovery depths, the conditional model describes count variation at each observed total; the totals themselves may require separate consideration. A high cell count can make a sample’s observed proportion precise under the conditional model without making that sample an independent biological replicate. The multinomial sampling assumption alone does not justify treating cells from one donor as independent evidence about a population of donors.

Diagnostics and Common Mistakes

A multinomial model is an assumption, not a guarantee that observed counts follow its predicted variation. Useful checks begin with the data-generation and classification process: confirm that each cell contributes to one and only one category, that the denominator is the number of cells represented by those categories, and that the probabilities being used refer to the sample under analysis. Compare observed category proportions across donors rather than assuming that one pooled proportion describes every donor. Substantial, reproducible differences across donors indicate that a common composition is not an adequate description of biological variation.

A common mistake is to say, “There are thousands of cells, so the biological sample size is thousands.” The correction is that cell count controls the precision of a within-sample proportion under the sampling model; it does not create additional donors. A second mistake is to treat multinomial category counts as independent because each has a familiar variance formula. The correction is to use the negative covariance implied by the fixed total. A third is to interpret that negative covariance as a biological antagonism. It is a mathematical consequence of the shared total and does not, by itself, establish a biological relationship.

Key takeaway: A multinomial model separates count noise from an underlying composition only conditionally: it describes cell-sampling variation around specified probabilities. Donor-to-donor variation in those probabilities is an additional source of variation, not something that disappears when more cells are counted from each donor.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. A sample has \(n=50\) cells and a cell type has probability \(p=0.20\). What are the expected count and the count variance under the multinomial model?
  2. For two distinct types with probabilities \(0.25\) and \(0.40\) in a sample of 80 cells, calculate their count covariance. Explain its sign.
  3. In one sentence, distinguish conditional cell-sampling variation from donor-to-donor biological variation.
  4. Two donors have different underlying proportions, but each has many sampled cells. Does increasing the cell count eliminate the difference between their underlying proportions? Explain.

Solutions. For question 1, the expected count is \(np=50(0.20)=10\) cells, and the variance is \(np(1-p)=50(0.20)(0.80)=8.000\) cells squared. For question 2, the covariance is \(-np_jp_k=-80(0.25)(0.40)=-8.000\) cells squared; it is negative because the fixed total couples the counts. For question 3, conditional sampling variation is variation in observed counts around a donor’s specified composition, whereas donor-to-donor variation is variation in those underlying compositions across donors. For question 4, no: more cells reduce sampling variation around each donor’s composition, but do not change the underlying compositions themselves.

Clinical Biostats