-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCC
More file actions
42 lines (34 loc) · 1.33 KB
/
Copy pathCC
File metadata and controls
42 lines (34 loc) · 1.33 KB
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
Importa dataset com nome de "infection.total"
library(stringr)
library(ggplot2)
library(dplyr)
## Separando coluna nas dataframes
infection.total.final <- data.frame(infection.total$Term, infection.total$PValue, infection.total$Count, 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)
## Plotar usando ggplot2
CC <- ggplot(CC_infec, aes(x= Fold.Enrichment, y=reorder(Term, desc(-p_value)), size=Count, color=p_value)) + geom_point(alpha = 0.7) +
theme_get() + scale_size_area(max_size = 20) + ylab("Cellular Component") +
scale_x_continuous(breaks = c(0,20,30,50,70,90))
CC
ggsave(filename = "CC_infec.png",
plot = print(CC),
device = png,
scale = 1,
dpi = 300,
units = c("cm"))
dev.off()