User

Import scvi-tools as:

import scvi

Model

model.AUTOZI

Automatic identification of ZI genes [Clivio19].

model.CondSCVI

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

model.DestVI

Multi-resolution deconvolution of Spatial Transcriptomics data (DestVI) [Lopez21].

model.LinearSCVI

Linearly-decoded VAE [Svensson20].

model.PEAKVI

Peak Variational Inference [Ashuach21]

model.SCANVI

Single-cell annotation using variational inference [Xu21].

model.SCVI

single-cell Variational Inference [Lopez18].

model.TOTALVI

total Variational Inference [GayosoSteier21].

External models

external.CellAssign

Reimplementation of CellAssign for reference-based annotation [Zhang19].

external.GIMVI

Joint VAE for imputing missing genes in spatial data [Lopez19].

external.RNAStereoscope

Reimplementation of Stereoscope [Andersson20] for deconvolution of spatial transcriptomics from single-cell transcriptomics.

external.SpatialStereoscope

Reimplementation of Stereoscope [Andersson20] for deconvolution of spatial transcriptomics from single-cell transcriptomics.

external.SOLO

Doublet detection in scRNA-seq [Bernstein19].

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 preparation

Setting up an AnnData object is a prerequisite for running any scvi-tools model.

data.setup_anndata

Sets up AnnData object for models.

data.transfer_anndata_setup

Transfer anndata setup from a source object to a target object.

data.register_tensor_from_anndata

Add another tensor to scvi data registry.

data.view_anndata_setup

Prints setup anndata.

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.

Configuration

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

_settings.ScviConfig

Config manager for scvi-tools.