When microbiome studies pool samples from several hospitals or sequencing runs, the usual recipe for biomarker discovery is to "correct" the batch effects first and then hand the corrected table to LEfSe. LEfSe (Linear Discriminant Analysis Effect Size) is the field's default tool for naming the microbes that distinguish, say, children with tooth decay from healthy children. We argue this order is backwards for a rank-based method. Batch correctors such as ComBat assume Gaussian location and scale shifts. On tables that are more than 80% zeros, they turn tied zeros into arbitrary continuous or negative values, and these values then feed rank tests that were only valid because they ignored magnitudes. The alternative we propose is to never transform the data at all. Every step of LEfSe (the overall significance test, the consistency check, and the effect-size score) is rewritten so that it compares cases with controls only inside each batch and then pools those within-batch comparisons.
Stated in two sentences: a microbe should count as a biomarker only if it separates cases from controls within the same batch, consistently across batches, and its effect size should be computed only from those within-batch contrasts. Batches that contain a single class cannot tell us anything about disease and are explicitly set aside, rather than silently "harmonized." The result is a drop-in replacement for LEfSe. It is paired with a semi-synthetic benchmark on real multi-cohort 16S data that measures false discoveries and replication under controlled confounding. That benchmark is the missing piece that would tell practitioners whether correct-then-test pipelines are hurting them.
Where the gap is
LEfSe runs three steps. It applies a Kruskal–Wallis rank test across classes. It then applies pairwise Wilcoxon tests within user-defined subclasses and discards features whose direction flips. Finally, it fits a linear discriminant analysis on the survivors, whose weights become the reported "LDA score." Its clinical uptake is broad, in stroke (Roseburia Abundance Associates With Severity, Evolution and Outcome of Acute Ischemic Stroke), COPD (The sputum microbiome is distinct between COPD and health, independent of smoking history) and pediatric constipation (Characteristics of functional constipation and analysis of intestinal microbiota in children aged 0–4 in Zunyi region). But all of these are single-cohort studies, where batch structure hardly matters.
The closest existing work is A cross-cohort analysis of dental plaque microbiome in early childhood caries. It pools five 16S studies (223 samples), applies a centered log-ratio transform (log of each taxon relative to the sample's geometric mean, which requires pseudo-counts for zeros) and then a sparse PLS-DA batch adjustment, and runs LEfSe and DESeq2 on the adjusted table. Correction there is a separate preprocessing stage. The paper never asks whether the adjusted matrix still satisfies LEfSe's rank assumptions, and never compares correction strategies. Our proposal does not correct the matrix at all. It changes the statistics so that batch is conditioned on rather than removed.
Two other lines of work constrain the design. Robust Differential Abundance Test in Compositional Data shows that pseudo-count log-ratio methods inflate family-wise error. It also shows that differential abundance is identifiable only if most taxa are non-differential, and it notes that its own test degrades under imbalanced depth, pointing to rank-based formulations as open. We take this as motivation for staying on ranks. Robust Differential Abundance Analysis of Microbiome Sequencing Data shows that ordinary least-squares differential abundance (LinDA) loses power and inflates false discoveries under heavy tails, and that Huber M-estimation fixes this. That paper supplies our most serious competitor, discussed below. From the batch-correction side, Batch Effects In Brain Foundation Model Embeddings reports that post-hoc ComBat only partially restores biological signal once site effects dominate. This motivates our suspicion of correct-then-analyze pipelines, though in a different data type.
Core Claim
For rank-based biomarker discovery across batches, conditioning on batch inside each test gives better-calibrated false discovery rates and more replicable biomarker lists than any transform-then-LEfSe pipeline, and the advantage grows as class balance becomes more confounded with batch. The mechanism is simple. Within one batch, ranks of raw relative abundances are unaffected by any monotone batch distortion of a taxon, including multiplicative capture-efficiency biases and depth-driven shifts. Ties at zero also stay ties. Correction methods can only approximate this invariance, and they pay for it by altering exactly the quantities that rank tests use.
Research Program
Step 1: stratified significance test. We replace Kruskal–Wallis with its blocked analogue. For two classes this is the van Elteren stratified Wilcoxon test: ranks are computed within each batch, with mid-ranks for zero ties, and the within-batch statistics are combined with weights that make the test locally most powerful under a shared shift. For more than two classes we use the stratified Kruskal–Wallis generalization.
Step 2: consistency check. We replace LEfSe's subclass Wilcoxon filter with a heterogeneity check over batches that actually contain both classes. A feature is retained if its within-batch effects agree in sign across a stated fraction of such batches and a Cochran-style heterogeneity statistic on rank-based effects (the within-batch common-language effect, i.e. the probability that a random case exceeds a random control) is not significant. Batches missing a class are excluded by construction. The pipeline reports an "informative sample fraction": the share of samples sitting in batches with both classes. This makes plain when a study simply cannot separate site from disease, a situation that stock LEfSe and ComBat both paper over.
Step 3: effect size. Each taxon is rank-normalized within its batch, mapping within-batch ranks to normal scores. Discriminant analysis is then built only from within-batch class contrasts. Let $\bar z_{bk}$ be the vector of mean normal scores for class $k$ in batch $b$, $n_{bk}$ the class count in that batch, and $S_W$ the covariance pooled within batch-by-class cells, shrunk toward its diagonal. The discriminant direction is
$$ w = S_W^{-1} \sum_{b} \frac{n_{b1} n_{b2}}{n_{b1}+n_{b2}} \left(\bar z_{b1} - \bar z_{b2}\right), $$
where the sum runs only over batches containing both classes. The weight on each batch is the effective sample size of a two-sample contrast. Because batch-level offsets fall entirely into cell means that never enter the between-class term, $w$ cannot reward a taxon whose apparent difference comes from which site enrolled more cases. The stratified LDA score for taxon $j$ is the log-scaled magnitude of $w_j$ times the pooled class separation, bootstrapped over samples within batches, following LEfSe's convention so that thresholds such as "LDA > 2" keep their meaning.
Deliverable. A drop-in tool with LEfSe's input and output formats, plus the benchmark described below.
Baselines
The naive reference is stock LEfSe run on the pooled relative-abundance table with no batch information. It shows how many biomarkers are pure site artifacts.
The first practical competitor is stock LEfSe with study identity supplied as the subclass factor. This is what a careful user can already do today, so any gain over it must come from the continuous within-batch effect-size computation rather than from merely using batch labels.
The strongest correct-then-test competitor is the pipeline of A cross-cohort analysis of dental plaque microbiome in early childhood caries: centered log-ratio, then sparse PLS-DA batch adjustment, then LEfSe. We rerun it on the same processed ECC tables. Alongside it we run ComBat followed by LEfSe, with and without class as a protected covariate. The protected version matters because that is how ComBat is typically deployed, and because it is the variant most at risk of manufacturing signal under confounding.
The strongest conditioning competitor is Huber M-estimation regression with batch as a fixed covariate, from Robust Differential Abundance Analysis of Microbiome Sequencing Data, at its published settings with Benjamini–Hochberg control. We also include the iterative-renormalization test of Robust Differential Abundance Test in Compositional Data with batch in its balancing weights.
Every method receives the same DADA2 tables, the same prevalence filter, the same nominal FDR or LDA threshold calibrated to produce comparable list lengths, and no method-specific tuning beyond published defaults.
Ablations isolate the key ingredient. We run stratified Steps 1–2 with the original pooled LDA score, and the original Steps 1–2 with the stratified score. This separates whether the gain comes from testing or from effect-size estimation.
For the strongest reported reference number, the ECC paper reports a random-forest AUROC of 0.85 (species) under within-study cross-validation and up to 0.88 under leave-one-dataset-out validation. That is a classifier number, not a biomarker-accuracy number. For the Huber baseline, no reported scalar result found on Lacuna for discovery counts or FDR on CDI, IBD or RA; the paper reports only comparative plots. For the renormalization test, the file reports family-wise error near 0.05 against up to 0.60 (ANCOM-BC) and 0.98 (DESeq2) in correlated simulations. Beating the correct-then-test pipelines means lower empirical FDR at matched power across confounding levels. Beating Huber-with-batch means equal or better FDR with higher power or higher held-out replication. Merely matching Huber would count as a negative result for the proposal's method, though not for the benchmark.
Why not just…?
Why not just give LEfSe the batch as its subclass? This is the cheapest fix and we test it directly. Its limit is structural. The subclass step is a yes/no filter, and the LDA score is still computed on pooled data. A taxon that passes the filter can therefore have its score inflated by between-site offsets whenever sites differ in case fraction. The ablation that keeps stratified testing but reverts to the pooled score measures exactly how much of the error comes from this.
Why not just run ComBat and then LEfSe? Because ComBat's location–scale model is misspecified for sparse compositions. It turns zeros into continuous or negative values that change rank ties. With class protected under unbalanced designs, it can also transfer class-associated variance into the "corrected" data. This argument is so far mechanistic rather than empirical in the file. The semi-synthetic experiment below converts it into a measured FDR curve, and if ComBat-LEfSe turns out calibrated, we will say so.
Why not just fit a robust regression with batch as a covariate and drop LEfSe entirely? This is the real threat. Huber regression with a batch term also conditions on batch, and Robust Differential Abundance Analysis of Microbiome Sequencing Data shows that it is robust to outliers. Our method can plausibly win on two points only. It needs no log transform or pseudo-count, which the renormalization paper identifies as a source of bias. And it gives a multivariate effect-size ranking that is invariant to monotone per-batch taxon distortions. The head-to-head below settles which matters. If Huber-with-batch matches us on FDR, power and replication, the honest recommendation to practitioners is to use it, and our contribution reduces to the benchmark plus the informative-fraction diagnostic.
Proposed Experiments
Semi-synthetic confounding benchmark. The central experiment uses the ECC combined cohort (five studies, 117 caries-free and 106 caries samples) and the Yatsunenko gut dataset (476 samples, 82.5% zeros, three countries treated as batches). In each, we first erase real signal by permuting class labels within batch. We then plant known differential taxa by multiplicatively scaling chosen taxa in "case" samples, drawn so that fewer than half of taxa change, which respects the identifiability condition from Robust Differential Abundance Test in Compositional Data. Next we resample case fractions per batch to sweep confounding from balanced to fully confounded. Finally, we add batch artifacts of three kinds: taxon-specific multiplicative bias, depth differences, and a non-monotone contamination spike. The last kind is included deliberately to break our method's invariance assumption and locate its failure point. Metrics are empirical FDR, power, and Spearman correlation between reported scores and planted effect sizes, each plotted against the informative sample fraction.
Real-data replication. On the ECC cohort we run leave-one-study-out discovery. Biomarkers are found on four studies and tested with a simple within-study Wilcoxon on the fifth. We record the fraction of discovered taxa that replicate in direction and significance, and the AUROC of a fixed logistic model restricted to discovered taxa. The latter is compared against the 0.88 leave-one-dataset-out ceiling that the original paper obtained with a random forest on all features. We also check whether the published Prevotella and Alloprevotella signals survive stratification.
Decisive checks. The proposal succeeds if stratified LEfSe holds FDR near nominal at every confounding level where ComBat-LEfSe and the sparse PLS-DA pipeline drift upward, and if it matches or beats Huber-with-batch on replication rate. The ablations must show which step carries the gain. It fails, and we will report it as such, if Huber-with-batch dominates, or if the gain disappears once non-monotone batch artifacts are introduced.
References
- Roseburia Abundance Associates With Severity, Evolution and Outcome of Acute Ischemic Stroke
- The sputum microbiome is distinct between COPD and health, independent of smoking history
- Characteristics of functional constipation and analysis of intestinal microbiota in children aged 0–4 in Zunyi region
- A cross-cohort analysis of dental plaque microbiome in early childhood caries
- Robust differential abundance test in compositional data
- Robust Differential Abundance Analysis of Microbiome Sequencing Data
- Batch Effects In Brain Foundation Model Embeddings