/
analyze-S288C-trackscar.R
40 lines (33 loc) · 1.15 KB
/
analyze-S288C-trackscar.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
source("load-libraries.R")
source("budscar-count-utilities.R")
heatStressCandidatesWithAge <- read.csv("2016-Maxwell-Magwene-two-color-trackscar.csv")
recoveryCounts <- read.csv("2016-Maxwell-Magwene-three-color-trackscar.csv")
A <- heatStressCandidatesWithAge %>%
subset(sampling == "random")%>%
subset(strain == 1587) %>%
plyr::summarize(
temp = temp,
growth=growth,
first = first,
experiment=experiment_ID)
B <- recoveryCounts %>%
subset(strain == 1587)%>%
plyr::summarize(
temp = temp,
growth=growth1,
first = first,
experiment = experiment)
S288C <- rbind(A,B) %>% # convert to temp to numeric
transform(temp = as.numeric(gsub("C", "", as.character(temp))))
S288CCounts <-
S288C %>%
subset(!is.na(growth)) %>%
count(c("experiment", "temp", "growth")) %>%
ddply(c("experiment", "temp"),
padFrequencies, 9) %>%
ddply(c("experiment", "temp"),
plyr::mutate,
freq.scaled=freq/sum(freq))
S288CGrowthByFirst <- ddply(S288C,
.(temp, experiment),
getGrowthByFirst,sem=TRUE)