runEnrichR: Perform enrichR analysis on results from findMarkers, edgeR...

View source: R/func_markers.R

runEnrichRR Documentation

Perform enrichR analysis on results from findMarkers, edgeR or DESeq2

Description

This function takes a list of objects containing findMarkers(), edgeR or DESeq2 results, and perform enrichment analysis on the genes that passed the specified threshold.

Usage

runEnrichR(
  object,
  dbs,
  site = "Enrichr",
  direction = "both",
  fdr = 0.05,
  top = 200,
  logfc = c(0, 0),
  auc = c(0.7, 0.3),
  max = 1000,
  min = 20,
  column_by = NULL
)

Arguments

object

A named list of objects storing outputs returned by findMarkers(), edgeR or DESeq2, each of which contains results for the corresponding group of comparison.

dbs

A character vector containing the name of one or more gene-set libraries used in the enrichment analysis.

site

A string indicating the Enrichr Website to use. Available sites are: "Enrichr", "FlyEnrichr", "WormEnrichr", "WormEnrichr" and "FishEnrichr". Default is "Enrichr".

direction

A string indicating the directionality of expression changes of markers/DEGs to retreive. Allowable character values are "both", "up" and "down". Default is "both".

fdr

A numeric scalar indicating the FDR threashold used to select markers/DEGs. This threshold has no effect when the input source is from findMarkers() ran with pval.type = "any". Default is 0.05.

top

An integer scalar indicating the 'Top' threashold used to select markers. This threshold is only applicable when the input source is from findMarkers() ran with pval.type = "any". Default is 200.

logfc

A numeric vector of length 2 specifying the logFC threasholds used to select up-/down-regulated markers/DEGs. This threshold has no effect when the input source is from findMarkers() ran with test.type = "wilcox". Default is c(0, 0).

auc

A numeric vector of length 2 specifying the AUC threasholds used to select up-/down-regulated markers. This threshold is only applicable when the input source is from findMarkers() ran with test.type = "wilcox". Default is c(0.3, 0.7).

max

An integer scalar indicating the maximum number of markers/DEGs to use in the analysis. Default is 1000.

min

An integer scalar indicating the minimum number of markers/DEGs required to perform the analysis. Default is 20.

column_by

A string indicating the column name containing the gene symbols or IDs in the input object's DataFrames and the selected information is returned. When column_by = NULL, it retreives the row names from the DataFrame. Default is NULL.

Details

This function uses enrichr() from the enrichR package to submit gene symbols for enrichment analysis to the Enrichr website (https://maayanlab.cloud/Enrichr). By default (with column_by = NULL), this function extracts rownames from the input DataFrames and submits the acquired strings for the analysis.

The gene symbols are submitted to the main site (site = "Enrichr") with gene sets compiled from human and mouse genes. By change the site setting, it can use other modEnrichr sites (https://maayanlab.cloud/modEnrichr/) suitable for other model organisms.

Value

A named list of list of DataFrames

Author(s)

I-Hsuan Lin

See Also

enrichR::enrichr(), scran::findMarkers(), edgeR::topTags(), DESeq2::results()

Examples

## Not run: 
# Load demo dataset
data(res_deseq2)

# We construct a list of 3 DataFrames using the same DESeq2 output (`res_deseq2`)
# to mimic having a list containing results from multiple sets of comparisons.
res.de <- list(A_B = res_deseq2, A_C = res_deseq2, B_C = res_deseq2)

# Select gene-set libraries
dbs <- c("GO_Molecular_Function_2018", "GO_Biological_Process_2018")

# Run enrichR using the D. melanogaster specific modEnrichr site, and
# specify the gene symbols are stored in the 'external_gene_name' column
res.ora <- runEnrichR(res.de,
  dbs = dbs, site = "FlyEnrichr",
  column_by = "external_gene_name"
)

## End(Not run)

ycl6/scRUtils documentation built on Feb. 18, 2025, 6:14 a.m.