-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.Rmd
111 lines (83 loc) · 2.3 KB
/
index.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
104
105
106
107
108
109
110
---
title: "GO and KEGG analysis for MAPP paper"
author: "Ian U. Kouzel"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
output: bookdown::gitbook
documentclass: book
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
github-repo: rstudio/bookdown-demo
description: "GO and KEGG analysis for MAPP paper"
---
# Prerequisites
## Libraries
```{r, message = FALSE, warning = FALSE}
library(tidyverse)
library(clusterProfiler)
library(pathview)
library(enrichplot)
library(org.Hs.eg.db)
library(readr)
library(DT)
library(matrixTests)
```
## Options
```{r}
# These options are used for GO analysis in the downstream scripts /
# R markdown pages:
# minimal size of genes annotated by ontology term for testing
minGSSize <- 10
# human DB
organismDB <- "org.Hs.eg.db"
# p-value cutoff
pvalueCutoff <- 0.1
# number of GOs to plot
showCategory <- 10
# p-adjusted cut off for cassette exons that are different between
# control and cancer conditions
genes_padj_cutoff <- 0.1
```
## Universe set of genes
**all genes having quantified cassette exons**
### GO (ENSEMBL)
```{r}
# read table with cassette exons and select the genes
universe <- read.table("data/cassette_exons_universe_table.tsv",
header = T) %>% dplyr::select(gene_id) %>% unlist()
# select unique IDs
universe <- unique(unlist(strsplit(universe, ",")))
# preview first 10 entrees
head(universe, 10)
# length of a vector with ENSEMBL IDs
length(universe)
```
### KEGG (ENTREZ)
```{r, warning = FALSE}
# convert ENSEMBL IDs into ENTREZ format (required for KEGG analysis)
ENTREZ_universe <- bitr(universe, fromType = "ENSEMBL",
toType = "ENTREZID", OrgDb= organismDB) %>%
dplyr::select(ENTREZID) %>% unlist()
# select unique IDs
ENTREZ_universe <- unique(unlist(strsplit(ENTREZ_universe, ",")))
# preview first 10 entrees
head(ENTREZ_universe)
# length of a vector with ENSEMBL IDs
length(ENTREZ_universe)
```
## Render the book
```{r, eval = F}
# the full book is rendered with this command
bookdown::render_book("index.Rmd", "bookdown::gitbook")
```
```{r include=FALSE}
# automatically create a bib database for R packages
knitr::write_bib(c(
.packages(), 'bookdown', 'knitr', 'rmarkdown'
), 'packages.bib')
```
## Session info
```{r}
sessionInfo()
```