RunCellGSEA: Run Gene Set Enrichment Analysis on cells

View source: R/gsea.R

RunCellGSEAR Documentation

Run Gene Set Enrichment Analysis on cells

Description

Calculate cells gene specificty ranking and then perform geneset enrichment analysis (fgsea) on it. However, due to the very long running time of gene set enrichment analysis, we recommend the usage of RunCellHGT.

Usage

RunCellGSEA(
  X,
  pathways,
  reduction,
  dims,
  features,
  cells,
  nperm,
  minSize,
  maxSize,
  gseaParam,
  n.core
)

## S3 method for class 'Seurat'
RunCellGSEA(
  X,
  pathways,
  reduction = "mca",
  dims = seq(50),
  features = NULL,
  cells = NULL,
  nperm = 1000,
  minSize = 10,
  maxSize = 500,
  gseaParam = 0,
  n.core = 1
)

## S3 method for class 'SingleCellExperiment'
RunCellGSEA(
  X,
  pathways,
  reduction = "mca",
  dims = seq(50),
  features = NULL,
  cells = NULL,
  nperm = 1000,
  minSize = 10,
  maxSize = 500,
  gseaParam = 0,
  n.core = 1
)

Arguments

X

Seurat or SingleCellExperiment object

pathways

List of gene sets to check

reduction

Which dimensionality reduction to use, must be based on MCA.

dims

A vector of integers indicating which dimensions to use with reduction embeddings and loadings for distance calculation.

features

Character vector of feature names to subset feature coordinates. If not specified will take all features available from specified reduction Loadings.

cells

Character vector of cell names to subset cell coordinates. If not specified will take all features available from specified reduction Embeddings

nperm

Number of permutations to do. Minimial possible nominal p-value is about 1/nperm

minSize

Minimal size of a gene set to test. All pathways below the threshold are excluded.

maxSize

Maximal size of a gene set to test. All pathways above the threshold are excluded.

gseaParam

GSEA parameter value, all gene-level statis are raised to the power of 'gseaParam' before calculation of GSEA enrichment scores

n.core

A single integer to specify the number of core for parallelisation.

Value

A data.table with geneset enrichment analysis statistics.

Examples

seuratPbmc <- RunMCA(seuratPbmc, nmcs = 5)
GSEAResults <- RunCellGSEA(seuratPbmc, Hallmark, dims = 1:5)

RausellLab/CelliD documentation built on Jan. 12, 2024, 3:44 a.m.