User#

Import scvi-tools as:

import scvi

Model#

model.AUTOZI

Automatic identification of ZI genes [Clivio et al., 2019].

model.CondSCVI

Conditional version of single-cell Variational Inference, used for multi-resolution deconvolution of spatial transcriptomics data [Lopez et al., 2021].

model.DestVI

Multi-resolution deconvolution of Spatial Transcriptomics data (DestVI) [Lopez et al., 2021].

model.LinearSCVI

Linearly-decoded VAE [Svensson et al., 2020].

model.PEAKVI

Peak Variational Inference [Ashuach et al., 2022].

model.SCANVI

Single-cell annotation using variational inference [Xu et al., 2021].

model.SCVI

single-cell Variational Inference [Lopez et al., 2018].

model.TOTALVI

total Variational Inference [Gayoso et al., 2021].

model.MULTIVI

Integration of multi-modal and single-modality data [Ashuach et al., 2021].

model.AmortizedLDA

Amortized Latent Dirichlet Allocation [Blei et al., 2003].

model.JaxSCVI

EXPERIMENTAL single-cell Variational Inference [Lopez et al., 2018], but with a Jax backend.

External models#

external.CellAssign

Reimplementation of CellAssign for reference-based annotation [Zhang et al., 2019].

external.GIMVI

Joint VAE for imputing missing genes in spatial data [Lopez et al., 2019].

external.RNAStereoscope

Reimplementation of Stereoscope [Andersson et al., 2020] for deconvolution of spatial transcriptomics from single-cell transcriptomics.

external.SpatialStereoscope

Reimplementation of Stereoscope [Andersson et al., 2020] for deconvolution of spatial transcriptomics from single-cell transcriptomics.

external.SOLO

Doublet detection in scRNA-seq [Bernstein et al., 2020].

external.SCAR

Ambient RNA removal in scRNA-seq data [Sheng et al., 2022].

external.Tangram

Reimplementation of Tangram [Biancalani et al., 2021] for mapping single-cell RNA-seq data to spatial data.

Data loading#

scvi-tools relies entirely on the AnnData format. For convenience, we have included data loaders from the AnnData API. Scanpy also has utilities to load data that are outputted by 10x’s Cell Ranger software.

data.read_h5ad

Read .h5ad-formatted hdf5 file.

data.read_csv

Read .csv file.

data.read_loom

Read .loom-formatted hdf5 file.

data.read_text

Read .txt, .tab, .data (text) file.

data.read_10x_atac

Read scATAC-seq data outputted by 10x Genomics software.

data.read_10x_multiome

Read Multiome (scRNA + scATAC) data outputted by 10x Genomics software.

Basic preprocessing#

For general single-cell preprocessing, we defer to our friends at Scanpy, and specifically their preprocessing module (scanpy.pp).

All scvi-tools models require raw UMI count data. The count data can be safely stored in an AnnData layer as one of the first steps of a Scanpy single-cell workflow:

adata.layers["counts"] = adata.X.copy()

Here we maintain a few package specific utilities for feature selection, etc.

data.poisson_gene_selection

Rank and select genes based on the enrichment of zero counts.

data.organize_cite_seq_10x

Organize anndata object loaded from 10x for scvi models.

data.organize_multiome_anndatas

Concatenate multiome and single-modality input anndata objects.

Utilities#

Here we maintain miscellaneous general methods.

model.utils.mde

Util to run pymde.preserve_neighbors() for visualization of scvi-tools embeddings.

Configuration#

An instance of the ScviConfig is available as scvi.settings and allows configuring scvi-tools.

_settings.ScviConfig

Config manager for scvi-tools.