-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathf-generate_concordance_scatterplot-sars.R
78 lines (67 loc) · 2.87 KB
/
f-generate_concordance_scatterplot-sars.R
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
library(tidyverse)
library(RColorBrewer)
library(extrafont)
loadfonts()
col_spec <- cols(
.default = col_double(),
Candidates = col_character()
)
specials <- c("Ruxolitinib", "Sirolimus")
top <- c("Ivermectin", "Genistein", "Alvocidib")
df <- read_csv("results/sars2-summarized-dataset.csv",
col_names = c("Candidates", "Avg", "SDev", "SDLog10", "SDLog2"),
col_types = col_spec,
skip = 1) %>%
mutate(Selected = if_else(Avg >= 0.5 & SDev <= 0.06, "Yes", "No"),
Selected = if_else(Candidates %in% specials, "Special", Selected),
Selected = if_else(Candidates %in% top, "Top", Selected))
p <- ggplot(data=df,
mapping = aes(x = Avg,
y = SDev,
size = 4,
shape = Selected,
color = Selected)
)
bp <- p +
geom_hline(yintercept = 0.3, size = 1) +
geom_hline(yintercept = 0.5, size = 1) +
geom_vline(xintercept = 0.05, size = 1) +
geom_vline(xintercept = 0.10, size = 1) +
geom_point(stroke = 2) +
xlab("\n\nAverage Reported Concordance Scores across Cell Line Datasets") +
ylab("Standard Deviation of Reportedd Concordance Scores across Cell Line Datasets\n\n")
fp <- bp +
theme_minimal() +
theme(
plot.title = element_text(size = 30, family = "ArialMT", hjust = 0.5),
axis.title = element_text(size = 30, family = "ArialMT"),
axis.text = element_text(size = 24, family = "ArialMT"),
legend.text = element_text(size = 24, family = "ArialMT"),
legend.title = element_text(size = 24, family = "ArialMT"),
legend.key = element_rect(color = NA, fill = NA),
legend.key.size = unit(1.5, "cm")
) +
scale_shape_manual(name = element_blank(),
values = c(16, 1, 17, 15),
breaks = c("Yes", "No", "Top", "Special"),
labels = c("Passed Threshold", "Did Not Pass Threshold",
"Top Candidates", substitute('Previously Identified '~italic(x), list(x="in silico")))) +
scale_color_brewer(name = element_blank(),
palette = "Dark2",
labels = c("Passed Threshold", "Did Not Pass Threshold",
"Top Candidates", substitute('Previously Identified '~italic(x), list(x="in silico"))),
breaks = c("Yes", "No", "Top", "Special")) +
scale_x_continuous(
breaks = seq(0, 1, 0.1),
limits = c(0.3,0.8)
) +
scale_y_continuous(
breaks = seq(0, 0.15, 0.01),
limits = c(0, 0.15)
) +
guides(size=FALSE,
color = guide_legend(override.aes = list(size=10)),
shape = guide_legend(override.aes = list(size=10))
)
full <- fp + ggtitle("Concordance Scatter plot for SARS")
ggsave("figures/SARS-Concordance-Scatterplot.png", plot = full, device = "png", width = 11.69 * 2, height = 8.27 * 2, units = "in")