knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "./tools/README-" )
enrichR can be installed from Github or from CRAN.
library(devtools) install_github("wjawaid/enrichR")
The package can be downloaded from CRAN using:
install.packages("enrichR")
enrichR provides an interface to the Enrichr database [@kuleshov_enrichr:_2016] hosted at https://maayanlab.cloud/Enrichr/.
By default human genes are selected otherwise select your organism of choice. (This functionality was contributed by Alexander Blume)
library(enrichR) listEnrichrSites() setEnrichrSite("Enrichr") # Human genes
Then find the list of all available databases from Enrichr.
dbs <- listEnrichrDbs()
head(dbs)
library(knitr) kable(head(dbs[c(1:6),-4]))
View and select your favourite databases. Then query enrichr, in this case I have used genes associated with embryonic haematopoiesis.
dbs <- c("GO_Molecular_Function_2015", "GO_Cellular_Component_2015", "GO_Biological_Process_2015") enriched <- enrichr(c("Runx1", "Gfi1", "Gfi1b", "Spi1", "Gata1", "Kdr"), dbs)
Now view the results table.
enriched[["GO_Biological_Process_2015"]]
You can give many genes.
data(genes790) length(genes790) head(enrichr(genes790, c('LINCS_L1000_Chem_Pert_up'))[[1]])
x <- head(enriched[["GO_Biological_Process_2015"]]) x[,1] <- gsub("GO:", "GO_", x[,1]) kable(x)
Plot Enrichr GO-BP output. (Plotting function contributed by I-Hsuan Lin)
plotEnrich(enriched[[3]], showTerms = 20, numChar = 40, y = "Count", orderBy = "P.value")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.