Skip to contents

This function applies an in-silico perturbation to selected features in a Seurat object.

Usage

ApplyPerturbation(
  seurat_obj,
  exp,
  features,
  perturb_dir,
  cells_use = NULL,
  layer = "counts",
  slot = "counts",
  assay = "RNA"
)

Arguments

seurat_obj

A Seurat object

exp

A features by cells matrix containing the observed expression matrix.

features

The selected features to apply the perturbation on.

perturb_dir

A numeric determining the type of perturbation to apply. Negative values for knock-down, positive for knock-in, and 0 for knock-out.

slot

Slot to extract data for aggregation. Default = 'counts'

assay

Assay in seurat_obj containing expression information.

Value

A dgCMatrix object containing the updated expression matrix with the applied perturbations