MrVI: Multi-Resolution Variational Inference
Overview
MrVI tackles a recurring problem in multi-sample / multi-donor scRNA-seq: the same cell type can behave differently between samples, and you want to discover those differences without committing up front to one cluster resolution.
The model is a two-level hierarchical VAE:
| Level | Latent | What it represents |
|---|---|---|
| 1 | u_n | Cell state, batch-corrected and sample-unaware — like a clean scVI embedding |
| 2 | z_n | Cell state with sample effects added back in — same cell type in different samples lives at slightly different points in z |
That layered design lets you do two things you can't do with vanilla scVI:
- Per-cell sample-distance matrices — for each cell, "how does this exact cell look across all samples?" Reveals stratification structure invisible at the cluster level.
- Differential abundance / DE at single-cell resolution — compare sample groups without forcing a clustering first.
Decoder: multi-head attention over batch + sample covariates. Likelihood: negative binomial on raw counts.
When to Use This Skill
- Multi-donor / multi-condition scRNA-seq where you want to find patient-level subgroups based on molecular profiles, not pre-defined clinical metadata.
- Differential expression / abundance comparisons across sample groups where you don't want to commit to a leiden resolution first.
- Exploratory analysis on cohort studies (≥ 10 samples) — MrVI shines when you have many samples.
- When scVI batch correction is too aggressive — MrVI preserves sample-level variation in
zwhile still giving you a cleanufor clustering.
Not for: