scVIIntegration: scVI Integration

View source: R/scVI.R

scVIIntegrationR Documentation

scVI Integration

Description

scVI Integration

Usage

scVIIntegration(
  object,
  features = NULL,
  layers = "counts",
  conda_env = NULL,
  new.reduction = "integrated.dr",
  ndims = 30,
  nlayers = 2,
  gene_likelihood = "nb",
  max_epochs = NULL,
  ...
)

Arguments

object

A StdAssay or STDAssay instance containing merged data

features

Features to integrate

layers

Layers to integrate

conda_env

conda environment to run scVI

new.reduction

Name under which to store resulting DimReduc object

ndims

Dimensionality of the latent space

nlayers

Number of hidden layers used for encoder and decoder NNs

gene_likelihood

Distribution to use for modelling expression data: "zinb", "nb", "poisson"

max_epochs

Number of passes through the dataset taken while training the model

...

Unused - currently just capturing parameters passed in from Seurat::IntegrateLayers intended for other integration methods

Value

A single-element named list DimReduc elements containing the integrated data

Note

This function requires the scvi-tools package to be installed

See Also

scVI

Examples

## Not run: 
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers, specifying a conda environment
obj <- IntegrateLayers(
  object = obj,
  method = scVIIntegration,
  new.reduction = "integrated.scvi",
  conda_env = "../miniconda3/envs/scvi-env",
  verbose = FALSE
)

# Alternatively, we can integrate SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(
  object = obj, method = scVIIntegration,
  orig.reduction = "pca", new.reduction = "integrated.scvi",
  assay = "SCT", conda_env = "../miniconda3/envs/scvi-env", verbose = FALSE
)

## End(Not run)


satijalab/seurat-wrappers documentation built on April 10, 2024, 3:25 p.m.