A few years ago, a computational biology group handed me a differentially expressed gene list from a single-cell RNA sequencing experiment. They had profiled peripheral blood mononuclear cells from 12 human donors: 6 patients diagnosed with an autoimmune flare and 6 healthy controls. Focusing on CD4+ T cells, they isolated roughly 400 cells per donor, yielding a matrix of 4,800 individual cell transcriptomes.
They loaded their count matrix into standard single-cell software, partitioned the data into case versus control, and ran the default differential expression tool: a cell-level Wilcoxon rank-sum (Mann-Whitney U) test.
The pipeline reported over 1,600 "statistically significant" genes at p < 0.05. The team spent two weeks categorizing these hits into biological pathways, drafting functional validation hypotheses, and preparing figures.
There was just one catch: nearly every single hit was statistical phantom noise.
The Anatomy of Pseudoreplication
The fatal mistake in that workflow is a classic statistical trap known as pseudoreplication. When you run a two-sample test comparing 2,400 case cells against 2,400 control cells, the statistical test assumes that you collected 4,800 independent observations from the universe.
In reality, you collected data from 12 humans.
Every cell isolated out of one donor carries that person's germline genome, shared epigenetic memory, environmental history, and sample-prep conditions. Their expression profiles correlate strongly with one another. When you treat 400 cells from Donor A as 400 independent measurements of the disease state, you artificially inflate your effective sample size by a factor of 400.
In 2021, Squair et al. published a landmark paper in Nature Communications detailing this exact failure mode across single-cell benchmarks. When donor-to-donor baseline variability exists—as it always does in outbred animal models and human cohorts—cell-level tests such as Wilcoxon, Student's t-test, and standard hurdle models mistake ordinary inter-individual variance for disease-driven differences. The test confuses biological variation across people with treatment variation between groups.
Verifying the Failure Mode in 30 Lines of Python
To demonstrate how extreme this failure mode is, you do not need a complex 10x Genomics dataset. You can simulate pure background noise under a pure null model with zero biological difference between conditions across all 2,000 genes.
In the simulation below, we model 2,000 genes across 12 donors (6 case, 6 control) with 400 cells per donor. For each gene, we draw a donor baseline shift from a normal distribution with standard deviation sigma = 0.35. We assign no treatment effect whatsoever: both groups share the exact same ground-truth generative parameters. Single-cell counts are sampled from a Poisson process driven by the donor-shifted baseline rate.
Here is the complete, self-contained benchmark:
from scipy.stats import mannwhitneyu, ttest_ind
import numpy as np
gen = np.random.default_rng(20261129)
n_genes = 2000
n_donors_per_arm = 6
cells_per_donor = 400
cell_fp, pb_fp = 0, 0
for _ in range(n_genes):
donor_shifts = gen.normal(0.0, 0.35, size=2 * n_donors_per_arm)
rates = np.exp(1.2 + np.repeat(donor_shifts, cells_per_donor))
counts = gen.poisson(rates)
case_cells = counts[:n_donors_per_arm * cells_per_donor]
ctrl_cells = counts[n_donors_per_arm * cells_per_donor:]
_, p_cell = mannwhitneyu(case_cells, ctrl_cells, alternative="two-sided")
if p_cell < 0.05:
cell_fp += 1
donor_totals = counts.reshape(2 * n_donors_per_arm, cells_per_donor).sum(axis=1)
log_pb = np.log1p(donor_totals)
_, p_pb = ttest_ind(
log_pb[:n_donors_per_arm], log_pb[n_donors_per_arm:], equal_var=False
)
if p_pb < 0.05:
pb_fp += 1
print(f"Cell-level false positives: {cell_fp}/{n_genes} ({cell_fp/n_genes:.2%})")
print(f"Pseudobulk false positives: {pb_fp}/{n_genes} ({pb_fp/n_genes:.2%})")
When you execute this script, the simulation yields these exact numbers:
- Cell-level Mann-Whitney false positives: 1696/2000 = 84.80%
- Donor-level Pseudobulk false positives: 89/2000 = 4.45%
Read those numbers carefully. At an alpha threshold of 0.05, an uncorrupted statistical test should flag roughly 5% of null genes by chance. The cell-level Mann-Whitney test flagged 84.80% of all genes as statistically significant.
Because the test pooled 2,400 cells per arm, minor baseline drift between the 6 cases and 6 controls produced minuscule p-values. The algorithm reported statistical certainty around completely random donor variance. In contrast, aggregating counts to the donor level restored the false-positive rate to 4.45%, safely within expected nominal error bounds.
Why Pseudobulk Aggregation Solves the Problem
The solution to multi-donor single-cell differential expression is pseudobulk aggregation.
Instead of treating each individual cell as an independent sample, you sum the raw UMI counts across all cells belonging to a specific cell type for each donor. If you have 6 cases and 6 controls, your post-aggregation matrix contains exactly 12 columns.
This transformation accomplishes three distinct mathematical goals:
- Corrects the unit of replication: The statistical test operates on N = 6 versus N = 6, matching the real number of biological subjects in the study.
- Averages out single-cell Poisson sampling noise: Individual dropouts and stochastic transcriptional bursts smooth out when you sum hundreds of cells per subject.
- Enables negative binomial dispersion modeling: You can feed the aggregated integer counts into battle-tested bulk RNA-seq tools such as DESeq2 or edgeR. These libraries estimate gene-wise dispersion across biological replicates and perform empirical Bayes shrinkage, preserving valid error control even with small donor cohorts.
Practical Implementation: Seurat and Scanpy
In R workflows using Seurat, avoid calling FindMarkers() with test.use = "wilcox" across multi-donor experimental groups. Instead, use Seurat's aggregation utilities:
# Aggregate raw counts per donor and cell type
pseudo_counts <- AggregateExpression(
seurat_obj,
assays = "RNA",
return.seurat = FALSE,
group.by = c("donor_id", "cell_type")
)
# Extract counts for the target lineage and run DESeq2
cd4_counts <- pseudo_counts$RNA[, grep("CD4_T", colnames(pseudo_counts$RNA))]
In Python workflows using Scanpy, you extract the raw count layer from your .h5ad file and group by donor and cell annotation:
import scanpy as sc
import pandas as pd
from pydeseq2.dds import DeseqDataSet
from pydeseq2.ds import DeseqStats
# Aggregate raw counts by donor and cell_type
# Sum raw UMI integers per (donor_id, cell_type) slice
# Format into a samples x genes count matrix for PyDESeq2
dds = DeseqDataSet(
counts=pb_counts_df,
metadata=donor_metadata_df,
design_factors="condition"
)
dds.deseq2()
stat_res = DeseqStats(dds, contrast=["condition", "case", "control"])
stat_res.summary()
When Is Cell-Level Wilcoxon Actually Valid?
Cell-level tests are not inherently broken; they are simply designed for a different question.
When you want to identify marker genes that distinguish Cluster 0 (for example, B cells) from Cluster 1 (for example, Monocytes) within a single sequenced dataset, cell-level Wilcoxon is completely appropriate. In that context, the cell is the biological unit of interest: you are characterizing cell identities and lineage boundaries within a shared cellular suspension.
The breakdown occurs exclusively when researchers use intra-dataset clustering tests to answer inter-individual condition questions (such as case versus control, treated versus untreated, or responder versus non-responder). As soon as your hypothesis compares biological donors, your statistical unit must be the donor.
Upstream Hygiene: Doublet Removal Before Batch Integration
Sound differential expression also depends on clean upstream processing. Two common preprocessing mistakes routinely distort pseudobulk counts:
First, doublet detection (using tools like scDblFinder in Bioconductor or Scrublet in Python) must be executed on each 10x capture lane independently before data merging or batch correction. Doublets are physical artifacts created when two cells enter the same microfluidic droplet during emulsion generation. The doublet rate depends directly on the cell loading concentration of that specific fluidic channel. Simulating artificial multiplets requires the native library distribution of that single lane.
Second, batch correction tools like Harmony must never be run prior to doublet removal. Harmony aligns low-dimensional embeddings across runs by projecting out technical differences. If you run Harmony first, it softens the transcriptional differences between distinct cell types, blinding doublet detection algorithms to hybrid transcriptomes.
The correct pipeline sequence is straightforward:
- Filter low-quality droplets and identify doublets per capture lane.
- Remove predicted doublets and merge valid single cells.
- Run Harmony on low-dimensional PCA embeddings for clustering and cell annotation.
- Extract raw, unadjusted integer counts per cell type.
- Aggregate counts per donor into pseudobulk matrices and perform condition-level testing with DESeq2 or PyDESeq2.
Keeping the unit of observation aligned with the unit of biological replication protects your downstream experimental work from chasing statistical artifacts.
Top comments (1)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.