Why Bayesian Differential Abundance Needs a Reference
A sample’s cell-type counts describe a composition: the counts sum to the total number of captured cells. Increasing one cell type’s share therefore changes the shares available to the others, even if their absolute numbers did not change. A model of these counts must account for that dependence and must define what its effects compare. scCODA addresses both issues with a joint model for cell-type counts and a reference-cell-type parameterization.
The data should be organized as one count vector per independent biological sample, such as a donor. Cells from the same donor are not independent biological replicates. The earlier material on aggregating cells into donor-level count tables establishes this unit of analysis; scCODA models the resulting joint count vectors, rather than treating each cell as an independent replicate.
The Dirichlet-Multinomial Regression Model
Suppose \(x_i\) is a condition indicator, coded 0 for a control sample and 1 for a treated sample. Additional sample-level covariates can be included in a design vector \(\mathbf x_i\). Write the linear predictor for cell type \(k\) as \(\eta_{ik}\), and convert the predictors to a composition using the softmax function:
Here \(p_{ik}\) is the model’s expected proportion for type \(k\) in sample \(i\), conditional on the modeled covariates. For a chosen reference type \(r\), set its regression coefficients to zero, including its condition coefficient: \(\boldsymbol\beta_r=\mathbf 0\). The reference intercept can likewise be fixed to zero, since a common shift to every \(\eta_{ik}\) leaves the softmax composition unchanged. This constraint identifies the relative effects.
A Dirichlet-multinomial distribution allows more variability among samples than a multinomial distribution with a single fixed composition. One convenient parameterization first draws a latent composition \(\mathbf q_i\) and then draws counts conditional on it:
The concentration \(\phi>0\) controls the amount of extra variation: smaller \(\phi\) allows greater sample-to-sample variation in compositions, while large \(\phi\) approaches the multinomial model. Equivalently, the marginal count distribution is Dirichlet-multinomial. A typical model uses a common concentration parameter, although implementations may offer other specifications.
The basic assumptions are that each sample’s counts cover the modeled cell types and sum to \(N_i\); samples are independent biological units conditional on their covariates; and the chosen regression structure adequately describes how the expected composition changes with those covariates. The analysis also assumes that cell-type labels are sufficiently consistent across samples for a count in category \(k\) to have the same meaning throughout. Replication across donors is needed to distinguish condition effects from donor-to-donor variation.
What a Reference-Relative Coefficient Means
For a binary condition and a reference type \(r\), the condition coefficient \(\beta_k\) for another type \(k\) has a log-ratio interpretation. It is the change between conditions in the expected abundance ratio of type \(k\) to type \(r\):
Thus \(\exp(\beta_k)\) is the multiplicative change in that ratio. A positive coefficient says that type \(k\) increases relative to the reference under the modeled condition contrast; it does not, by itself, establish an increase in the absolute number of type-\(k\) cells. Because all \(p_{ik}\) sum to one, effects are inherently relative.
Worked Example: Interpreting a Condition Coefficient
Suppose a hypothetical fitted model uses T cells as the reference. For B cells, the estimated condition coefficient is \(\beta_{\mathrm B}=0.693\). Interpret the estimate on the model’s scale.
Exponentiating gives \(\exp(0.693)\approx 2.00\). The model therefore estimates that the B-cell-to-T-cell abundance ratio is about twice as large in the treated condition as in the control condition. For example, if the modeled ratio were 0.10 in controls, the corresponding ratio implied by this contrast would be about \(0.20\) in treated samples.
This is a relative comparison, not evidence that the absolute number of B cells doubled. The same ratio change could arise from more B cells, fewer T cells, or changes in both, and the count model alone does not supply an external measurement of total cell abundance.
Sparsity and Posterior Inclusion Summaries
When many cell types are modeled, estimating a nonzero condition effect for every type is often implausible and unstable. scCODA uses a sparsity-inducing prior to shrink weak or unsupported effects toward zero while allowing some effects to remain appreciable. In its standard formulation, a regularized horseshoe prior uses a global scale to encourage overall sparsity and local scales that permit individual coefficients to escape shrinkage when the data support them. In schematic form, a condition coefficient can be represented as:
Here \(\tau\) is a global shrinkage scale, \(\lambda_k\) is a cell-type-specific local scale, and \(c\) regularizes very large effects. The prior is not a guarantee that only a small number of effects are real: it encodes a preference for sparse effects, which the likelihood and data can modify. Intercepts and nuisance covariates need not receive the same prior as the condition effects of interest.
Posterior inference summarizes uncertainty in each coefficient after combining the likelihood and prior. An inclusion probability is a posterior probability that an effect meets the model’s criterion for being meaningfully nonzero. With a continuous shrinkage prior, coefficients are not exactly zero with positive posterior probability. Consequently, an inclusion summary is not automatically the probability that a coefficient is mathematically nonzero. It depends on the software’s declared effect threshold or inclusion rule; that rule should be checked when interpreting reported summaries.
Worked Example: Reading a Posterior Inclusion Summary
For a hypothetical B-cell condition coefficient, suppose 1,000 posterior draws are available. Under the analysis’s declared inclusion rule, 930 draws count as an included effect, and the posterior median coefficient is \(0.40\). Interpret these summaries.
The estimated posterior inclusion probability is \(930/1000=0.930\), or 93.0%. Conditional on the fitted model, prior, data, and inclusion rule, this summarizes how often the effect meets that rule across the posterior draws. It is not a frequentist p-value, and it is not the probability that the null hypothesis is true.
The median coefficient of \(0.40\) corresponds to \(\exp(0.40)\approx1.49\): the median posterior effect implies about a 1.49-fold change in the B-cell-to-reference ratio. The inclusion summary and effect size answer different questions: one concerns posterior support for passing the inclusion criterion, and the other describes the magnitude and direction of the relative effect. The 930 draws are computational posterior samples, not 930 biological replicates.
Why Reference Choice Matters
The reference type sets the denominator for every reported effect. If type \(r\) is replaced by type \(s\), then the contrast for type \(k\) becomes a comparison with \(s\), rather than with \(r\). In an unrestricted model, the pairwise contrast between types \(k\) and \(s\) can be expressed as \(\beta_k-\beta_s\) under the original reference. But sparse priors are applied to the parameterization being fitted: shrinking coefficients toward zero relative to \(r\) need not give the same selected set as shrinking coefficients toward zero relative to \(s\). Thus the estimated composition may be represented through contrasts, while the apparent list of selected cell types can depend on the reference.
This dependence is especially important when the reference itself may change with condition or is rare and measured imprecisely. A reference is a modeling anchor, not a claim that the cell type is biologically invariant. Investigators should choose it for scientific and measurement reasons, state it explicitly, and assess whether key conclusions are robust to reasonable alternative choices. Re-referencing can alter which effects are emphasized; it does not make the data an absolute-abundance experiment.
Worked Example: Changing the Reference Changes the Contrast
Suppose the condition coefficients from a hypothetical model using T cells as reference are \(\beta_{\mathrm B}=0.40\) for B cells and \(\beta_{\mathrm M}=-0.20\) for myeloid cells. What is the implied change in the B-cell-to-myeloid ratio?
The change in the B-to-myeloid log ratio is the difference between their T-referenced coefficients:
Exponentiating gives \(\exp(0.60)\approx1.82\). The model’s implied B-cell-to-myeloid ratio is about 1.82 times as large under the condition contrast. If myeloid cells were chosen as the reference, this same pairwise contrast would be the B-cell coefficient. However, under a sparse prior the refitted set of coefficients passing an inclusion rule may differ, so reference sensitivity should not be dismissed merely because the algebraic pairwise contrast is defined.
Model Checking, Alternatives, and Limitations
Before interpreting a sparse posterior, check whether the model and computation are credible for the study at hand. Confirm that the count table has one row per independent sample, totals are correct, category labels are consistent, and the design matrix separates condition from other covariates. Inspect sampler convergence and mixing, including trace behavior and effective sample sizes for coefficients and scale parameters. Poor mixing or a nearly unidentifiable design can make posterior inclusion summaries unstable. Extremely rare types can also yield little information about their condition effects, even when the model is fitted successfully.
The Dirichlet-multinomial accommodates extra variation relative to a multinomial model, but it does not remove all modeling assumptions. A common concentration may be inadequate if the degree of overdispersion differs substantially across samples or cell types. Results can also be sensitive to the shrinkage prior, the inclusion criterion, the selected reference, annotation quality, and the number of biological replicates. Most importantly, relative counts cannot identify a change in absolute cell numbers without external information about total abundance or sampling.
The Dirichlet-multinomial formulation is useful when joint counts and extra sample variation are central, and Bayesian shrinkage gives a coherent way to regularize many related effects. Other approaches target different features of the data or use different assumptions. A multinomial regression does not include the same Dirichlet-multinomial overdispersion; logistic-normal models use a different structure for variation and dependence among proportions. Component-wise approaches analyze cell types separately and therefore do not use the same joint compositional likelihood. These are not interchangeable procedures: compare the data structure, estimand, and assumptions rather than selecting a method by its output label alone.
A common mistake is to call a cell type “increased” because its reference-relative coefficient is positive, then interpret that as an increase in its absolute count. The coefficient only says that its modeled ratio to the chosen reference increased. Another mistake is to read a high inclusion probability as a p-value or as proof of a biological effect. The correction is to report the reference, the ratio contrast, the posterior inclusion rule, and the uncertainty, while keeping the conclusion at the relative-abundance level.
Check Your Understanding
Answer each question, then compare with the brief solutions below.
- In a Dirichlet-multinomial model, what role does the concentration parameter play compared with a multinomial model?
- A cell type has a condition coefficient of \(-0.693\) relative to the reference. What multiplicative change in its ratio to the reference does this imply?
- Why is a posterior inclusion summary not necessarily the posterior probability that a continuous coefficient is exactly nonzero?
- What does a positive reference-relative coefficient establish, and what does it not establish?
- Why can the reference choice affect which cell types pass a sparse inclusion rule?
Solutions. (1) The concentration controls extra sample-to-sample variation in compositions; smaller values permit more overdispersion than a multinomial with a fixed composition. (2) \(\exp(-0.693)\approx0.500\), so the ratio is estimated to be about half as large under the condition contrast. (3) With a continuous shrinkage prior, exact zero has posterior probability zero in the usual continuous parameterization; inclusion instead follows a declared threshold or rule. (4) It establishes an increase in the cell type’s ratio to the selected reference, not an increase in its absolute number. (5) The prior shrinks effects toward zero in the chosen reference parameterization, so changing the denominator changes which fitted coefficients are shrunk and which pass the inclusion criterion.