/
figure-4.R
61 lines (59 loc) · 2.39 KB
/
figure-4.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
source("load-libraries.R")
source("analyze-three-color-trackscar.R")
source("analyze-two-color-trackscar.R")
source("budscar-count-utilities.R")
source("fig-theme.R")
fig4 = recoveryCounts %>%
subset((temp %in% c("35.5C","40C")) &
(recoveryTime == "6 hr recovery") &
(recoveryTemp == "30C recovery")) %>%
subset(!is.na(growth1) & !is.na(growth2)) %>%
subset( strain %in% c(1513, 1587, 1523)) %>%
transform( strain = factor( as.character(strain),
levels=c(1587, 1523, 1513),
labels=c("S288c", "YJM996", "YJM693"))) %>%
transform(live = growth2 > 0) %>%
count(vars=c("experiment", "strain", "live", "growth1")) %>%
ddply(.(experiment, strain), plyr::mutate,
freq.scaled = freq/sum(freq)) %>%
subset(growth1 < 9) %>%
ggplot(aes(x=growth1, y = freq.scaled, col=live, group=live, pch=live))+
stat_summary(fun.data="mean_cl_sem",lty=3)+
stat_summary(fun.data="mean_cl_sem", geom="line")+
facet_grid(strain~.)+
stat_summary(
data=
transform(
subset(heatStressCandidatesFreq,
(growth < 9) &
(strain %in% c(1513, 1587, 1523)) &
(temp == "30C")),
strain = factor( as.character(strain),
levels=c(1587, 1523, 1513),
labels=c("S288c", "YJM996", "YJM693")),
live = TRUE),
fun.data="mean_cl_sem",
aes(x=growth, col=NULL),
col="#009900", lty=3, pch=3)+
stat_summary(
data=
transform(
subset(heatStressCandidatesFreq,
(growth < 9) &
(strain %in% c(1513, 1587, 1523)) &
(temp == "30C")),
strain = factor( as.character(strain),
levels=c(1587, 1523, 1513),
labels=c("S288c", "YJM996", "YJM693")),
live = TRUE),
fun.data="mean_cl_sem",
aes(x=growth, col=NULL),
col="#009900",
geom="line",
lty=2)+
scale_y_continuous("Within temperature frequency", labels=percent)+
scale_x_continuous("Fecundity during heat stress", breaks=0:8)+
scale_color_manual(values=c("black", "#CC33CC"))+
scale_shape_manual(values=c(1,2))+
fig_theme
ggsave("figure4.pdf", fig4, height=4, width=3.4)