Developer

Import scvi-tools as:

import scvi

Data Loaders

DataLoaders for loading tensors from AnnData objects. DataSplitters for splitting data into train/test/val.

dataloaders.AnnDataLoader

DataLoader for loading tensors from AnnData objects.

dataloaders.AnnTorchDataset

Extension of torch dataset to get tensors from anndata.

dataloaders.ConcatDataLoader

DataLoader that supports a list of list of indices to load.

dataloaders.DataSplitter

Creates data loaders train_set, validation_set, test_set.

dataloaders.SemiSupervisedDataLoader

DataLoader that supports semisupervised training.

dataloaders.SemiSupervisedDataSplitter

Creates data loaders train_set, validation_set, test_set.

Distributions

Parameterizable probability distributions.

distributions.NegativeBinomial

Negative binomial distribution.

distributions.NegativeBinomialMixture

Negative binomial mixture distribution.

distributions.ZeroInflatedNegativeBinomial

Zero-inflated negative binomial distribution.

Model (Base)

These classes should be used to construct user-facing model classes.

model.base.BaseModelClass

Abstract class for scvi-tools models.

model.base.VAEMixin

Univseral VAE methods.

model.base.RNASeqMixin

General purpose methods for RNA-seq analysis.

model.base.ArchesMixin

Universal scArches implementation.

model.base.UnsupervisedTrainingMixin

General purpose unsupervised train method.

model.base.PyroSviTrainMixin

Mixin class for training Pyro models.

model.base.PyroSampleMixin

Mixin class for generating samples from posterior distribution.

model.base.PyroJitGuideWarmup

A callback to warmup a Pyro guide.

Module

Existing module classes with respective generative and inference procedures.

module.AutoZIVAE

Implementation of the AutoZI model [Clivio19].

module.Classifier

Basic fully-connected NN classifier.

module.LDVAE

Linear-decoded Variational auto-encoder model.

module.MRDeconv

Model for multi-resolution deconvolution of spatial transriptomics.

module.PEAKVAE

Variational auto-encoder model for ATAC-seq data.

module.MULTIVAE

Variational auto-encoder model for joint paired + unpaired RNA-seq and ATAC-seq data.

module.SCANVAE

Single-cell annotation using variational inference.

module.TOTALVAE

Total variational inference for CITE-seq data.

module.VAE

Variational auto-encoder model.

module.VAEC

Conditional Variational auto-encoder model.

External module

Module classes in the external API with respective generative and inference procedures.

external.gimvi.JVAE

Joint variational auto-encoder for imputing missing genes in spatial data.

external.cellassign.CellAssignModule

Model for CellAssign.

external.stereoscope.RNADeconv

Model of single-cell RNA-sequencing data for deconvolution of spatial transriptomics.

external.stereoscope.SpatialDeconv

Model of single-cell RNA-sequencing data for deconvolution of spatial transriptomics.

Module (Base)

These classes should be used to construct module classes that define generative models and inference schemes.

module.base.BaseModuleClass

Abstract class for scvi-tools modules.

module.base.PyroBaseModuleClass

Base module class for Pyro models.

module.base.LossRecorder

Loss signature for models.

module.base.auto_move_data

Decorator for Module methods to move data to correct device.

Neural networks

Basic neural network building blocks.

nn.FCLayers

A helper class to build fully-connected layers for a neural network.

nn.Encoder

Encodes data of n_input dimensions into a latent space of n_output dimensions.

nn.Decoder

Decodes data from latent space to data space.

nn.one_hot

One hot a tensor of categories.

Train

TrainingPlans define train/test/val optimization steps for modules.

train.AdversarialTrainingPlan

Train vaes with adversarial loss option to encourage latent space mixing.

train.PyroTrainingPlan

Lightning module task to train Pyro scvi-tools modules.

train.SemiSupervisedTrainingPlan

Lightning module task for SemiSupervised Training.

train.Trainer

Lightweight wrapper of Pytorch Lightning Trainer.

train.TrainingPlan

Lightning module task to train scvi-tools modules.

train.TrainRunner

TrainRunner calls Trainer.fit() and handles pre and post training procedures.

Utilities

Utility functions used by scvi-tools.

utils.DifferentialComputation

Unified class for differential computation.

utils.track

Progress bar with ‘rich’ and ‘tqdm’ styles.