When scRNA-seq Autoencoders Erase the Cells You Need
Nonlinear integration can remove donor signal and real disease biology together; architecture choice must be gated by controls, not UMAP aesthetics.
For a 100,000-cell, 2,000-gene workflow, use PCA as the required baseline, then choose Harmony or scVI only if controls show that integration reduces technical structure without erasing rare-cell evidence. A planning estimate puts 24-month labor at roughly $36,000 to $72,000 per approach, excluding compute. Measure your own p95 runtime before committing.
The failure is not a bad embedding
A UMAP can look beautifully mixed while the biology you need has disappeared. In single-cell RNA sequencing, donor, protocol, and disease status may all influence the same observed counts. An integration model must decide which differences are nuisance variation and which are the phenotype.
That decision is not identifiable from the matrix alone when disease and batch are perfectly confounded. If every case came from one protocol and every control from another, no latent representation can reliably separate the two effects without additional design information. More expressive models can fit the observed data better, but that does not establish that their latent coordinates preserve the rare disease state.
Benchmarking work has shown why integration needs multiple objectives: batch mixing and biological conservation can conflict, and rankings change with the metric and dataset [E1]. This claim would be weakened if independent, well-powered benchmarks consistently found one integration method preserved known rare phenotypes while removing batch structure across protocols, tissues, and study designs.
Treat integration as a decision system, not a visualization step. Keep raw counts and sample metadata immutable, fit a simple baseline, and require controls that test whether the suspected biology survives.
Four architectures, four failure profiles
The table uses a planning scenario of 100,000 cells and 2,000 selected genes. Latency ranges are rough engineering envelopes for a single-node run, not published benchmarks: CPU methods on a 16-core workstation with 64 GB RAM, and scVI on a workstation with a 24 GB GPU. Cache state, sparse matrix format, convergence settings, and software versions can move p95 substantially.
| Approach | p95 fit latency, planning range | Operational complexity | Team skill floor | 24-month labor cost |
|---|---|---|---|---|
| Log normalization plus PCA | Minutes to tens of minutes | Low; few moving parts | Single-cell analyst | $36,000 to $45,000 |
| Harmony on PCA space | Tens of minutes | Low to medium; tune and validate integration parameters | Analyst with integration experience | $45,000 to $54,000 |
| scVI count model | Tens of minutes to a few hours | Medium to high; training, checkpoints, seeds, GPU and version management | ML engineer plus computational biologist | $54,000 to $72,000 |
| scVI with scANVI labels | Similar or longer than scVI | High; label curation and model lifecycle add dependencies | ML engineer and domain expert | $63,000 to $72,000 |
PCA is a deliberately limited reference. It captures dominant linear variation and is easy to inspect, but may leave nonlinear technical structure unresolved. Harmony adjusts a PCA representation to encourage batch mixing. It is often a practical middle ground when the input representation is sensible and the team needs fast iteration.
scVI models count data with a probabilistic latent-variable architecture, using observed covariates such as batch during inference [E2]. Its flexibility can represent complex structure, but a batch covariate is not a biological safeguard. The model can assign a rare phenotype to batch-related variation if that assignment helps explain the training data.
scANVI adds label information to the latent model. That can improve annotation when labels are reliable, but it also makes label provenance and class imbalance operational concerns. A small mislabeled or overrepresented reference population can become a strong prior, not a harmless footnote.
The cost column assumes a fully loaded labor rate of $180,000 per engineer-year, or about $86 per hour. The ranges correspond to roughly 0.1 to 0.2 full-time equivalent over two years. They exclude cloud compute, storage, and scientist time spent resolving ambiguous biology. These are budget estimates, not vendor quotes.
Make preservation a release gate
Use controls that can fail. First, compare each integrated representation with the unintegrated PCA baseline on batch mixing and known biological labels. Second, test whether the rare phenotype retains marker expression and differential abundance. Third, run sample-level pseudobulk differential expression on raw counts, because treating thousands of cells from one donor as independent replicates inflates apparent evidence.
Where possible, hold out donors or protocols. A model that only works when cells from every donor appear in training may be learning donor-specific structure rather than a transferable phenotype. Include negative controls: unrelated cell types, shuffled condition labels within donor where design permits, and technical replicates expected to agree.
A useful gate is simple: accept integration only if it improves batch separation metrics while preserving predefined phenotype markers and sample-level effects. No single score proves preservation. If the phenotype vanishes in scVI but remains in raw-count pseudobulk and PCA, investigate before interpreting the embedding as evidence against the biology.
The mechanism is worth remembering. In a generative model, observed counts are explained through a latent state, library size, and covariates. If disease status tracks donor or protocol, multiple combinations of latent state and batch effect can explain nearly the same observations. The optimizer picks a statistically convenient explanation. Experimental design determines whether that explanation is biologically identifiable.
immutable raw counts
|
PCA baseline + sample-level QC
|
integrate: Harmony or scVI
|
batch mixing AND phenotype preservation gates
|
release embedding, retain raw-count inference
Budget for the tail, not the demo
Median runtime is not enough for an operational choice. Track p95 fit time across reruns, peak RAM and GPU memory, failed jobs, and time required to reproduce a result after a dependency upgrade. For scVI, persist the training configuration, random seed, feature selection, covariates, package versions, and checkpoint. Otherwise, a rerun can produce a different representation with no clear audit trail.
Run a local benchmark with at least three seeds and one held-out donor or protocol. Record end-to-end time, not just GPU training: data conversion, preprocessing, model fitting, and validation all consume the critical path. This test can replace the planning ranges in the table with a number your team can defend.
For a small team, PCA plus explicit QC is a sound default, not a failure to use modern ML. Choose Harmony when mixing improves without weakening known biology and the lower operational burden matters. Choose scVI when nonlinear structure is material, the design has enough overlap to identify batch and biology, and the team can maintain model and validation artifacts.
The practical rule is strict: never let a prettier embedding outrank a failed control.
Discussion (3)
The assumption of immutable raw counts doesn't hold for production pipelines that must handle incoming, incrementally QC'd datasets. Our automated reprocessing triggers weekly, and a "simple baseline" PCA run on the full historical corpus becomes a scaling bottleneck. The labor estimate also misses the audit trail cost: validating that a re-run with a new scVI release recovers the same rare clusters is a multi-person-week effort we must budget for.
The p95 fit latency for Harmony on 100k cells is optimistic. With real-world data sparsity and convergence thresholds, I've seen runs stretch to hours. That planning envelope assumes ideal tuning.
That p95 latency range for scVI is optimistic. Your 24 GB GPU likely hits HBM bandwidth limits with 100k cells and 2k genes, especially during the amortized inference step in iterative tuning. The planning estimate should account for multiple restarts with different latent dimensions, which pushes practical runtime toward hours, not tens of minutes. This changes the labor cost math if analyst wait time becomes a bottleneck.