-
Notifications
You must be signed in to change notification settings - Fork 0
/
02-Enrichment.Rmd
78 lines (64 loc) · 1.52 KB
/
02-Enrichment.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
```{r}
my_packages <- c("tidyverse", "data.table",
# "stringdist",
"clusterProfiler", "org.Hs.eg.db")
pacman::p_load(char = my_packages)
tmp <- list()
```
# Cluster Profile
```{r}
target_df4 <- readRDS(file = "Output/01/target_df4.Rds")
```
```{r}
marker <- bitr(target_df4$GeneNames, OrgDb = "org.Hs.eg.db",
fromType = "SYMBOL", toType = "ENTREZID")
```
```{r}
GO <- enrichGO(gene = marker$ENTREZID,
OrgDb= org.Hs.eg.db,
ont = "ALL",
pAdjustMethod = "BH",
minGSSize = 1,
pvalueCutoff = 0.05,
readable = TRUE)
GO_df <- GO@result
KEGG <- enrichKEGG(gene = marker$ENTREZID,
organism = 'hsa',
pvalueCutoff = 0.05,
qvalueCutoff =0.05)
KEGG_df <- KEGG@result
```
# Plot
GO:
```{r}
p4 <- barplot(GO, split = "ONTOLOGY") +
facet_grid(ONTOLOGY~., scale = "free")
p4
```
```{r}
ggsave(plot = p4,
filename = "Plot/p4.png",
width = 10,
height = 12,
units = "in",
dpi = 600)
```
KEGG:
```{r}
p5 <- dotplot(KEGG, showCategory = 15)
p5
```
```{r}
ggsave(plot = p5,
filename = "Plot/p5.png",
width = 8,
height = 6,
units = "in",
dpi = 600)
```
```{r}
# vec_toll <- strsplit("841/6416/3553/3569/3576/5594/1432/5595/5599/4792/6696/207/6772/5970/7124", "/")[[1]]
#
# toll_df <- marker[marker$ENTREZID %in% vec_toll,]
# toll_df
```