Title: | Provides an R Interface to 'Enrichr' |
---|---|
Description: | Provides an R interface to all 'Enrichr' databases. 'Enrichr' is a web-based tool for analysing gene sets and returns any enrichment of common annotated biological features. Quoting from their website 'Enrichment analysis is a computational method for inferring knowledge about an input gene set by comparing it to annotated gene sets representing prior biological knowledge.' See <https://maayanlab.cloud/Enrichr/> for further details. |
Authors: | Wajid Jawaid [aut, cre] |
Maintainer: | Wajid Jawaid <[email protected]> |
License: | GPL (>=2) |
Version: | 3.4 |
Built: | 2025-02-02 22:21:05 UTC |
Source: | https://github.com/wjawaid/enrichR |
Upload background list using Speedrichr API
.add_background(genes)
.add_background(genes)
genes |
gene list |
Upload background list using Speedrichr API
R object from JSON
I-Hsuan Lin [email protected]
Upload gene list using Speedrichr API
.add_list(genes)
.add_list(genes)
genes |
Input genes |
Upload gene list using Speedrichr API
R object that corresponds to the JSON object
I-Hsuan Lin [email protected]
Given a Enrichr output, order and subset criteria, returns a data frame accordingly
.enrichment_prep_df(df, showTerms = 20, orderBy = "P.value")
.enrichment_prep_df(df, showTerms = 20, orderBy = "P.value")
df |
Enrichr output |
showTerms |
Number of terms to show. Default 20. |
orderBy |
Column for ordering. Default "P.value" |
Given a Enrichr output, order and subset criteria, returns a data frame accordingly
Data frame
I-Hsuan Lin [email protected]
Given an input, check format and return a character vector
.formatGenes(x, type = c("standard", "background"))
.formatGenes(x, type = c("standard", "background"))
x |
Vector or dataframe of genes with or without score |
type |
Depends on type of gene input |
In standard analysis without background, crisp (symbols only) and fuzzy (with scores) gene sets are acceptable In analysis with background, only crisp gene sets are acceptable
Character vector
I-Hsuan Lin [email protected]
Get enrichment result using Speedrichr API
.get_backgroundenrich(uId, bId, db)
.get_backgroundenrich(uId, bId, db)
uId |
user List ID |
bId |
background ID |
db |
background Type |
Get enrichment result using Speedrichr API
R object from JSON
I-Hsuan Lin [email protected]
onLoad hook to setup package options
.onAttach(libname, pkgname)
.onAttach(libname, pkgname)
libname |
(Required). Library name |
pkgname |
(Required). Package name |
onLoad hook to setup package options and to check connection to website
Wajid Jawaid [email protected]
Internal function to check RCurlOptions
.proxyOpts()
.proxyOpts()
Internal function to check RCurlOptions
Named vector
I-Hsuan Lin [email protected]
Download and parse GMT files from Enrichr
.read_gmt(db)
.read_gmt(db)
db |
library |
Download and parse GMT files from Enrichr
List object
I-Hsuan Lin [email protected]
This is a character vector which consists of 20,625 gene symbols taken from the Enrichr website.
data(background)
data(background)
vector
data(background) length(background)
data(background) length(background)
Gene enrichment using Enrichr
enrichr( genes, databases = NULL, background = NULL, include_overlap = FALSE, sleepTime = 1 )
enrichr( genes, databases = NULL, background = NULL, include_overlap = FALSE, sleepTime = 1 )
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 |
include_overlap |
(Optional). Download database in GMT format to include 'Overlap'
in the resulting data.frame when analysing with a background. Default is |
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. |
Gene enrichment using Enrichr, also, you can now try adding a background.
Returns a list of data.frame of enrichment terms, p-values, ...
Wajid Jawaid [email protected]
# 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]])) # }
# 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]])) # }
This is a character vector which consists of randomly selected 790 genes.
data(genes790)
data(genes790)
vector
data(genes790) length(genes790)
data(genes790) length(genes790)
Helper function
getEnrichr(method = "GET", url, ...)
getEnrichr(method = "GET", url, ...)
method |
(Required). HTTP method. Default is |
url |
(Required). URL address requested |
... |
(Optional). Additional parameters to pass to GET |
Helper function for HTTP methods GET and POST
same as GET
Wajid Jawaid [email protected]
I-Hsuan Lin [email protected]
This is a character vector which consists of 375 gene symbols taken from the Enrichr website.
data(input)
data(input)
vector
data(input) length(input)
data(input) length(input)
Look up available databases on Enrichr
listEnrichrDbs()
listEnrichrDbs()
Look up available databases on Enrichr
A data.frame of available Enrichr databases
Wajid Jawaid [email protected]
dbs <- listEnrichrDbs()
dbs <- listEnrichrDbs()
List modEnrichr Websites
listEnrichrSites()
listEnrichrSites()
List Enrichr Websites
print Enrichr Website status
Alexander Blume
Visualise a Enrichr output as barplot
plotEnrich( df, showTerms = 20, numChar = 40, y = "Count", orderBy = "P.value", xlab = NULL, ylab = NULL, title = NULL )
plotEnrich( df, showTerms = 20, numChar = 40, y = "Count", orderBy = "P.value", xlab = NULL, ylab = NULL, title = NULL )
df |
(Required). A single data.frame from a list of Enrichr output. |
showTerms |
(Optional). Number of terms to show. Default is |
numChar |
(Optional). A single integer. Default is |
y |
(Optional). A character string. Default is |
orderBy |
(Optional). A character string. Default is
|
xlab |
(Optional). A character string. Default is |
ylab |
(Optional). A character string. Default is |
title |
(Optional). A character string. Default is |
Visualise Enrichr result from a selected gene-set library as barplot.
A ggplot
plot object
I-Hsuan Lin [email protected]
# data(input) # Load example input genes # dbs <- c("GO_Molecular_Function_2023", "GO_Cellular_Component_2023", # "GO_Biological_Process_2023") # if (getOption("enrichR.live")) { # enriched <- enrichr(input, dbs) # print(head(enriched[[1]])) # # Plot top 20 terms from "GO_Biological_Process_2023" and ordered by P-value # plotEnrich(enriched[[3]], showTerms = 20, numChar = 50, y = "Count", # orderBy = "P.value") # }
# data(input) # Load example input genes # dbs <- c("GO_Molecular_Function_2023", "GO_Cellular_Component_2023", # "GO_Biological_Process_2023") # if (getOption("enrichR.live")) { # enriched <- enrichr(input, dbs) # print(head(enriched[[1]])) # # Plot top 20 terms from "GO_Biological_Process_2023" and ordered by P-value # plotEnrich(enriched[[3]], showTerms = 20, numChar = 50, y = "Count", # orderBy = "P.value") # }
Print Enrichr results
printEnrich( data, prefix = "enrichr", showTerms = NULL, columns = c(1:9), outFile = c("txt", "excel") )
printEnrich( data, prefix = "enrichr", showTerms = NULL, columns = c(1:9), outFile = c("txt", "excel") )
data |
(Required). Output list object from the |
prefix |
(Optional). Prefix of output file. Default is |
showTerms |
(Optional). Number of terms to show.
Default is |
columns |
(Optional). Columns from each entry of data.
Default is |
outFile |
(Optional). Output file format, choose from "txt" and "excel". Default is "txt". |
Print Enrichr results from the selected gene-set libraries to individual text files or a Excel spreadsheet.
Wajid Jawaid [email protected]
I-Hsuan Lin [email protected]
# data(input) # Load example input genes # if (getOption("enrichR.live")) { # enrichRLive <- TRUE # dbs <- listEnrichrDbs() # if(is.null(dbs)) enrichRLive <- FALSE # dbs <- c("GO_Molecular_Function_2023", "GO_Cellular_Component_2023", # "GO_Biological_Process_2023") # enriched <- enrichr(input, dbs) # print(head(enriched[[1]])) # # if (enrichRLive) printEnrich(enriched, outFile = "excel") # }
# data(input) # Load example input genes # if (getOption("enrichR.live")) { # enrichRLive <- TRUE # dbs <- listEnrichrDbs() # if(is.null(dbs)) enrichRLive <- FALSE # dbs <- c("GO_Molecular_Function_2023", "GO_Cellular_Component_2023", # "GO_Biological_Process_2023") # enriched <- enrichr(input, dbs) # print(head(enriched[[1]])) # # if (enrichRLive) printEnrich(enriched, outFile = "excel") # }
Set Enrichr Website
setEnrichrSite(site)
setEnrichrSite(site)
site |
site requested |
Set Enrichr Website
Changes Enrichr Website connection
Alexander Blume