Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Decision Rules for Choosing an Abundance Test

Differential Abundance and Compositional Effects · Tutorial 565 of 700

Decision Rules for Choosing an Abundance Test

Learn to select an abundance analysis by clarifying the scientific contrast, assessing count variation and zeros, and checking whether the fitted model represents the data adequately.

Advanced 10 min read

What You'll Learn

  • Distinguish a single-cell-type question from a whole-composition or cell-type-ratio question.
  • Identify when binomial sampling assumptions are too restrictive and beta-binomial variation is relevant.
  • Recognize the dependence structure and limitations of a Dirichlet-multinomial model.
  • Choose and interpret a log-ratio analysis for a prespecified relative-abundance contrast.
  • Use sparsity, replication, and model diagnostics to rule out unsuitable analyses.
  • Explain why method choice cannot repair confounding, inadequate replication, or an ill-defined target.

Start With the Question, Not the Test

An abundance analysis begins with counts of cells assigned to categories, such as cell types, across samples. A method that is appropriate for asking whether one specified cell type changes need not be the best choice for asking whether the whole composition changes or whether the ratio of two types shifts. The decision is therefore not simply “which model handles counts?” It is which model represents the target comparison and the variation among samples?

Let \(Y_{ij}\) be the number of cells of type \(j\) in sample \(i\), and let \(N_i=\sum_{j=1}^K Y_{ij}\) be the total number of cells assigned to the \(K\) types in that sample. The observed proportion is \(Y_{ij}/N_i\). These are relative abundances: they describe each type as a share of the counted total, not an absolute cell number.

Definition: A component-wise analysis models the count for one type, \(Y_{ij}\), in relation to its sample total \(N_i\), and repeats the analysis for selected or all types. A beta-binomial analysis allows the probability for that type to vary among samples beyond ordinary binomial sampling. A Dirichlet-multinomial (DM) analysis models the full vector of category counts jointly. A log-ratio analysis models a contrast such as \(\log(\pi_{ij}/\pi_{ik})\), where \(\pi_{ij}\) and \(\pi_{ik}\) are relative abundances for two types.

These methods rely on counts being defined consistently across samples and on the sample-level observations being appropriate for the model’s independence and replication assumptions. The model also needs a design that can distinguish the condition comparison from other included effects. A sophisticated count distribution cannot correct a comparison that is confounded or lacks independent replication.

What Each Method Targets

For one cell type, a binomial model starts with \(Y_{ij}\mid N_i\sim\text{Binomial}(N_i,\pi_{ij})\), where \(\pi_{ij}\) is the type’s relative abundance for sample \(i\). A regression model can relate \(\pi_{ij}\) to condition and other covariates. Its key sampling assumption is that, conditional on the model and the sample total, the count has binomial variation. A component-wise analysis is most direct when the target is a particular type’s proportion or condition effect. Separate tests across many types require a plan for multiple testing.

The binomial model can be too restrictive if samples vary more than its assumptions allow. A beta-binomial model allows the underlying probability to vary between samples, representing extra-binomial variation. With mean abundance \(\pi_{ij}\) and concentration \(\phi\), its marginal variance for the sample proportion is

$$ \operatorname{Var}\left(\frac{Y_{ij}}{N_i}\right) = \frac{\pi_{ij}(1-\pi_{ij})}{N_i} \frac{N_i+\phi}{1+\phi}. $$

A finite \(\phi>0\) permits more variation than a binomial model, but the inflation depends on the sample total. A beta-binomial model remains component-wise: it does not, by itself, represent all dependence among the different cell-type counts in a sample.

A DM model is designed for the full count vector, with \(Y_i=(Y_{i1},\ldots,Y_{iK})\), total \(N_i\), mean composition \(\boldsymbol{\pi}_i\), and concentration \(\phi\). It accommodates overdispersion relative to a multinomial model, with a shared concentration controlling the overall degree of extra variation. Its dependence structure is constrained by the composition: the categories are parts of a fixed total. This is useful for an omnibus question about whether the composition differs, but it is not a flexible model for every possible pattern of category-specific dependence.

A log-ratio analysis targets relative change between components. For two types, the target can be \(\log(\pi_{ij}/\pi_{ik})\); more complex contrasts can compare groups of types using a balance. The result is interpreted as a change in a ratio, not as an absolute increase in either type. Log-ratio methods require care with zeros because the logarithm of zero is undefined. A zero-handling rule must be justified and assessed for sensitivity rather than treated as a harmless numerical detail.

A Variance Check That Helps Distinguish Binomial From Overdispersed Counts

The beta-binomial variance formula shows why model choice cannot be made from the number of cells alone. Comparing it with the binomial proportion variance gives

$$ \begin{aligned} \operatorname{Var}_{\mathrm{BB}}\left(\frac{Y_{ij}}{N_i}\right) - \operatorname{Var}_{\mathrm{Bin}}\left(\frac{Y_{ij}}{N_i}\right) &= \frac{\pi_{ij}(1-\pi_{ij})}{N_i} \left(\frac{N_i+\phi}{1+\phi}-1\right)\\ &= \frac{\pi_{ij}(1-\pi_{ij})(N_i-1)} {N_i(1+\phi)}. \end{aligned} $$

For \(N_i=1\), the difference is zero. For \(N_i>1\), \(0<\pi_{ij}<1\), and finite \(\phi>0\), the difference is strictly positive. Thus the beta-binomial variance is at least the binomial variance, and is strictly greater under those latter conditions. The formula also shows that extra variation concerns variation among sample-level proportions; a large number of cells within one sample does not substitute for independent samples.

Worked Example: A Sparse Type With Extra-Binomial Variation

Suppose a hypothetical analysis of a rare type estimates a mean proportion of \(\pi=0.020\), with \(N=1000\) cells per sample and beta-binomial concentration \(\phi=20\). Compare the estimated proportion variance with the binomial variance.

Under the binomial model,

$$ \operatorname{Var}_{\mathrm{Bin}}(\hat{\pi}) = \frac{0.020(1-0.020)}{1000} = \frac{0.0196}{1000} = 0.0000196. $$

Under the beta-binomial model, the inflation factor is \[ \frac{N+\phi}{1+\phi}=\frac{1000+20}{1+20}=\frac{1020}{21}\approx48.57. \] Therefore,

$$ \operatorname{Var}_{\mathrm{BB}}(\hat{\pi}) = 0.0000196\times\frac{1020}{21} \approx 0.0009520. $$

The corresponding standard deviations are approximately \(0.004427\) under the binomial model and \(0.03085\) under this beta-binomial model. These hypothetical parameter values imply substantial sample-to-sample variation relative to the mean proportion of \(0.020\). If diagnostics support this extra variation, a beta-binomial component-wise analysis is more defensible than treating all cells as if they supplied independent binomial information. It still requires enough independent samples to estimate the condition effect and dispersion reliably.

Decision Rules in Practice

1
Specify the target.
Is the primary question about one type, the full composition, or a prespecified ratio or balance? Choose the model whose parameter answers that question.
2
Check the observation structure.
Confirm that totals and categories are defined consistently, that the condition effect is identifiable, and that there are independent sample-level observations for inference.
3
Assess variation and sparsity.
Compare observed sample-to-sample variation with the model’s assumptions. Look at how often counts are zero and whether there is enough information to estimate the chosen model.
4
Fit and diagnose the candidate.
Check convergence, fitted values, residual patterns, dispersion, and influential samples. If the model’s assumptions or structure are inadequate, reconsider the method or the target.

Use a component-wise binomial model when the target is a particular type and binomial variation is adequate. Use a beta-binomial component model when that target remains the focus but sample-level variation exceeds the binomial assumption. Use a DM model when the joint composition is the target and its shared overdispersion structure is plausible. Use a log-ratio analysis when a relative contrast is the scientific target and zeros can be handled transparently.

These choices are not a ranking from “simple” to “best.” A DM model may be unnecessarily restrictive for a single prespecified ratio; a collection of component-wise tests may miss the fact that the scientific question concerns the composition jointly. A log-ratio analysis does not avoid compositional interpretation—it makes the relative contrast explicit. Method choice should be set by the hypothesis and design before examining which analysis gives the smallest p-value.

Worked Example: Choosing a Joint Model for a Composition Question

Consider hypothetical counts for three cell types in four independent samples, with \(N_i=1000\) in every sample.

ConditionSampleType 1Type 2Type 3
ControlC1600300100
ControlC2580320100
TreatmentT1500350150
TreatmentT2520330150

Suppose the prespecified question is whether the overall three-part composition differs by condition. The control mean proportions are \((0.590,0.310,0.100)\): for example, type 1 is \((600/1000+580/1000)/2=0.590\). The treatment means are \((0.510,0.340,0.150)\), since type 1 is \((500/1000+520/1000)/2=0.510\). The component changes are \(-0.080\), \(+0.030\), and \(+0.050\), which sum to zero as required for proportions summing to one.

Because the target is the joint composition, a DM analysis is a natural candidate rather than a set of unrelated component tests. But there are only two independent samples per condition here. Those data give little information for estimating sample-to-sample variation, so a fitted model’s uncertainty and dispersion diagnostics would be especially important. The table describes a pattern; it does not, by itself, establish a reliable condition effect.

Worked Example: Choosing a Log-Ratio Analysis

Suppose the prespecified target is the ratio of type A to type B. In a hypothetical study, control samples have counts \((A,B,C)=(40,20,40)\) and \((60,30,60)\); treatment samples have \((30,30,40)\) and \((45,45,60)\). The totals are 100, 150, 100, and 150 cells, respectively. The A-to-B ratios are \(40/20=2\) and \(60/30=2\) in controls, and \(30/30=1\) and \(45/45=1\) in treatment.

The control log-ratio for either sample is \(\log(2)\approx0.693147\), while the treatment log-ratio is \(\log(1)=0\). Thus the treatment-minus-control contrast in mean log-ratio is

$$ 0-0.693147=-0.693147 \text{ log-ratio units}. $$

Exponentiating the contrast gives \(\exp(-0.693147)\approx0.5000\). In these hypothetical counts, the A-to-B ratio in treatment is half the control ratio. This does not say that the absolute number of A cells is halved, nor that A’s proportion alone is halved: it is a statement about A relative to B. With only two samples per condition, the calculation illustrates the target effect but does not justify a precise inferential conclusion.

Diagnostics, Failure Modes, and Limitations

Diagnostics should ask whether the fitted model captures the variation and structure that matter for the stated target. For component-wise and beta-binomial fits, inspect sample-level proportions and residuals against fitted values and covariates. Look for persistent overdispersion, influential samples, and groups whose counts are almost always zero. For a DM fit, check convergence, fitted versus observed compositions, and whether a single shared concentration adequately describes variation across categories. For a log-ratio analysis, inspect the distribution of the chosen log-ratio and test whether conclusions depend strongly on the zero-handling rule.

Sparsity is a warning, not an automatic command to use one particular model. A rare type may produce many zeros even when a model is appropriate, but very few nonzero observations can leave its condition effect weakly identified. Structural zeros—types genuinely absent from a condition—pose a different problem from sampling zeros. No method can recover a well-supported contrast from information that is not present. Likewise, a model that converges is not necessarily well specified.

A common mistake is to choose a DM model whenever there are multiple cell types, or a beta-binomial model whenever there are many zeros. The correction is to define the target first, then ask whether the candidate’s assumptions and dependence structure fit the data. Another mistake is to treat the number of cells as the number of independent replicates. Cells contribute to estimating each sample’s composition; inference about condition differences also depends on independent sample-level replication.

All four approaches concern observed relative abundance unless additional information supports an absolute-abundance interpretation. Capture bias, annotation uncertainty, and missing cell types can also change the observed counts. A model choice does not remove those measurement limitations. If several candidate approaches are plausible, report the prespecified primary analysis and use alternatives as sensitivity checks, explaining what each alternative changes in the estimand or assumptions.

Key takeaway: Choose an abundance test by aligning the target hypothesis with the model: one component, a joint composition, or a relative contrast. Then verify that replication, sparsity, and diagnostics support the assumptions needed for inference.

Check Your Understanding

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

  1. A study’s primary question concerns whether one specified cell type changes, and sample proportions show more variation than a binomial model predicts. Which candidate is most directly suited, and why?
  2. A researcher asks whether the whole composition of four cell types differs between conditions. Which model is a natural candidate, and what limitation should be checked?
  3. A study asks whether the ratio of two types changes, but some samples have zero counts for one type. What must be addressed before using a log-ratio?
  4. For \(N_i=1\), how does the beta-binomial proportion variance compare with the binomial proportion variance?

Solutions. (1) A beta-binomial component-wise model directly targets the specified type while allowing extra-binomial sample variation; its dispersion and replication still need evaluation. (2) A DM model is a natural joint-composition candidate; check whether its shared overdispersion structure fits and whether there are enough independent samples to estimate it. (3) The zero-handling method must be specified and justified, and sensitivity to that choice assessed, because \(\log(0)\) is undefined. (4) They are equal: the variance difference is \(\pi_{ij}(1-\pi_{ij})(N_i-1)/[N_i(1+\phi)]=0\) when \(N_i=1\).

Clinical Biostats