Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Pseudobulk Inference With Few Donors

Differential Expression With Pseudobulk and Mixed Models · Tutorial 498 of 700

Pseudobulk Inference With Few Donors

Understand what few donors do to pseudobulk uncertainty, how dispersion borrowing and degrees of freedom should be interpreted, and why small-sample results require caution.

Advanced 12 min read

What You'll Learn

  • Identify the independent replication unit in pseudobulk analyses.
  • Relate design-matrix rank and donor count to residual degrees of freedom.
  • Explain what empirical Bayes dispersion shrinkage can and cannot fix.
  • Calculate uncertainty in simple independent and paired donor examples.
  • Distinguish illustrative small-sample t inference from common pseudobulk count-model tests.
  • Recognize when limited donor replication makes conclusions fragile.

Why Few Donors Change the Inference

Pseudobulk analysis aggregates cell counts within each biological sample, such as a donor-condition-cell-type combination. This aggregation avoids treating every cell as an independent biological replicate. It does not, however, create more independent donors. When donor numbers are small, the estimated condition effect can be sensitive to individual donors, and the data provide limited information about variability between biological replicates.

The central issue is not simply how many cells were measured. It is how many independent experimental units contribute information to the comparison and how many parameters the design estimates from those units. Thousands of cells from a few donors may improve the precision of each donor’s aggregate measurement, but they do not supply the same information about population-level variation as additional independent donors.

Definition: In a pseudobulk analysis, a biological replicate is an independently sampled experimental unit, commonly a donor. The residual degrees of freedom describe the independent sample information left to estimate unexplained variation after fitting the model. For a model with \(m\) independent observations and design-matrix rank \(r\), the ordinary linear-model residual degrees of freedom are \(m-r\). Repeated observations from a donor are not independent observations for this calculation unless their dependence is handled by the model.

A common gene-level count model assumes that pseudobulk counts \(Y_{gj}\) for gene \(g\) and sample \(j\), conditional on the model covariates, are independent negative-binomial observations with mean \(\mu_{gj}\) and variance

$$ \operatorname{Var}(Y_{gj})=\mu_{gj}+\phi_g\mu_{gj}^{2}, $$

where \(\phi_g\) is the gene-specific dispersion. A log-link model relates the mean to sample-level predictors, with an offset accounting for library size. The count model relies on independent biological samples, an adequate mean model, and a suitable mean-variance relationship. Pairing or other repeated measurements require a design that represents the dependence rather than an assumption that all pseudobulk rows are independent.

With few donors, both the estimated condition effect and the dispersion can be uncertain. The introductory material on empirical Bayes shrinkage of gene dispersions explains how information across genes can stabilize gene-specific dispersion estimates. That borrowing can reduce the instability of estimating a separate dispersion from very few samples, but it does not add independent donors or eliminate uncertainty in the condition effect.

Dispersion, Degrees of Freedom, and the Limits of Borrowing

Dispersion describes variation beyond the Poisson count variance. For a fixed mean, larger \(\phi_g\) means greater variability among pseudobulk samples. If only a few samples are available, each gene’s observed variation is a noisy guide to its dispersion. Shrinkage toward a trend or common distribution of dispersions across genes can stabilize estimation, especially when each gene has little direct information. It is a modeling strategy, not a guarantee that the borrowed value is correct for every gene.

Degrees of freedom require particular care because different pseudobulk procedures do not all use the same reference distribution. In an ordinary linear model, residual degrees of freedom equal the number of independent observations minus the design-matrix rank. In negative-binomial generalized linear models, Wald tests are often calibrated using an asymptotic normal reference distribution, so a simple residual \(df\) is not necessarily used as a Student \(t\) reference. Likelihood-ratio tests also use an asymptotic reference distribution under their model assumptions. Quasi-likelihood procedures can use residual degrees of freedom in an \(F\)-test, with details depending on the procedure.

Therefore, reporting “the degrees of freedom” without naming the model and test can be misleading. A small donor count still matters for an asymptotic test even if software reports a precise-looking p-value: the approximation may be weak, and the estimated dispersion or standard error may be unstable. Interpret the test in light of the design, sample size, and method used rather than assuming that a large number of cells provides large-sample calibration.

Worked Example: Independent Donors and a Small-Sample Interval

Suppose a hypothetical gene has already been summarized as log2 normalized expression for three independent control donors and three independent treated donors. The values are 5.0, 5.4, 4.8 for controls and 5.8, 6.0, 5.6 for treated donors. To illustrate the effect of few donors, use a two-sample pooled \(t\) interval under independent, normally distributed donor-level values with equal population variances. This is a teaching calculation on transformed summaries, not a replacement for a negative-binomial pseudobulk analysis.

The control mean is \(\bar{x}_C=(5.0+5.4+4.8)/3=5.067\), and the treated mean is \(\bar{x}_T=(5.8+6.0+5.6)/3=5.800\). The estimated difference, treated minus control, is \(5.800-5.067=0.733\) log2 units.

The control sum of squared deviations is 0.1867 and the treated sum is 0.0800. Thus the pooled variance and standard error are

$$ s_p^2=\frac{0.1867+0.0800}{3+3-2}=0.06667,\qquad SE=s_p\sqrt{\frac{1}{3}+\frac{1}{3}} =\sqrt{0.06667\left(\frac{2}{3}\right)}=0.2108. $$

Here \(df=3+3-2=4\), and the test statistic for a zero difference is \(t=0.733/0.2108=3.478\). The two-sided \(t\)-test p-value is approximately 0.025. Using \(t_{0.975,4}=2.776\), the 95% interval is \(0.733\pm2.776(0.2108)=[0.148,1.318]\) log2 units. Under the stated assumptions, the interval describes values compatible with the data and model; it is not a 95% probability statement about this fixed effect. With only three donors per group, its width and the result’s sensitivity to assumptions deserve attention.

Paired Designs and the Information in Donors

Pairing can improve precision when each donor contributes measurements under both conditions, because the comparison can use within-donor differences. It does not turn the two measurements from each donor into two independent donors. The independent information for the condition contrast is the set of donor-level differences. In a model with donor fixed effects, the condition effect is estimated from within-donor changes; its residual degrees of freedom depend on the number of observed samples and the rank of the fitted design.

Worked Example: Four Paired Donors

Consider hypothetical treated-minus-control differences in log2 normalized expression for four donors: 0.4, 0.7, 0.2, and 0.5. Assume the differences are independent across donors and approximately normally distributed. The mean difference is \(\bar{d}=(0.4+0.7+0.2+0.5)/4=0.450\) log2 units.

The squared deviations from 0.450 sum to \(0.0025+0.0625+0.0625+0.0025=0.1300\). Therefore the sample variance is \(s_d^2=0.1300/(4-1)=0.04333\), and \(SE=s_d/\sqrt{4}=\sqrt{0.04333}/2=0.1041\). The paired statistic is \(t=0.450/0.1041=4.323\) with \(df=4-1=3\). Its two-sided p-value is approximately 0.023.

Since \(t_{0.975,3}=3.182\), the 95% interval is \(0.450\pm3.182(0.1041)=[0.119,0.781]\) log2 units. The calculation supports a positive average within-donor difference under its assumptions. It does not imply that every donor responds positively, and four donors provide limited evidence about how variable responses are in a broader donor population.

The degrees-of-freedom calculation can also be seen from design-matrix rank. If four donors each have one control and one treated pseudobulk sample, there are eight rows. A model with four donor indicators and one condition contrast has rank five when the design is estimable, leaving \(8-5=3\) residual degrees of freedom in the corresponding ordinary linear-model calculation. The condition contrast is informed by four donor pairs, not eight unrelated samples. A count-model procedure may use its own test calibration, but this rank calculation clarifies why treating the rows as independent would overstate replication.

A Dispersion Calculation With Very Few Samples

A simple method-of-moments calculation illustrates why a dispersion estimate from a handful of samples is noisy. Assume equal library-size offsets and independent negative-binomial counts with common mean \(\mu\) and dispersion \(\phi\). Since the variance is \(\mu+\phi\mu^2\), rearranging gives the rough estimate \(\hat{\phi}=(s^2-\bar{Y})/\bar{Y}^2\), with negative estimates commonly constrained to the boundary at zero. This is an illustration; modern workflows may estimate and shrink dispersions using more elaborate procedures.

Worked Example: A Noisy Raw Dispersion Estimate

Suppose one hypothetical gene has equal-offset pseudobulk counts 10, 20, 30, and 40 from four independent donors. The sample mean is \(\bar{Y}=25\). The deviations are \(-15,-5,5,15\), so the sample variance is \((225+25+25+225)/(4-1)=166.7\) counts squared.

The method-of-moments estimate is

$$ \hat{\phi}=\frac{166.7-25}{25^2} =\frac{141.7}{625}=0.2267. $$

This number is a rough gene-level estimate based on only four observations. A different set of four donor counts could give a substantially different estimate; the calculation does not establish that the true dispersion is 0.2267. Empirical Bayes shrinkage can temper such a noisy estimate using information across genes, but its benefit depends on the adequacy of the across-gene trend and does not create additional biological replicates.

How to Interpret Results and Recognize Fragility

With few donors, a small p-value does not by itself demonstrate that the analysis is well calibrated or that the estimated effect is stable. Examine the effect estimate and its uncertainty, the number of independent donors, the design’s estimability, and whether a single donor could materially change the conclusion. These are general checks on the evidence, not a substitute for the diagnostics addressed in dedicated material.

Common warning signs include a condition effect that depends on one donor, a dispersion estimate that changes sharply under modest modeling choices, or a model with little residual information after covariates are included. Confounding is especially serious: if condition is perfectly aligned with batch or another factor, the data cannot separate their effects merely by fitting a more elaborate model. When there are very few donors, adding covariates can consume scarce degrees of freedom or make the contrast unidentifiable.

Different approaches address different parts of the problem. Dispersion shrinkage stabilizes gene-wise variance estimation by borrowing across genes. A paired design can remove stable donor-level differences when within-donor comparisons are appropriate. A count-model Wald or likelihood-ratio test uses its specified model and reference distribution; a quasi-likelihood approach can account for extra uncertainty through its own variance and degrees-of-freedom framework. None of these approaches makes cells independent donors. Simple \(t\)-based summaries can clarify donor-level uncertainty, as above, but should not be confused with the output or assumptions of a fitted pseudobulk count model.

The practical conclusion should be proportional to the information available. Report the number of donors and the design, present effect sizes with uncertainty where available, and distinguish evidence for a difference in the sampled data from claims about a broader population. A wide interval or unstable estimate is not proof of no effect; it indicates that the data do not determine the effect precisely.

Common Mistakes

  • Counting cells as independent replicates. A thousand cells from each of three donors do not make three thousand independent donors. The donor is the biological replication unit for population-level inference.
  • Assuming shrinkage solves small-sample uncertainty. Borrowing information can stabilize dispersion estimates, but it cannot supply missing donor-level information or correct a misspecified model.
  • Assigning a universal degrees-of-freedom formula to every count-model test. Linear-model residual \(df\), quasi-likelihood \(F\)-test \(df\), and asymptotic Wald or likelihood-ratio reference distributions are not interchangeable.
  • Calling a non-significant result evidence of no effect. With few donors, uncertainty may be large. Report the estimate and uncertainty rather than treating failure to reject \(H_0\) as proof of equality.
Key takeaway: Pseudobulk inference with few donors is limited chiefly by independent biological replication. Dispersion borrowing may stabilize a gene-level variance estimate, and an appropriate paired or covariate-adjusted design may use available information efficiently, but neither removes the need for cautious interpretation of small-sample uncertainty.

Check Your Understanding

Work through these questions, then compare your reasoning with the solutions.

  1. A study has four donors per condition and 500 cells per donor. What is the number of independent biological replicates per condition?
  2. In a paired design with five donors, what are the ordinary one-sample \(t\)-test degrees of freedom for the donor-level differences?
  3. Why does empirical Bayes dispersion shrinkage not make a three-donor-per-group study equivalent to one with many donors?
  4. A two-condition independent-group linear model has six independent samples and a design-matrix rank of two. What are its residual degrees of freedom?
  5. Why should a Wald test from a negative-binomial pseudobulk model not automatically be interpreted using the same \(t\) degrees of freedom as a pooled two-sample \(t\)-test?

Solutions. (1) Four per condition: cells within a donor do not create additional independent donors. (2) \(5-1=4\), because the paired analysis uses five independent donor differences. (3) Shrinkage stabilizes dispersion estimation by borrowing information across genes; it does not add donor observations or eliminate uncertainty in the condition effect. (4) \(6-2=4\). (5) The negative-binomial Wald test commonly uses an asymptotic normal reference distribution, while a pooled \(t\)-test uses a Student \(t\) distribution under its own assumptions; the procedures and calibrations are not interchangeable.

Clinical Biostats