-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDotplot Final
261 lines (227 loc) · 10.7 KB
/
Dotplot Final
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
install.packages("stringr")
install.packages("ggplot2")
install.packages("dplyr")
install.packages("ggpubr")
library(stringr)
library(ggplot2)
library(dplyr)
library(ggpubr)
################################################################## BP_infec ################################################################
## Separando coluna nas dataframes
infection.total.final <- data.frame(BP_infection.total$Term, BP_infection.total$PValue, BP_infection.total$Count, BP_infection.total$Fold.Enrichment)
colnames(infection.total.final) <- c("Term", "p_value", "Count", "Fold Enrichment")
as.data.frame(infection.total.final) -> infection.total.final
infection.total.final %>%
filter(p_value <= 0.05) -> BP_infec
View(BP_infec)
## Ajustando nome dos termos
term <- BP_infec$Term
str_remove_all(term, "~") -> term
str_remove_all(term, ":") -> term
str_remove_all(term, "[0123456789]") -> term
str_remove(term, "GO") -> term
str_to_title(term) -> term
view(term)
BP_infec <- data.frame(term, BP_infec$p_value, BP_infec$Count, BP_infec$`Fold Enrichment`)
colnames(BP_infec) <- c("Term", "p_value", "Count", "Fold.Enrichment")
View(BP_infec)
## Retirano colunas solicitaas
BP_infec%>%
slice(13,1,8,16,2,7,3,17,11,12,6) -> BP_infec
################################################################## BP_mock ################################################################
## Separando coluna nas dataframes
infection.total.final <- data.frame(BP_mock.total$Term, BP_mock.total$PValue, BP_mock.total$Count, BP_mock.total$Fold.Enrichment)
colnames(infection.total.final) <- c("Term", "p_value", "Count", "Fold Enrichment")
as.data.frame(infection.total.final) -> infection.total.final
infection.total.final %>%
filter(p_value <= 0.05) -> BP_mock
View(BP_mock)
## Ajustando nome dos termos
term <- BP_mock$Term
str_remove_all(term, "~") -> term
str_remove_all(term, ":") -> term
str_remove_all(term, "[0123456789]") -> term
str_remove(term, "GO") -> term
str_to_title(term) -> term
view(term)
BP_mock <- data.frame(term, BP_mock$p_value, BP_mock$Count, BP_mock$`Fold Enrichment`)
colnames(BP_mock) <- c("Term", "p_value", "Count", "Fold.Enrichment")
View(BP_mock)
## Retirano colunas solicitaas
BP_mock%>%
slice(1, 19,15,7) -> BP_mock
########## CRIANDO GRÁFICOS BP ###########
ggplot() +
geom_point(data = BP_infec, aes(x = "Infection", y = reorder(Term, desc(-p_value)), size=Count, color=p_value)) +
geom_point(data = BP_mock, aes(x = "Control", y = reorder(Term, desc(-p_value)), size=Count, color=p_value)) +
scale_color_gradient(low = "red2", high = "mediumblue", space = "Lab") +
scale_x_discrete(limits= c("Infection", "Control")) +
labs(x = NULL, y = "Biological Process\n") + theme_bw() +
scale_size(range = c(8, 20)) +
theme(axis.text = element_text(size = 25)) +
theme(axis.title = element_text(size = 20)) -> BP
BP
################################################################### CC_infec ################################################################
## Separando coluna nas dataframes
infection.total.final <- data.frame(CC_infection.total$Term, CC_infection.total$PValue, CC_infection.total$Count, CC_infection.total$Fold.Enrichment)
colnames(infection.total.final) <- c("Term", "p_value", "Count", "Fold Enrichment")
as.data.frame(infection.total.final) -> infection.total.final
infection.total.final %>%
filter(p_value <= 0.05) -> CC_infec
View(CC_infec)
## Ajustando nome dos termos
term <- CC_infec$Term
str_remove_all(term, "~") -> term
str_remove_all(term, ":") -> term
str_remove_all(term, "[0123456789]") -> term
str_remove(term, "GO") -> term
str_to_title(term) -> term
view(term)
CC_infec <- data.frame(term, CC_infec$p_value, CC_infec$Count, CC_infec$`Fold Enrichment`)
colnames(CC_infec) <- c("Term", "p_value", "Count", "Fold.Enrichment")
View(CC_infec)
## Retirano colunas solicitaas
CC_infec%>%
slice(7,6,11,1) -> CC_infec
################################################################## CC_mock ################################################################
## Separando coluna nas dataframes
infection.total.final <- data.frame(CC_mock.total$Term, CC_mock.total$PValue, CC_mock.total$Count, CC_mock.total$Fold.Enrichment)
colnames(infection.total.final) <- c("Term", "p_value", "Count", "Fold Enrichment")
as.data.frame(infection.total.final) -> infection.total.final
infection.total.final %>%
filter(p_value <= 0.05) -> CC_mock
View(CC_mock)
## Ajustando nome dos termos
term <- CC_mock$Term
str_remove_all(term, "~") -> term
str_remove_all(term, ":") -> term
str_remove_all(term, "[0123456789]") -> term
str_remove(term, "GO") -> term
str_to_title(term) -> term
view(term)
CC_mock <- data.frame(term, CC_mock$p_value, CC_mock$Count, CC_mock$`Fold Enrichment`)
colnames(CC_mock) <- c("Term", "p_value", "Count", "Fold.Enrichment")
View(CC_mock)
## Retirano colunas solicitaas
CC_mock%>%
slice(7,17,31,13,1,32,10) -> CC_mock
########## CRIANDO GRÁFICOS CC ###########
ggplot() +
geom_point(data = CC_infec, aes(x = "Infection", y = reorder(Term, desc(-p_value)), size=Count, color=p_value)) +
geom_point(data = CC_mock, aes(x = "Control", y = reorder(Term, desc(-p_value)), size=Count, color=p_value)) +
scale_color_gradient(low = "red2", high = "mediumblue", space = "Lab") +
scale_x_discrete(limits= c("Infection", "Control")) +
labs(x = NULL, y = "Cellular Component \n") + theme_bw() +
scale_size(range = c(5, 20)) +
theme(axis.text = element_text(size = 25)) +
theme(axis.title = element_text(size = 20)) -> CC
CC
################################################################### MF_infec ################################################################
## Separando coluna nas dataframes
infection.total.final <- data.frame(MF_infection.total$Term, MF_infection.total$PValue, MF_infection.total$Count, MF_infection.total$Fold.Enrichment)
colnames(infection.total.final) <- c("Term", "p_value", "Count", "Fold Enrichment")
as.data.frame(infection.total.final) -> infection.total.final
infection.total.final %>%
filter(p_value <= 0.05) -> MF_infec
View(MF_infec)
## Ajustando nome dos termos
term <- MF_infec$Term
str_remove_all(term, "~") -> term
str_remove_all(term, ":") -> term
str_remove_all(term, "[0123456789]") -> term
str_remove(term, "GO") -> term
str_to_title(term) -> term
view(term)
MF_infec <- data.frame(term, MF_infec$p_value, MF_infec$Count, MF_infec$`Fold Enrichment`)
colnames(MF_infec) <- c("Term", "p_value", "Count", "Fold.Enrichment")
View(MF_infec)
## Retirano colunas solicitaas
MF_infec%>%
slice(7,6,1,10,11) -> MF_infec
#################################################################### MF_mock ################################################################
## Separando coluna nas dataframes
infection.total.final <- data.frame(MF_mock.total$Term, MF_mock.total$PValue, MF_mock.total$Count, MF_mock.total$Fold.Enrichment)
colnames(infection.total.final) <- c("Term", "p_value", "Count", "Fold Enrichment")
as.data.frame(infection.total.final) -> infection.total.final
infection.total.final %>%
filter(p_value <= 0.05) -> MF_mock
View(MF_mock)
## Ajustando nome dos termos
term <- MF_mock$Term
str_remove_all(term, "~") -> term
str_remove_all(term, ":") -> term
str_remove_all(term, "[0123456789]") -> term
str_remove(term, "GO") -> term
str_to_title(term) -> term
view(term)
MF_mock <- data.frame(term, MF_mock$p_value, MF_mock$Count, MF_mock$`Fold Enrichment`)
colnames(MF_mock) <- c("Term", "p_value", "Count", "Fold.Enrichment")
View(MF_mock)
## Retirano colunas solicitaas
MF_mock%>%
slice(4,3,2,5,16) -> MF_mock
########## CRIANDO GRÁFICOS MF ###########
ggplot() +
geom_point(data = MF_infec, aes(x = "Infection", y = reorder(Term, desc(-p_value)), size=Count, color=p_value)) +
geom_point(data = MF_mock, aes(x = "Control", y = reorder(Term, desc(-p_value)), size=Count, color=p_value)) +
scale_color_gradient(low = "red2", high = "mediumblue", space = "Lab") +
labs(x = NULL, y = "Molecular Function \n") + theme_bw() +
scale_size(range = c(5, 20)) +
theme(axis.text = element_text(size = 25)) +
theme(axis.title = element_text(size = 20)) -> MF
MF
################################################################## KEEG_infec ################################################################
## Separando coluna nas dataframes
infection.total.final <- data.frame(KEEG_infection.total$Term, KEEG_infection.total$PValue, KEEG_infection.total$Count, KEEG_infection.total$Fold.Enrichment)
colnames(infection.total.final) <- c("Term", "p_value", "Count", "Fold Enrichment")
as.data.frame(infection.total.final) -> infection.total.final
infection.total.final %>%
filter(p_value <= 0.05) -> KEGG_infec
View(KEGG_infec)
## Ajustando nome dos termos
term <- KEGG_infec$Term
str_remove_all(term, "~") -> term
str_remove_all(term, ":") -> term
str_remove_all(term, "[0123456789]") -> term
str_remove(term, "mmu") -> term
str_to_title(term) -> term
View(term)
KEGG_infec <- data.frame(term, KEGG_infec$p_value, KEGG_infec$Count, KEGG_infec$`Fold Enrichment`)
colnames(KEGG_infec) <- c("Term", "p_value", "Count", "Fold.Enrichment")
View(KEGG_infec)
## Retirano colunas solicitaas
KEGG_infec%>%
slice(9,2,3,21,7,4,14,1) -> KEGG_infec
################################################################## KEGG_mock ################################################################
## Separando coluna nas dataframes
infection.total.final <- data.frame(KEEG_mock.total$Term, KEEG_mock.total$PValue, KEEG_mock.total$Count, KEEG_mock.total$Fold.Enrichment)
colnames(infection.total.final) <- c("Term", "p_value", "Count", "Fold Enrichment")
as.data.frame(infection.total.final) -> infection.total.final
infection.total.final %>%
filter(p_value <= 0.05) -> KEGG_mock
View(KEGG_mock
## Ajustando nome dos termos
term <- KEGG_mock$Term
str_remove_all(term, "~") -> term
str_remove_all(term, ":") -> term
str_remove_all(term, "[0123456789]") -> term
str_remove(term, "mmu") -> term
str_to_title(term) -> term
View(term)
KEGG_mock <- data.frame(term, KEGG_mock$p_value, KEGG_mock$Count, KEGG_mock$`Fold Enrichment`)
colnames(KEGG_mock) <- c("Term", "p_value", "Count", "Fold.Enrichment")
View(KEGG_mock)
## Retirano colunas solicitaas
KEGG_mock%>%
slice(1,4,10,16) -> KEGG_mock
########## CRIANDO GRÁFICOS KEGG ###########
ggplot() +
geom_point(data = KEGG_infec, aes(x = "Infection", y = reorder(Term, desc(-p_value)), size=Count, color=p_value)) +
geom_point(data = KEGG_mock, aes(x = "Control", y = reorder(Term, desc(-p_value)), size=Count, color=p_value)) +
scale_color_gradient(low = "red2", high = "mediumblue", space = "Lab") +
scale_x_discrete(limits= c("Infection", "Control")) +
labs(x = NULL, y = "KEGG \n") + theme_bw() +
scale_size(range = c(5, 20)) +
theme(axis.text = element_text(size = 25)) +
theme(axis.title = element_text(size = 20)) -> KEGG
KEGG