Documentation Index
Fetch the complete documentation index at: https://mintlify.com/satijalab/seurat-wrappers/llms.txt
Use this file to discover all available pages before exploring further.
scVIIntegration() is a Seurat v5-compatible integration method that trains an scVI variational autoencoder on single-cell count data and returns a latent representation that corrects for batch effects. It is designed to be passed to IntegrateLayers() rather than called directly.
scVIIntegration has attr(x = scVIIntegration, which = 'Seurat.method') <- 'integration' set, which registers it as a valid integration method for Seurat::IntegrateLayers().Syntax
Parameters
A merged Seurat v5 assay with split layers (one per batch). Passed internally by
IntegrateLayers().Features to include in the scVI model. If
NULL, uses all features in the object.Layer(s) to integrate. scVI requires raw unnormalized count data. For standard workflows, use
"counts".Path to the conda environment containing
scvi-tools, scanpy, and anndata. Passed to reticulate::use_condaenv(condaenv, required = TRUE). This parameter is required for the function to locate Python packages.Name for the resulting DimReduc object in the Seurat object. Use
new.reduction when calling via IntegrateLayers().Dimensionality of the scVI latent space (
n_latent in scvi-tools).Number of hidden layers in the encoder and decoder neural networks (
n_layers in scvi-tools).Generative distribution for modelling gene expression counts. Options:
"nb"— negative binomial (recommended for most scRNA-seq)"zinb"— zero-inflated negative binomial"poisson"— Poisson
Maximum number of training epochs. When
NULL, scvi-tools uses its default size-based heuristic.Returns
A named list with a singleDimReduc element keyed by new.reduction. The embeddings are the scVI latent representation (cells × ndims), with cell barcodes as row names. IntegrateLayers() unpacks this list and stores the reduction in the Seurat object.
How It Works
- Identifies batch membership per cell from split layer structure (or SCT model IDs for SCTransformed data)
- Joins count layers and builds an
AnnDataobject in Python viareticulate - Calls
scvi.model.SCVI.setup_anndata(adata, batch_key="batch")to register batches - Trains an
SCVImodel formax_epochsepochs - Extracts the latent representation via
model.get_latent_representation() - Returns a named
DimReduclist forIntegrateLayers()