run_gsea: Run GSEA to compare a gene list(s) to per cell or per cluster...

View source: R/run_fgsea.R

run_gseaR Documentation

Run GSEA to compare a gene list(s) to per cell or per cluster expression data

Description

Use fgsea algorithm to compute normalized enrichment scores and pvalues for gene set ovelap

Usage

run_gsea(
  expr_mat,
  query_genes,
  cluster_ids = NULL,
  n_perm = 1000,
  per_cell = FALSE,
  scale = FALSE,
  no_warnings = TRUE
)

Arguments

expr_mat

single-cell expression matrix or Seurat object

query_genes

A vector or named list of vectors of genesets of interest to compare via GSEA. If supplying a named list, then the gene set names will appear in the output.

cluster_ids

vector of cell cluster assignments, supplied as a vector with order that matches columns in expr_mat. Not required if running per cell.

n_perm

Number of permutation for fgsea function. Defaults to 1000.

per_cell

if true run per cell, otherwise per cluster.

scale

convert expr_mat into zscores prior to running GSEA?, default = FALSE

no_warnings

suppress warnings from gsea ties

Value

dataframe of gsea scores (pval, NES), with clusters as rownames


rnabioco/clustifyR documentation built on Aug. 30, 2024, 8:16 a.m.