enrichr: Gene enrichment using Enrichr

View source: R/functions.R

enrichrR Documentation

Gene enrichment using Enrichr

Description

Gene enrichment using Enrichr

Usage

enrichr(
  genes,
  databases = NULL,
  background = NULL,
  include_overlap = FALSE,
  sleepTime = 1
)

Arguments

genes

(Required). Character vector of Entrez gene symbols as input. A data.frame of gene symbols in first column is also acceptable, optionally a score denoting the degree of membership between 0 and 1 in the second column.

databases

(Required). Character vector of databases to search. See https://maayanlab.cloud/Enrichr/ for available databases.

background

(Optional). Character vector of Entrez gene symbols to be used as background. A data.frame of gene symbols in first column is also acceptable. Default is "NULL". Enrichment analysis with background genes is only available on the main site (Enrichr). Also, it is using a different API service (Speedrichr), hence it is a little slower to complete and return the results.

include_overlap

(Optional). Download database in GMT format to include 'Overlap' in the resulting data.frame when analysing with a background. Default is "FALSE".

sleepTime

(Optional) Time to wait (in seconds) between sending requests to the server to prevent the same results being returned as the previous request. Default is 1.

Details

Gene enrichment using Enrichr, also, you can now try adding a background.

Value

Returns a list of data.frame of enrichment terms, p-values, ...

Author(s)

Wajid Jawaid wajid.jawaid@gmail.com

Examples

# data(input) # Load example input genes
# data(background) # Load example background genes
# dbs <- c("GO_Molecular_Function_2023", "GO_Cellular_Component_2023",
#          "GO_Biological_Process_2023")
# if (getOption("enrichR.live")) {
#   enriched1 <- enrichr(input, dbs)
#   print(head(enriched1[[1]]))

#   # Include background
#   enriched2 <- enrichr(input, dbs, background = background)
#   print(head(enriched2[[1]]))

#   # Include background and add 'Overlap' info
#   enriched3 <- enrichr(input, dbs, background = background, include_overlap = TRUE)
#   print(head(enriched3[[1]]))
# }

enrichR documentation built on April 4, 2025, 1:07 a.m.