Package 'enrichR'

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.2
Built: 2024-12-05 07:12:55 UTC
Source: CRAN

Help Index


enrichR package

Description

The enrichR package provides an R interface to all enrichR (https://maayanlab.cloud/Enrichr/) databases.

Author(s)

Wajid Jawaid [email protected]


onLoad hook to setup package options

Description

onLoad hook to setup package options

Usage

.onAttach(libname, pkgname)

Arguments

libname

(Required). Library name

pkgname

(Required). Package name

Details

onLoad hook to setup package options and to check connection to website

Author(s)

Wajid Jawaid [email protected]


Gene enrichment using Enrichr

Description

Gene enrichment using Enrichr

Usage

enrichr(genes, databases = NULL)

Arguments

genes

(Required). Character vector of gene names or data.frame of gene names in in first column and a score between 0 and 1 in the other.

databases

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

Details

Gene enrichment using Enrichr

Value

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

Author(s)

Wajid Jawaid [email protected]

Examples

dbs <- listEnrichrDbs()
dbs <- c("GO_Molecular_Function_2018", "GO_Cellular_Component_2018",
         "GO_Biological_Process_2018")
enriched <- enrichr(c("Runx1", "Gfi1", "Gfi1b", "Spi1", "Gata1", "Kdr"), dbs)

790 gene symbols

Description

This is a character vector which consists of randomly selected 790 genes.

Format

vector

Examples

data(genes790)
length(genes790)

Helper function for GET

Description

Helper function

Usage

getEnrichr(url, ...)

Arguments

url

(Required). URL address requested

...

(Optional). Additional parameters to pass to GET

Details

Helper function for GET

Value

same as GET

Author(s)

Wajid Jawaid [email protected]

I-Hsuan Lin [email protected]


Look up available databases on Enrichr

Description

Look up available databases on Enrichr

Usage

listEnrichrDbs()

Details

Look up available databases on Enrichr

Value

A data.frame of available Enrichr databases

Author(s)

Wajid Jawaid [email protected]

Examples

dbs <- listEnrichrDbs()

List Enrichr Websites

Description

List modEnrichr Websites

Usage

listEnrichrSites(...)

Arguments

...

(Optional Additional parameters)

Details

List Enrichr Websites

Value

print Enrichr Website status

Author(s)

Alexander Blume


plotEnrich

Description

Visualise a Enrichr output as barplot

Usage

plotEnrich(
  df,
  showTerms = 20,
  numChar = 40,
  y = "Count",
  orderBy = "P.value",
  xlab = NULL,
  ylab = NULL,
  title = NULL
)

Arguments

df

(Required). A single data.frame from a list of Enrichr output.

showTerms

(Optional). Number of terms to show. Default is 20.

numChar

(Optional). A single integer. Default is 40. Indicates the number characters to keep in the term description.

y

(Optional). A character string. Default is "Count". Indicates the variable that should be mapped to the y-axis. It can be either "Count" or "Ratio".

orderBy

(Optional). A character string. Default is "P.value". Indicates how to order the Enrichr results before subsetting to keep top N terms. It can be either "P.value" or "Combined.Score".

xlab

(Optional). A character string. Default is NULL. Indicates the x-axis label.

ylab

(Optional). A character string. Default is NULL. Indicates the y-axis label.

title

(Optional). A character string. Default is NULL Indicates the main title for the graphic.

Details

Visualise Enrichr result from a selected gene-set library as barplot.

Value

A ggplot2 plot object

Author(s)

I-Hsuan Lin [email protected]

See Also

ggplot

Examples

if (getOption("enrichR.live")) {
  dbs <- listEnrichrDbs()
  enrichRLive <- TRUE
  if (is.null(dbs)) enrichRLive <- FALSE
  dbs <- c("GO_Molecular_Function_2018", "GO_Cellular_Component_2018",
           "GO_Biological_Process_2018")
  enriched <- enrichr(c("Runx1", "Gfi1", "Gfi1b", "Spi1", "Gata1", "Kdr"), dbs)
  # Plot top 20 terms from "GO_Biological_Process_2018" and ordered by P-value
  if (enrichRLive) {
    plotEnrich(enriched[[3]], showTerms = 20, numChar = 50, y = "Count",
               orderBy = "P.value")
  }
}

printEnrich

Description

Print Enrichr results

Usage

printEnrich(
  data,
  prefix = "enrichr",
  showTerms = NULL,
  columns = c(1:9),
  write2file = TRUE,
  outFile = c("txt", "excel")
)

Arguments

data

(Required). Output list object from the "enrichr" function.

prefix

(Optional). Prefix of output file. Default is "enrichr".

showTerms

(Optional). Number of terms to show. Default is NULL to print all terms.

columns

(Optional). Columns from each entry of data. Default is c(1:9) to print all columns. 1-"Term", 2-"Overlap", 3-"P.value", 4-"Adjusted.P.value" 5-"Old.P.value", 6-"Old.Adjusted.P.value" 7-"Odds.Ratio" 8-"Combined.Score" 9-"Combined.Score"

write2file

(Optional). Set to TRUE if you would like this functino to output a file

outFile

(Optional). Output file format, choose from "txt" and "excel". Default is "txt".

Details

Print Enrichr results from the selected gene-set libraries to individual text files.

Author(s)

Wajid Jawaid [email protected]

I-Hsuan Lin [email protected]

Examples

if (getOption("enrichR.live")) {
  enrichRLive <- TRUE
  dbs <- listEnrichrDbs()
  if(is.null(dbs)) enrichRLive <- FALSE
  dbs <- c("GO_Molecular_Function_2018", "GO_Cellular_Component_2018",
           "GO_Biological_Process_2018")
  enriched <- enrichr(c("Runx1", "Gfi1", "Gfi1b", "Spi1", "Gata1", "Kdr"), dbs)
  if (enrichRLive) printEnrich(enriched, write2file = FALSE)
}

Set Enrichr Website

Description

Set Enrichr Website

Usage

setEnrichrSite(site)

Arguments

site

site requested

Details

Set Enrichr Website

Value

Changes Enrichr Website connection

Author(s)

Alexander Blume