/
process-two-color-trackscar.R
110 lines (91 loc) · 4.36 KB
/
process-two-color-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
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
source("budscar-count-utilities.R")
source("load-libraries.R")
### Read in all the trackscar data
countsDir <- file.path("~/git", "budscar_counts")
index <- read.csv(file.path(countsDir, "index.csv"))
allCounts <- getAllCounts(index, countsDir)
### Make a list of all the strains examined during the project
heatCand <- read.csv("2016-Maxwell-Magwene-heat-stress-candidates.csv", skip=1) %>%
subset(exclusion_reason == "")
candidateStrains <- rep("second_screening", nrow(heatCand))
names(candidateStrains) <- as.character(heatCand$PMY)
## These are a few extra strains examined at both 37C and 30C during
## the course of the experiments
additionalStrains <- rep("first_screening", 9)
names(additionalStrains) <- c("1560",
"1492",
"1549",
"1535",
"1587",
"1557",
"1504",
"1516")
candidateStrains <- c(candidateStrains, additionalStrains)
## A mapping from YJM to PMY numbers
## removing the ones that are haploid as per Dan's info on 1/24/15
strainMap <- read.csv(file.path("2015_screening_for_TS", "PMY_to_YJM.csv")) %>%
subset( !(Strain %in% c("YJM1250", "YJM1388", "YJM1419")))
## this will make the data 'recoveryCountsForMerge' which contains
## the first interval of three color trackscar data, which is
## just a two color trackscar experiment.
source("analyze-three-color-trackscar.R")
## To get accurate measurements for mortality and fecundity in older
## cohorts, some experiments specifically sought out the older cells
## For growth by first age, use all the data
heatStressCandidatesWithAge <-
allCounts %>%
subset((strain %in% names(candidateStrains)) &
(media == "YPD") &
((strain == "1587") | (temp %in% c("30C", "37C"))) & # 37C
# and
# 30C. all
# temps
# for
# s288c
(time == 6) & # only experiments that were 6hr
(growth < 10))
## include the first interval of the recovery data
heatStressCandidatesWithAge <-
rbind(heatStressCandidatesWithAge,
recoveryCountsForMortality[,colnames(heatStressCandidatesWithAge)]) # defined in process-three-color-trackscar.R
## include the haploid S288C data for fig S1
## These are the haploid S288C data shown to compare mother cell
## and daughter cell fecundity
haploidCounts <- subset(allCounts,
folder %in% c("2015-03-31_S288C_30C",
"2015-04-01_S288C_30C",
"2014_03_11_WGA_microscopy")) %>%
subset(strain %in% c("CMY1","1638"))
heatStressCandidatesWithAge <- rbind(heatStressCandidatesWithAge,
haploidCounts[,colnames(heatStressCandidatesWithAge)])
## Fix the off by 1.5C error in the incubator temperatures
heatStressCandidatesWithAge <- heatStressCandidatesWithAge %>%
transform(temp = factor(gsub("37", "35.5", as.character(temp)))) %>%
transform(temp = factor(gsub("38.5", "37", as.character(temp)))) %>%
transform(temp = factor(gsub("40", "38.5", as.character(temp))))
write.csv(heatStressCandidatesWithAge,
"2016-Maxwell-Magwene-two-color-trackscar.csv", row.names=FALSE)
## This is a timeseries experiment with different number of hours
## between first and second stains
timeseriesCounts <- read.csv(
file.path(countsDir,
"20140321_bud_counts_combined.csv")) %>%
transform(growth=second-first)
with(timeseriesCounts,
data.frame(
folder="2014-03-21_WGA_calibration2",
experiment_ID="timecourse2",
counts_file="20140321_bud_counts_combined.csv",
sampling="random",
temp="30C",
media="YPD",
who_counted="CSM",
number_of_colors=2,
time=hours,
strain=real_strain,
replicate=replicate,
growth=growth,
first=first,
last=second)) %>%
write.csv("2016-Maxwell-Magwene-two-color-trackscar-timeseries.csv",
row.names=F)