-
Notifications
You must be signed in to change notification settings - Fork 1
/
05.functional_analysis.Rmd
95 lines (75 loc) · 2.94 KB
/
05.functional_analysis.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
# Functional analysis
```{r}
# Load library
library(org.Hs.eg.db)
library(clusterProfiler)
# first run a DE analysis
## Create background dataset for hypergeometric testing using all genes tested for significance in the results
bg_genes <- resTreatment_tb$gene
## Run GO enrichment analysis
compGO <- enrichGO(gene = sigTreatment_up,
universe = bg_genes,
keyType = "ENSEMBL",
OrgDb = "org.Hs.eg.db",
ont = "BP",
qvalueCutoff = 0.05,
pAdjustMethod = "BH")
#dotplot(compGO,
# showCategory = 20,
# title = "GO (Biological Process) Enrichment Analysis for UP in Treatment (POST)")
# image pdf 12 x 12
## Output results from GO analysis to a table
summary <- data.frame(compGO@result)
write_csv(summary, "tables/T8.go.treatment_up.csv")
```
```{r}
## Run GO enrichment analysis
compGO <- enrichGO(gene = sigTreatment_down,
universe = bg_genes,
keyType = "ENSEMBL",
OrgDb = org.Hs.eg.db,
ont = "BP",
qvalueCutoff = 0.05,
pAdjustMethod = "BH")
#dotplot(compGO, showCategory = 25, title = "GO (Biological Process) Enrichment Analysis for DOWN in Treatment")
# image pdf 12 x 12
## Output results from GO analysis to a table
summary <- data.frame(compGO@result)
write_csv(summary, "tables/T9.go.treatment_down.csv")
```
```{r}
bg_genes <- resResponse_tb$gene
## Run GO enrichment analysis
compGO <- enrichGO(gene = sigResponse_up,
universe = bg_genes,
keyType = "ENSEMBL",
OrgDb = "org.Hs.eg.db",
ont = "BP",
qvalueCutoff = 0.05,
pAdjustMethod = "BH")
#dotplot(compGO,
# showCategory = 20,
# title = "GO (Biological Process) Enrichment Analysis for UP in Treatment (POST)")
# image pdf 12 x 12
## Output results from GO analysis to a table
summary <- data.frame(compGO@result)
write_csv(summary, "tables/T20.go.response_up.csv")
```
```{r}
bg_genes <- resResponse_tb$gene
## Run GO enrichment analysis
compGO <- enrichGO(gene = sigResponse_down,
universe = bg_genes,
keyType = "ENSEMBL",
OrgDb = "org.Hs.eg.db",
ont = "BP",
qvalueCutoff = 0.05,
pAdjustMethod = "BH")
#dotplot(compGO,
# showCategory = 20,
# title = "GO (Biological Process) Enrichment Analysis for UP in Treatment (POST)")
# image pdf 12 x 12
## Output results from GO analysis to a table
summary <- data.frame(compGO@result)
write_csv(summary, "tables/T11.go.response_down.csv")
```