forked from wjawaid/enrichR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
103 lines (76 loc) · 3.05 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
title: "An R interface to the Enrichr database"
author: "Wajid Jawaid"
email: "[email protected]"
date: "`r Sys.Date()`"
<!-- bibliography: ./vignettes/enrichr.bib -->
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "./tools/README-"
)
```
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/enrichR)](https://cran.r-project.org/package=enrichR)
[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![CRAN mirror downloads](https://cranlogs.r-pkg.org/badges/enrichR)](https://cran.r-project.org/package=enrichR/)
# Installation
**enrichR** can be installed from Github or from CRAN.
## Github
```{r, echo = TRUE, eval = FALSE}
library(devtools)
install_github("wjawaid/enrichR")
```
## CRAN
The package can be downloaded from CRAN using:
```{r, echo = TRUE, eval = FALSE}
install.packages("enrichR")
```
# Usage example
**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)
```{r, echo = TRUE, eval = TRUE}
library(enrichR)
listEnrichrSites()
setEnrichrSite("Enrichr") # Human genes
```
Then find the list of all available databases from Enrichr.
```{r, echo = TRUE, eval = TRUE}
dbs <- listEnrichrDbs()
```
```{r, echo = TRUE, eval = FALSE}
head(dbs)
```
```{r, echo = FALSE, results='asis'}
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.
```{r, echo = TRUE, eval = TRUE}
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.
```{r, echo = TRUE, eval = FALSE}
enriched[["GO_Biological_Process_2015"]]
```
You can give many genes.
```{r, echo = TRUE, eval = FALSE}
data(genes790)
length(genes790)
head(enrichr(genes790, c('LINCS_L1000_Chem_Pert_up'))[[1]])
```
```{r, echo = FALSE, results = 'asis'}
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)
```{r, echo = TRUE, eval = TRUE, fig.width = 8, fig.height = 6, fig.align = "center", dpi = 100}
plotEnrich(enriched[[3]], showTerms = 20, numChar = 40, y = "Count", orderBy = "P.value")
```
# References
Kuleshov, Maxim V., Matthew R. Jones, Andrew D. Rouillard, Nicolas F. Fernandez, Qiaonan Duan, Zichen Wang, Simon Koplev, et al. 2016. “Enrichr: A Comprehensive Gene Set Enrichment Analysis Web Server 2016 Update.” Nucleic Acids Res 44 (Web Server issue): W90–W97. https://doi.org/10.1093/nar/gkw377.