performNormalization: Perform Normalization on Enrichment Data

View source: R/performNormalization.R

performNormalizationR Documentation

Perform Normalization on Enrichment Data

Description

This function allows users to normalize the enrichment calculations by accounting for single-cell dropout and producing positive values for downstream differential enrichment analyses. A positive range values is useful for several downstream analyses, like differential evaluation for log2-fold change, but will alter the original enrichment values.

Usage

performNormalization(
  sc.data,
  enrichment.data = NULL,
  assay = "escape",
  gene.sets = NULL,
  make.positive = FALSE,
  scale.factor = NULL,
  groups = NULL
)

Arguments

sc.data

Single-cell object or matrix used in the gene set enrichment calculation in escape.matrix or runEscape.

enrichment.data

The enrichment results from escape.matrix or runEscape (optional)

assay

Name of the assay to normalize if using a single-cell object

gene.sets

The gene set library to use to extract the individual gene set information from

make.positive

Shift enrichment values to a positive range TRUE for downstream analysis or not TRUE (default).

scale.factor

A vector to use for normalizing enrichment scores per cell.

groups

the number of cells to calculate normalization on at once. chunks matrix into groups sized chunks. Useful in case of memory issues.

Value

Single-cell object or matrix of normalized enrichment scores

Examples

GS <- list(Bcells = c("MS4A1", "CD79B", "CD79A", "IGH1", "IGH2"),
           Tcells = c("CD3E", "CD3D", "CD3G", "CD7","CD8A"))
pbmc_small <- SeuratObject::pbmc_small
pbmc_small <- runEscape(pbmc_small, 
                        gene.sets = GS, 
                        min.size = NULL)
                        
pbmc_small <- performNormalization(pbmc_small, 
                                   assay = "escape", 
                                   gene.sets = GS)


ncborcherding/escape documentation built on Nov. 6, 2024, 1:43 p.m.