Impute: MAGIC imputation

View source: R/Impute.R

ImputeR Documentation

MAGIC imputation

Description

This function is a wrapper of the MAGIC imputation function to easily impute Seurat objects containing scRNA-seq data, with reasonable default parameters when used in the context of signature scoring for cell classification: only imputing the most variable genes and additional features of interest, and using only 40 PCs for efficiency, and using a narrow neighborhood to avoid over-smoothing.

Usage

Impute(
  object,
  features = NULL,
  append.variable.features = TRUE,
  npca = 40,
  knn = 3,
  t = 2,
  n.jobs = 6,
  assay.use = "RNA",
  layer.use = "data",
  name = paste0("imputed.", assay.use)
)

Arguments

object

Seurat object. Must contain an RNA assay with a data layer (or a custom layer specified in argument layer.use) that will be used for imputation.

features

A subset of features/genes on which to run the imputation. Can be a list of signatures in which the features in the list will be added, or can be "all" (Default: NULL/none, i.e. only impute all variable features if append.variable.features is TRUE, as set by default).

append.variable.features

Whether to append the variable features of the active assay in the Seurat object to the list of features to impute (Default: TRUE)

npca

Number of principal components to use for imputation (Default: 40).

knn

Number of nearest neighbors on which to compute bandiwth imputation (Default: 3).

t

Diffusion parameter passed to MAGIC (Default:2).

n.jobs

Number of threads on which to run the imputation (Default: 6).

assay.use

Name of the assay to impute (Default: "RNA").

layer.use

Name of the layer to impute (Default: "data").

name

Name of the assay in which the imputed data is stored (Default: paste0("imputed.",assay.use)).

Value

Seurat object with an additional layer containing MAGIC imputed data.

Examples

MySeuratObject <- Impute(MySeuratObject)
MySeuratObject[["imputed.RNA"]]
SL <- list(CD8TC=c("CD3","CD8","-CD4"), 
           Fibro=c("VIM","COL1A1","-EPCAM"))
MySeuratObject <- Impute(MySeuratObject, features=SL, append.variable.features=TRUE, knn=4, t=3, npca=30, n.jobs=36, assay.use="RNA", layer.use="scale.data", name="custom.imputation")
MySeuratObject[["imputed.RNA"]]

nbroguiere/burgertools documentation built on Jan. 30, 2024, 3:48 a.m.