- Introduced by
- Romain Lopez, Nir Yosef and Michael I. Jordan (scVI framework); preceded by Bayesian single-cell methods from Kharchenko, Markowetz, and others
- Year
- 2018 (scVI landmark); Bayesian scRNA-seq approaches emerged 2015-2018
- Type
- Probabilistic generative modeling pipeline
- Family
- Bioinformatics / omics
What does it do?
Bayesian single-cell RNA-seq analysis applies probabilistic generative models to the sparse, overdispersed count matrices produced by single-cell RNA sequencing.
By placing a probabilistic model over latent variables such as cell state, sequencing depth and batch, the analysis carries uncertainty through clustering, embedding and differential expression rather than relying only on heuristic normalisation. Scalable implementations such as scVI fit the model approximately, by variational inference, so their uncertainty estimates are approximations. The scVI framework (Lopez et al., 2018) and the scVI-tools software built around it are among the implementations of this approach.
The intuition behind the method
A single cell captures only a small fraction of its RNA molecules, so many genes read zero by chance rather than because they are inactive. Pipelines that treat every zero as true absence, or that rely on heuristic normalisation, can distort clustering and differential expression. A Bayesian model instead asks what the most probable true expression state of each cell is, given known features of the sequencing process such as capture inefficiency, differences in library size and batch effects. The resulting posterior distribution over latent cell states is then used for clustering, trajectory inference and hypothesis testing, with an uncertainty estimate attached to each step.
History
Bayesian count models for single-cell data appeared roughly between 2015 and 2018, aiming to handle dropout and overdispersion in scRNA-seq counts. Lopez, Regier, Cole, Jordan and Yosef (2018) introduced scVI, a deep generative framework that combines a negative binomial likelihood with a learned latent representation to support batch integration, dimensionality reduction and differential expression, and the scVI-tools software ecosystem was later built around it. Eraslan et al. (2019) applied a deep count autoencoder, using a negative binomial noise model with or without zero-inflation, to denoise scRNA-seq data and impute dropout noise; the method scales linearly with the number of cells.
When to use it
Use Bayesian scRNA-seq analysis when you have sparse UMI count data from platforms such as 10x Genomics or Smart-seq and need to integrate multiple batches, donors or conditions without losing biological signal. It is particularly suitable when downstream conclusions depend on uncertainty estimates, for example in rare cell-type discovery or compositional comparisons across conditions. Under variational fitting these estimates are approximate, so check them as described under limitations. Prefer it over a simple normalise-and-cluster pipeline when batch effects are strong, when some clusters contain few cells, or when you need posterior summaries for differential expression. Avoid it when computational resources are limited, since variational training on large atlases can require GPU acceleration and long run times, and avoid it for very small datasets, where a deep generative model has more parameters than the data can constrain.
Limitations and considerations
- Likelihood misspecification: if the assumed negative binomial (or zero-inflated) form does not match the true data-generating process, posterior estimates can be biased in ways that are hard to diagnose.
- Approximation error: a variational encoder approximates the posterior, and such approximations can understate posterior variance, so credible intervals from this route may be too narrow.
- Compute demands: large atlases often need GPU hardware, and training time grows with the number of cells and model size.
- Sensitivity to settings: the number of latent dimensions, network architecture and prior choices all change the embedding, and no single setting is universally appropriate.
- Interpretability gap: latent dimensions learned by neural-network-based models do not correspond directly to named genes or pathways and need post-hoc analysis to interpret.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Represents overdispersion through a negative binomial likelihood instead of removing it with a transform before analysis, so the count distribution of the data is modelled directly.
- Batch and library-size effects enter as explicit model terms, so they can be separated from cell-state variation rather than regressed out in a separate ad-hoc step.
- Provides posterior uncertainty for latent coordinates and for differential expression, rather than point estimates alone; under variational fitting this uncertainty is approximate.
- Variational training uses stochastic optimisation, which makes fitting large, atlas-scale datasets more tractable than full MCMC sampling.
- A single fitted latent space can feed several downstream analyses, including clustering, trajectory inference and annotation, so the model is fitted once.
Applications
- Batch integration and atlas construction: harmonising single-cell datasets from multiple laboratories, donors or sequencing platforms into a unified reference.
- Rare cell-type discovery: identifying small populations whose signal would otherwise be overshadowed by dominant clusters in classical pipelines.
- Differential expression across conditions: comparing gene expression between disease and healthy states, with posterior summaries reported for each comparison.
- Trajectory and pseudotime inference: passing posterior embeddings to a dedicated trajectory tool to reconstruct developmental or differentiation paths; pseudotime uncertainty is not provided by the core model unless a specific procedure is applied and documented.
- Compositional analysis: testing whether cell-type proportions differ across experimental conditions using posterior predictive distributions.
- Multi-modal integration: extending Bayesian frameworks to paired RNA and protein (CITE-seq) or RNA and chromatin (multiome) data within unified generative models.
How it works
How it works
Raw UMI count matrices are quality-filtered to remove empty droplets, doublets and low-quality cells, using metrics such as total counts, number of detected genes and mitochondrial read fraction. Genes with very low detection rates are excluded. No log-normalisation is applied before model fitting, because Bayesian count models (negative binomial or zero-inflated variants) operate directly on integer counts.
A generative probabilistic model is specified that describes how observed counts arise from latent biological and technical variables. A common choice is a hierarchical negative binomial model: each cell has a latent low-dimensional representation z encoding its biological state, a library-size factor capturing sequencing depth, and a batch covariate. The likelihood p(x | z, library size, batch) is negative binomial, with parameters tied to a neural network (as in scVI) or to a factor model. The prior is part of the specification; a standard normal prior on z is a common default and centres the latent coordinates at zero. The count distribution can also be taken as zero-inflated negative binomial, which adds a dropout component. To choose between the two, check in posterior predictive simulations whether each reproduces the observed zero fraction and count dispersion.
The posterior distribution p(z | x) generally has no closed form for large datasets, so it must be approximated. Variational inference, the route used by scVI, optimises the evidence lower bound (ELBO) and trains an encoder network to approximate the posterior. The result is an approximate posterior, and its credible intervals are approximations that may be narrower than those of the exact posterior. MCMC samplers instead draw samples that approach the exact posterior as sampling proceeds, at greater computational cost. Either route yields per-cell posterior summaries, such as means and credible intervals, for latent coordinates and expression parameters.
The inferred posterior means of the latent variables z form a low-dimensional, batch-corrected embedding of the cells. This embedding is used for nearest-neighbour graph construction, UMAP or t-SNE visualisation, and unsupervised clustering (Leiden or Louvain). Because technical variation is absorbed by the model rather than by ad-hoc normalisation, biologically similar cells from different batches tend to cluster together, provided batch and biology are not confounded; see the over-trusting batch correction pitfall.
Downstream tasks, including differential expression, trajectory inference, cell-type annotation and compositional analysis, are performed on the inferred latent space or on the posterior predictive distribution of counts. Trajectory inference can take the posterior embedding as input to a separate trajectory tool; the core model does not by itself provide uncertainty for the pseudotime order. Differential expression compares posterior distributions of expression between groups. The resulting posterior probability that a gene is differentially expressed depends on how 'differential' is defined, for example by a minimum effect size. This definition must be specified and reported, and the quantity is not a p-value. Error control across the many genes tested is still required.
Common pitfalls
- Applying log-normalisation before fitting a count model: the model assumes raw integer counts, so pre-normalised data violates the likelihood and produces incorrect posterior estimates.
- Ignoring convergence: variational training can settle in poor local optima; without checking the ELBO training curve or repeating runs with different seeds, the embedding may be unreliable.
- Over-trusting batch correction: if biological differences are confounded with batch (for example, different cell types sequenced in different batches), the model cannot cleanly separate technical from biological variation, and correction can remove real signal.
- Choosing a single latent dimensionality without a sensitivity analysis: too few dimensions can merge distinct cell states, while too many can fit technical noise.
Frequently asked questions
What is the difference between scVI and standard Seurat/Scanpy pipelines?
Seurat and Scanpy typically use heuristic normalisation (log-normalisation and scaling) followed by PCA and nearest-neighbour clustering. scVI replaces these steps with a probabilistic model that represents sequencing depth, batch and count overdispersion explicitly, so batch correction is part of the fitted model rather than a separate adjustment. The trade-off is greater model complexity, the need to check convergence, and the fact that its posterior is fitted approximately.
Do I need a GPU to run Bayesian scRNA-seq analysis?
CPU training is possible for moderate datasets but can be slow. For atlas-scale datasets, GPU acceleration is usually needed to keep training times practical. Device handling depends on the implementation, so check the software documentation for supported hardware.
How do I choose the number of latent dimensions?
There is no universal value. Train models across a range of latent dimensionalities and assess the stability of clusters and batch mixing with metrics such as kBET and LISI. Prefer the setting where biological structure is stable and batches mix well, rather than the one that scores best on a single metric.
Can Bayesian scRNA-seq handle very small datasets?
Very small datasets can be too small for a deep generative model, because the number of parameters can exceed what the data constrain. In that case simpler Bayesian count models or standard normalise-and-cluster pipelines are often more appropriate. Check the stability of results by subsampling the data.
Is Bayesian differential expression different from a Wilcoxon or t-test on normalised data?
Yes. Bayesian differential expression compares posterior distributions of expression between groups and reports a posterior probability of differential expression. That probability depends on how differential expression is defined, for example by a minimum effect size, which must be chosen and reported. It is a different quantity from a p-value, and it reflects uncertainty in the expression estimates rather than the parametric assumptions of a t-test. Whether it performs better than Wilcoxon or t-tests on normalised data depends on the dataset and should be checked.
Related methods
Sources
Lopez, R., Regier, J., Cole, M. B., Jordan, M. I., & Yosef, N. (2018). Deep generative modeling for single-cell transcriptomics. Nature Methods, 15(12), 1053-1058.
Open DOI referenceEraslan, G., Simon, L. M., Mircea, M., Mueller, N. S., & Theis, F. J. (2019). Single-cell RNA-seq denoising using a deep count autoencoder. Nature Communications, 10(1), 390.
Open DOI reference