-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFig7_plots.R
299 lines (269 loc) · 16.3 KB
/
Fig7_plots.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
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
library(multcomp) #multiple comparison statistics
library(ggplot2) #basic ggplot
library(ggpubr) #provides plots and some statistics
library(ggtext) #allows HTML-tags in text (element_markdown)
library(broom) #simplifies statistical data (tidy())
library(svglite) #for saving images in svg format
setwd("/media/sf_Genomik-data/user_data/Zemlianski Viacheslav/Cut project/Manuscript/Fig7")
theme_set(theme_classic() + theme(text = element_text(family = "Arial")))
################################################################################
#Fig7A, rapamycin treatment
Fig7A_data <- read.csv(file = "Fig7A_data.csv", header = TRUE) %>% # loading raw data
mutate(treatment = factor(treatment,levels = c("DMSO", "Amm",
"Rapa", "Rapa+Amm"))) %>%
mutate(cat_freq = cat_freq * 100) # converting into percentage
Fig7A_stats <- aov(cat_freq ~ treatment, Fig7A_data) %>% # statistical tests
glht(mcp(treatment = "Dunnet"), alternative = "less") %>%
tidy()
ggplot(Fig7A_data, aes(x = treatment, y = cat_freq, fill = treatment)) + # plot initialization
geom_bar(stat="summary", fun = "mean", # setting bars
na.rm = T, colour="black", width = 0.5) +
scale_x_discrete(labels = c("DMSO", # x-axis labels
"NH<sub>4</sub>Cl",
"Rapa",
"NH<sub>4</sub>Cl+<br>Rapa")) +
scale_fill_manual(values = rep("grey90", nrow(Fig7A_stats) + 1)) + # bar colors
scale_y_continuous(expand=c(0,0), limits=c(0,13.5), breaks=c(0,3,6,9,12)) + # y-axis settings
ylab("Frequency of catastrophic mitosis (%)") +
theme_classic() + # removing background
theme(axis.line = element_line(colour = "black", linewidth = 0.75), # axes design
axis.ticks.x = element_blank(),
axis.title.x = element_blank(),
axis.text.x = element_markdown(size = 9, colour = "black"),
axis.title.y = element_text(size = 9, colour = "black"),
axis.text.y = element_text(size = 9, colour = "black"),
axis.ticks.y = element_line(colour = "black", linewidth = 0.75),
legend.position = "none", # removing legend
plot.margin=unit(c(0.2, 0.2, 0.2, 0.2), "cm") # margins
) +
geom_point(na.rm=T, show.legend=F, size=2) + # adding datapoints
geom_errorbar(data = aggregate(cat_freq ~ treatment, # adding errorbars
data = Fig7A_data,
FUN = function(Fig7A_data)
c(AVG = mean(Fig7A_data, na.rm=T),
SD = sd(Fig7A_data, na.rm=T))),
aes(y = cat_freq[,"AVG"],
ymin = pmax(cat_freq[,"AVG"]-cat_freq[,"SD"], 0),
ymax = cat_freq[,"AVG"]+cat_freq[,"SD"]),
width=0.3, colour="black", linewidth=0.75
) +
geom_signif(xmin = c(1, seq(2, nrow(Fig7A_stats))), # adding statistics
xmax = c(mean(c(2, nrow(Fig7A_stats)+1)),
seq(3, nrow(Fig7A_stats)+1)),
annotations = "",
y_position = c(13, rep(12.75, nrow(Fig7A_stats)-1))
) +
geom_text(data = Fig7A_stats,
aes(x = seq(2, nrow(Fig7A_stats)+1),
y = 10.7,
label = paste0("p=", format(adj.p.value,
digits=2,
scientific=T)),
fill = NULL),
angle = 90, colour = "black", size = 9/.pt)
ggsave("Fig7A.png", width = 8, height = 8, units = "cm", dpi = 600) # saving the plot
ggsave("Fig7A.svg", width=8, height=8, units="cm", dpi=600, fix_text_size=F)
################################################################################
#Fig7B, tor1 mutants
Fig7B_data <- read.csv("Fig7B_data.csv", header = T) %>% # loading raw data
mutate(sample = paste(genotype, temperature, sep = "_"),
sample = factor(sample, levels = c("WT_32", "WT_34",
"Dcbf11_32", "Dcbf11_34",
"tor1ts_32", "tor1ts_34",
"tor1KO_32", "tor1KO_34")),
genotype = factor(genotype, levels = c("WT", "Dcbf11",
"tor1ts", "tor1KO")),
temperature = factor(temperature, levels = c("32", "34")),
cat_freq = cat_freq * 100
)
# Fig7B_t_1 <- t.test(c(Fig7B_data$cat_freq[Fig7B_data$sample == "Dcbf11_34"]), #statistical tests
# y = c(Fig7B_data$cat_freq[Fig7B_data$sample == "tor1ts_34"]),
# alternative = "greater",
# var.equal = T)
# Fig7B_t_2 <- t.test(c(Fig7B_data$cat_freq[Fig7B_data$sample == "Dcbf11_32"]),
# y = c(Fig7B_data$cat_freq[Fig7B_data$sample == "tor1KO_32"]),
# alternative = "greater",
# var.equal = T)
# Fig7B_stats <- rbind(tidy(Fig7B_t_1), tidy(Fig7B_t_2)) %>%
# mutate(p.adj = p.adjust(p.value, method = "holm"))
# rm(Fig7B_t_1, Fig7B_t_2)
Fig7B_stats <- aov(cat_freq ~ sample, # statistical tests
data = Fig7B_data) %>%
glht(mcp(sample = c("Dcbf11_34 - tor1ts_34 <= 0",
"Dcbf11_32 - tor1KO_32 <= 0"
))) %>%
tidy()
ggplot(Fig7B_data, aes(x = genotype, fill = temperature, y = cat_freq)) + # plot initialization
geom_bar(position = position_dodge(preserve = "single"), # adding bars
stat="summary", fun = "mean", na.rm = F,
colour="black", width = 0.5) +
scale_fill_manual(values = c("white", "gray50"), # bar colors
labels = c("32\u00B0C", "34\u00B0C")) + # legend labels
scale_x_discrete(labels = c("WT", # x-axis labels
"<i>\u0394cbf11</i>",
"<i>\u0394cbf11<br>tor1-D</i>",
"<i>\u0394cbf11<br>\u0394tor1</i>"
)) +
scale_y_continuous(expand=c(0,0), limits=c(0,28.7), breaks=seq(0,24,3)) + # y-axis setings
coord_cartesian(ylim = c(0, 24), expand = T, clip = "off") +
ylab("Frequency of catastrophic mitosis (%)") +
theme_classic() + # removing background
theme(axis.line = element_line(colour = "black", linewidth = 0.75), # axes design
axis.ticks.x = element_blank(),
axis.title.x = element_blank(),
axis.text.x = element_markdown(size = 9, colour = "black"),
# angle = 30, hjust = 0.7, vjust = 0.9),
axis.title.y = element_text(size = 9, colour = "black"),
axis.text.y = element_text(size = 9, colour = "black"),
axis.ticks.y = element_line(colour = "black", linewidth = 0.75),
legend.position = c(0.15, 0.9),
legend.title = element_blank(),
legend.text = element_text(size = 9, colour = "black"),
legend.text.align = 0,
legend.key.size = unit(0.3, 'cm'),
legend.background = element_blank(),
plot.margin=unit(c(1.05, 0.2, 0.2, 0.2), "cm") # plot margins
) +
geom_point(position=position_dodge(0.5), na.rm=T, show.legend=F, size=2) + # adding individual points
geom_errorbar(data = aggregate(cat_freq~genotype+temperature, # adding errorbars
data = Fig7B_data,
FUN = function(Fig7B_data)
c(AVG = mean(Fig7B_data, na.rm=T),
SD = sd(Fig7B_data, na.rm=T))),
aes(y = cat_freq[,"AVG"],
ymin = pmax(cat_freq[,"AVG"]-cat_freq[,"SD"], 0),
ymax = cat_freq[,"AVG"]+cat_freq[,"SD"]),
position = position_dodge(0.5, preserve = "single"),
width=0.3, colour="black", linewidth=0.75
) +
geom_signif(xmin = c(2.125, 1.875), # adding statistics brackets
xmax = c(3.125, 3.875),
y_position = c(24.8, 26.5),
annotations = "") +
geom_text(data = Fig7B_stats,
aes(x = c(2.7, 3),
y = c(24.8, 26.5),
vjust = -0.5,
hjust = 0.6,
label = paste0("p=", format(adj.p.value, scientific=T, digits=2)),
fill = NULL),
colour = symnum(Fig7B_stats$adj.p.value,
cutpoints = c(0, 0.05, Inf),
symbols = c("black", "gray")),
size = 9/.pt) +
geom_text(aes(x = 4.2, y = 0.8, label = "NA"), size = 9/.pt)
ggsave("Fig7B.png", width = 8, height = 8, units = "cm", dpi = 600) # saving the plot
ggsave("Fig7B.svg", width=8, height=8, units="cm", dpi=600, fix_text_size=F)
################################################################################
#Fig7C, ssp2KO
Fig7C_data <- read.csv("Fig7C_data.csv", header = T) %>% # loading raw data
mutate(genotype = factor(genotype, levels = c("WT", "Dcbf11", "Dssp2")),
cat_freq = cat_freq * 100)
Fig7C_stats <- t.test(c(Fig7C_data$cat_freq[Fig7C_data$genotype == "Dcbf11"]), # statistical tests
y = c(Fig7C_data$cat_freq[Fig7C_data$genotype == "Dssp2"]),
alternative = "greater",
var.equal = T) %>%
tidy()
ggplot(Fig7C_data, aes(x = genotype, y = cat_freq, fill = genotype)) + # plot initialization
geom_bar(stat="summary", fun = "mean", # setting bars
na.rm = T, colour="black", width = 0.5) +
scale_x_discrete(labels = c("WT",
"<i>\u0394cbf11</i>",
"<i>\u0394cbf11<br>\u0394ssp2</i>"
)) +
scale_fill_manual(values = rep("grey90", 3)) + # bar colors
scale_y_continuous(expand=c(0,0), limits=c(0,13.5), breaks=c(0,3,6,9,12)) + # y-axis settings
ylab("Frequency of catastrophic mitosis (%)") +
theme_classic() + # removing background
theme(axis.line = element_line(colour = "black", linewidth = 0.75), # axes design
axis.ticks.x = element_blank(),
axis.title.x = element_blank(),
axis.text.x = element_markdown(size = 9, colour = "black", vjust = 1),
# angle = 30, hjust = 1),
axis.title.y = element_text(size = 9, colour = "black"),
axis.text.y = element_text(size = 9, colour = "black"),
axis.ticks.y = element_line(colour = "black", linewidth = 0.75),
legend.position = "none", # removing legend
plot.margin=unit(c(0.2, 0.2, 0.2, 0.2), "cm") # plot margins
) +
geom_point(na.rm=T, show.legend=F, size=2) + # adding datapoints
geom_errorbar(data = aggregate(cat_freq ~ genotype, # adding errorbars
data = Fig7C_data,
FUN = function(Fig7C_data)
c(AVG = mean(Fig7C_data, na.rm=T),
SD = sd(Fig7C_data, na.rm=T))),
aes(y = cat_freq[,"AVG"],
ymin = pmax(cat_freq[,"AVG"]-cat_freq[,"SD"], 0),
ymax = cat_freq[,"AVG"]+cat_freq[,"SD"]),
width=0.3, colour="black", linewidth=0.75
) +
geom_signif(xmin = 2, xmax = 3, y_position = 12.7, # adding statistics brackets
annotations = paste0("p=", format(Fig7C_stats$p.value,
scientific=T,
digits=2)),
vjust = -0.5, textsize = 9/.pt)
ggsave("Fig7C.png", width = 6.5, height = 8, units = "cm", dpi = 600) # saving the plot
ggsave("Fig7C.svg", width=6.5, height=8, units="cm", dpi=600, fix_text_size=F)
################################################################################
#Fig7X, effect of autophagy suppression
# For response to the review only
Fig7X_data <- read.csv("Fig7X_data.csv", header = T) %>% # loading raw data
mutate(sample = paste(genotype, treatment, sep = "_"),
sample = factor(sample, levels = c("WT_DMSO", "WT_BAF",
"Dcbf11_DMSO", "Dcbf11_BAF")),
genotype = factor(genotype, levels = c("WT", "Dcbf11")),
treatment = factor(treatment, levels = c("DMSO", "BAF")),
cat_freq = cat_freq * 100
)
Fig7X_stats <- t.test(c(Fig7X_data$cat_freq[Fig7X_data$sample == "Dcbf11_DMSO"]), # statistical tests
y = c(Fig7X_data$cat_freq[Fig7X_data$sample == "Dcbf11_BAF"]),
alternative = "two.sided",
var.equal = T) %>%
tidy()
ggplot(Fig7X_data, aes(x = genotype, fill = treatment, y = cat_freq)) + # plot initialization
geom_bar(position = position_dodge(preserve = "single"), # adding bars
stat="summary", fun = "mean", na.rm = F,
colour="black", width = 0.5) +
scale_fill_manual(values = c("white", "gray50"), # bar colors
labels = c("DMSO", "bafilomycin")) + # legend labels
scale_x_discrete(labels = c("WT", # x-axis labels
"<i>\u0394cbf11</i>"
)) +
scale_y_continuous(expand=c(0,0), limits=c(0,14), breaks=c(0,3,6,9,12)) + # y-axis setings
# coord_cartesian(ylim = c(0, 24), expand = T, clip = "off") +
ylab("Frequency of catastrophic mitosis (%)") +
theme_classic() + # removing background
theme(axis.line = element_line(colour = "black", linewidth = 0.75), # axes design
axis.ticks.x = element_blank(),
axis.title.x = element_blank(),
axis.text.x = element_markdown(size = 9, colour = "black"),
# angle = 30, hjust = 0.7, vjust = 0.9),
axis.title.y = element_text(size = 9, colour = "black"),
axis.text.y = element_text(size = 9, colour = "black"),
axis.ticks.y = element_line(colour = "black", linewidth = 0.75),
legend.position = c(0.3, 0.9),
legend.title = element_blank(),
legend.text = element_text(size = 9, colour = "black"),
legend.text.align = 0,
legend.key.size = unit(0.3, 'cm'),
legend.background = element_blank(),
plot.margin=unit(c(1.05, 0.2, 0.2, 0.2), "cm") # plot margins
) +
geom_point(position=position_dodge(0.5), na.rm=T, show.legend=F, size=2) + # adding individual points
geom_errorbar(data = aggregate(cat_freq~genotype+treatment, # adding errorbars
data = Fig7X_data,
FUN = function(Fig7X_data)
c(AVG = mean(Fig7X_data, na.rm=T),
SD = sd(Fig7X_data, na.rm=T))),
aes(y = cat_freq[,"AVG"],
ymin = pmax(cat_freq[,"AVG"]-cat_freq[,"SD"], 0),
ymax = cat_freq[,"AVG"]+cat_freq[,"SD"]),
position = position_dodge(0.5, preserve = "single"),
width=0.3, colour="black", linewidth=0.75
) +
geom_signif(xmin = 1.865, xmax = 2.125, y_position = 12.5, # adding statistics brackets
annotations = paste0("p=", format(Fig7X_stats$p.value,
scientific=F,
digits=3)),
vjust = -0.5, textsize = 9/.pt)
ggsave("Fig7X.png", width = 6.5, height = 8, units = "cm", dpi = 600) # saving the plot