delta_growth_drought <- rbind(delta_growth_drought, deltaIDdf)
}
View(delta_growth_drought)
delta_growth_drought_graph %>%
filter(delta_growth_drought_graph$gene != "Tissue") %>%
group_by(GT, time, stress) %>%
summarise(
mean = mean(Delta_growth, na.rm = TRUE),
sd = sd(Delta_growth, na.rm = TRUE),
se = sd / 2^0.5
) %>%
ggplot(delta_growth_drought_graph,mapping = aes(color=GT, x = time,y=mean)) +
facet_wrap( ~ GT) +
geom_line() +
geom_hline(yintercept=0) +
geom_point() +
geom_errorbar(aes(ymin = mean - se, ymax = mean + se),) +
labs(
title = "growth per day OEs all days"
)
delta_growth_drought$delta_delta <- 0
delta_delta_growth_drought <- delta_growth_drought %>% filter(delta_growth_drought$time == "The_end_times")
View(delta_delta_growth_drought)
######################################################################################################
#####################################################################################################
#delta delta of growth
#####################################################################################################
#dus tja, verschil tussen dag 27 en 28 in de delta. dat hoe snel het naar beneden gaat.
UniqueIDDelta <- unique(delta_growth_drought$ID)
delta_growth_drought$delta_delta <- 0
delta_delta_growth_drought <- delta_growth_drought %>% filter(delta_growth_drought$time == "The_end_times")
for (val in UniqueIDDelta){
delta_growth_ID <- delta_growth_drought %>% filter(delta_growth_drought$ID == val)
growth_27 <- delta_growth_ID %>% filter(delta_growth_ID$time == 27)
gowth_28 <- delta_growth_ID %>% filter(delta_growth_ID$time == 28)
growth_27$delta_delta <-  growth_27$Delta_growth - growth_28$Delta_growth
delta_delta_growth_drought <- rbind(delta_delta_growth_drought,growth_27)
}
delta_growth_ID <- delta_growth_drought %>% filter(delta_growth_drought$ID == val)
growth_27 <- delta_growth_ID %>% filter(delta_growth_ID$time == 27)
growth_28 <- delta_growth_ID %>% filter(delta_growth_ID$time == 28)
for (val in UniqueIDDelta){
delta_growth_ID <- delta_growth_drought %>% filter(delta_growth_drought$ID == val)
growth_27 <- delta_growth_ID %>% filter(delta_growth_ID$time == 27)
growth_28 <- delta_growth_ID %>% filter(delta_growth_ID$time == 28)
growth_27$delta_delta <-  growth_27$Delta_growth - growth_28$Delta_growth
delta_delta_growth_drought <- rbind(delta_delta_growth_drought,growth_27)
}
View(delta_delta_growth_drought)
delta_delta_growth_drought_export
delta_delta_growth_drought_export###########################################################################################################
delta_delta_growth_drought_export <- delta_delta_growth_drought
delta_delta_growth_drought_export <- delta_delta_growth_drought
uniqueTrait <- unique(delta_delta_growth_drought$GT)
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- delta_delta_growth_drought_GT$delta_delta
delta_delta_growth_drought_GT <- delta_delta_growth_drought_GT %>%
rename(
val = "delta_delta_growth_drought_GT$GT"
)
delta_delta_growth_drought_export <- cbind(delta_delta_growth_drought_export,delta_delta_growth_drought_GT)
}
uniqueTrait <- unique(delta_delta_growth_drought$GT)
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- delta_delta_growth_drought_GT$delta_delta
delta_delta_growth_drought_GT <- delta_delta_growth_drought_GT %>%
rename(
val = "delta_delta_growth_drought_GT$GT"
)
delta_delta_growth_drought_export <- cbind(delta_delta_growth_drought_export,delta_delta_growth_drought_GT)
}
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- delta_delta_growth_drought_GT$delta_delta
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
delta_delta_growth_drought_GT <- delta_delta_growth_drought_GT %>%
rename(
val = "delta_delta_growth_drought_GT$GT"
)
View(delta_delta_growth_drought_GT)
delta_delta_growth_drought_GT <- delta_delta_growth_drought_GT %>%
rename(
val = "delta_delta_growth_drought_GT$delta_delta"
)
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
delta_delta_growth_drought_GT <- delta_delta_growth_drought_GT %>%
rename(
val = "delta_delta_growth_drought_GT$delta_delta"
)
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export <- as.data.frame(uniqueTrait)
View(delta_delta_growth_drought_export)
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export <- cbind(delta_delta_growth_drought_export,delta_delta_growth_drought_GT)
}
uniqueTrait <- unique(delta_delta_growth_drought$GT)
rm(delta_delta_growth_drought_export)
delta_delta_growth_drought_export <- as.data.frame(uniqueTrait)
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export <- cbind.fill(delta_delta_growth_drought_export,delta_delta_growth_drought_GT)
}
uniqueTrait <- unique(delta_delta_growth_drought$GT)
rm(delta_delta_growth_drought_export)
delta_delta_growth_drought_export <- as.data.frame(sort(uniqueTrait))
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export <- cbind.fill(delta_delta_growth_drought_export,delta_delta_growth_drought_GT)
}
uniqueTrait <- sort(unique(delta_delta_growth_drought$GT))
rm(delta_delta_growth_drought_export)
delta_delta_growth_drought_export <- as.data.frame(sort(uniqueTrait))
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export <- cbind.fill(delta_delta_growth_drought_export,delta_delta_growth_drought_GT)
}
View(delta_growth_drought)
View(Predictedplantsizedrought)
Predictedplantsizedrought %>% filter(ID == 1397048) %>%
ggplot(Predictedplantsizedrought,mapping = aes(color=GT, x = time,y=predictedplantsize))
Predictedplantsizedrought %>% filter(ID == 1397048)
Predictedplantsizedrought %>% filter(ID == 1397048) %>%  ggplot(Predictedplantsizedrought,mapping = aes(x = time,y=predictedplantsize))
Predictedplantsizedrought %>% filter(ID == 1397048) %>%
ggplot(Predictedplantsizedrought, aes(x = time,y=predictedplantsize))
Predictedplantsizedrought %>% filter(ID == 1397048) %>%
ggplot(aes(x = time,y=predictedplantsize))
View(PlantSize2)
View(PlantSize3)
Plantsize3 %>% filter(ID == 1397048) %>%
ggplot(aes(x = MeasurementDate_das,y=projPlantSurfaceArea_mm2))
Plantsize3 %>% filter(ID == 1397048)
PlantSize3 %>% filter(ID == 1397048) %>%
ggplot(aes(x = MeasurementDate_das,y=projPlantSurfaceArea_mm2))
view(delta_delta_growth_drought)
UniqueIDDelta <- unique(delta_growth_drought$ID)
delta_growth_drought$delta_delta <- 0
delta_delta_growth_drought <- delta_growth_drought %>% filter(delta_growth_drought$time == "The_end_times")
for (val in UniqueIDDelta){
delta_growth_ID <- delta_growth_drought %>% filter(delta_growth_drought$ID == val)
growth_27 <- delta_growth_ID %>% filter(delta_growth_ID$time == 30)
growth_28 <- delta_growth_ID %>% filter(delta_growth_ID$time == 31)
growth_27$delta_delta <-  growth_27$Delta_growth - growth_28$Delta_growth
delta_delta_growth_drought <- rbind(delta_delta_growth_drought,growth_27)
}
view(delta_delta_growth_drought)
uniqueTrait <- sort(unique(delta_delta_growth_drought$GT))
rm(delta_delta_growth_drought_export2)
delta_delta_growth_drought_export <- as.data.frame(sort(uniqueTrait))
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export2 <- cbind.fill(delta_delta_growth_drought_export,delta_delta_growth_drought_GT)
}
delta_delta_growth_drought_export2 <- as.data.frame(sort(uniqueTrait))
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export2 <- cbind.fill(delta_delta_growth_drought_export,delta_delta_growth_drought_GT)
}
view(delta_delta_growth_drought)
uniqueTrait <- sort(unique(delta_delta_growth_drought$GT))
rm(delta_delta_growth_drought_export2)
delta_delta_growth_drought_export2 <- as.data.frame(sort(uniqueTrait))
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export2 <- cbind.fill(delta_delta_growth_drought_export2,delta_delta_growth_drought_GT)
}
uniqueTrait <- sort(unique(delta_delta_growth_drought$GT))
rm(delta_delta_growth_drought_export)
delta_delta_growth_drought_export2 <- as.data.frame(sort(uniqueTrait))
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export2 <- cbind.fill(delta_delta_growth_drought_export2,delta_delta_growth_drought_GT)
View(delta_delta_growth_drought_GT)
delta_delta_growth_drought_export2 <- as.data.frame(sort(uniqueTrait))
View(delta_delta_growth_drought_export2)
View(delta_delta_growth_drought_GT)
delta_delta_growth_drought_export2 <- cbind.fill(delta_delta_growth_drought_export2,delta_delta_growth_drought_GT)
uniqueTrait <- sort(unique(delta_delta_growth_drought$GT))
rm(delta_delta_growth_drought_export)
delta_delta_growth_drought_export <- as.data.frame(sort(uniqueTrait))
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export <- cbind.fill(delta_delta_growth_drought_export,delta_delta_growth_drought_GT)
}
cbind.fill<-function(...){
nm <- list(...)
nm<-lapply(nm, as.matrix)
n <- max(sapply(nm, nrow))
do.call(cbind, lapply(nm, function (x)
rbind(x, matrix(, n-nrow(x), ncol(x)))))
}
uniqueTrait <- sort(unique(delta_delta_growth_drought$GT))
rm(delta_delta_growth_drought_export)
delta_delta_growth_drought_export <- as.data.frame(sort(uniqueTrait))
delta_delta_growth_drought_export <- cbind.fill(delta_delta_growth_drought_export,delta_delta_growth_drought_GT)
View(delta_delta_growth_drought_export)
delta_delta_growth_drought_export <- cbind.fill(delta_delta_growth_drought_export,delta_delta_growth_drought_GT)
delta_delta_growth_drought_export <- as.data.frame(delta_delta_growth_drought_export)
view(delta_delta_growth_drought)
uniqueTrait <- sort(unique(delta_delta_growth_drought$GT))
rm(delta_delta_growth_drought_export)
delta_delta_growth_drought_export <- as.data.frame(sort(uniqueTrait))
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export <- cbind.fill(delta_delta_growth_drought_export,delta_delta_growth_drought_GT)
delta_delta_growth_drought_export <- as.data.frame(delta_delta_growth_drought_export)
}
View(delta_delta_growth_drought_export)
UniqueIDDelta <- unique(delta_growth_drought$ID)
delta_growth_drought$delta_delta <- 0
delta_delta_growth_drought <- delta_growth_drought %>% filter(delta_growth_drought$time == "The_end_times")
for (val in UniqueIDDelta){
delta_growth_ID <- delta_growth_drought %>% filter(delta_growth_drought$ID == val)
growth_27 <- delta_growth_ID %>% filter(delta_growth_ID$time == 27)
growth_28 <- delta_growth_ID %>% filter(delta_growth_ID$time == 28)
growth_27$delta_delta <-  growth_27$Delta_growth - growth_28$Delta_growth
delta_delta_growth_drought <- rbind(delta_delta_growth_drought,growth_27)
}
view(delta_delta_growth_drought)
uniqueTrait <- sort(unique(delta_delta_growth_drought$GT))
rm(delta_delta_growth_drought_export2)
delta_delta_growth_drought_export2 <- as.data.frame(sort(uniqueTrait))
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export2 <- cbind.fill(delta_delta_growth_drought_export2,delta_delta_growth_drought_GT)
delta_delta_growth_drought_export2 <- as.data.frame(delta_delta_growth_drought_export2)
}
View(delta_delta_growth_drought_export)
View(delta_delta_growth_drought_export2)
write.csv(delta_delta_growth_drought_export, 'delta_delta_growth_drought_export_GT.csv')
uniqueTrait <- sort(unique(delta_delta_growth_drought$Genotype))
rm(delta_delta_growth_drought_export)
delta_delta_growth_drought_export <- as.data.frame(sort(uniqueTrait))
for (val in uniqueTrait){
delta_delta_growth_drought_Genotype <- delta_delta_growth_drought %>% filter(delta_delta_growth_drought$Genotype == val)
delta_delta_growth_drought_Genotype <- as.data.frame(delta_delta_growth_drought_Genotype$delta_delta)
colnames(delta_delta_growth_drought_Genotype) <- c(val)
delta_delta_growth_drought_export <- cbind.fill(delta_delta_growth_drought_export,delta_delta_growth_drought_Genotype)
delta_delta_growth_drought_export <- as.data.frame(delta_delta_growth_drought_export)
}
write.csv(delta_delta_growth_drought_export, 'delta_delta_growth_drought_export_genotype.csv')
setwd("D:/phd doc/surfdrive/Documents/phenotyping_platform/compiled_data/graphs2/predicted_PlantSurfaceArea")
uniqueID <- unique(predictedplantsizeduringdrought$ID)
predictedplantsizeduringdrought_normalized37 <- predictedplantsizeduringdrought %>% filter(ID == "I_feel_fine")
for (val in uniqueID){
predictedplantsizeduringdrought_ID <- predictedplantsizeduringdrought %>% filter(ID == "val")
predictedplantsizeduringdrought_ID_37 <- predictedplantsizeduringdrought %>% filter(time == 37)
predictedplantsizeduringdrought_ID_37 <- predictedplantsizeduringdrought_ID_37$predictedplantsize
predictedplantsizeduringdrought_ID$predictedplantsize <- predictedplantsizeduringdrought_ID$predictedplantsize/predictedplantsizeduringdrought_ID_37*100
predictedplantsizeduringdrought_normalized37 <- rbind(predictedplantsizeduringdrought_normalized37,predictedplantsizeduringdrought_ID)
}
View(predictedplantsizeduringdrought)
###########################################################################################################
#normalized to total size delta delta
###########################################################################################################
uniqueID <- unique(Predictedplantsizedrought$ID)
Predictedplantsizedrought_normalized37 <- Predictedplantsizedrought %>% filter(ID == "I_feel_fine")
predictedplantsizeduringdrought_ID <- Predictedplantsizedrought %>% filter(ID == "val")
predictedplantsizeduringdrought_ID <- Predictedplantsizedrought %>% filter(ID == "val")
###########################################################################################################
#normalized to total size delta delta
###########################################################################################################
uniqueID <- unique(Predictedplantsizedrought$ID)
Predictedplantsizedrought_normalized37 <- Predictedplantsizedrought %>% filter(ID == "I_feel_fine")
predictedplantsizeduringdrought_ID <- Predictedplantsizedrought %>% filter(ID == val)
predictedplantsizeduringdrought_ID <- Predictedplantsizedrought %>% filter(ID == val)
predictedplantsizeduringdrought_ID_37 <- Predictedplantsizedrought %>% filter(time == 37)
predictedplantsizeduringdrought_ID <- Predictedplantsizedrought %>% filter(ID == val)
predictedplantsizeduringdrought_ID_37 <- predictedplantsizeduringdrought_ID %>% filter(time == 37)
predictedplantsizeduringdrought_ID_37 <- predictedplantsizeduringdrought_ID_37$predictedplantsize
predictedplantsizeduringdrought_ID$predictedplantsize <- predictedplantsizeduringdrought_ID$predictedplantsize/predictedplantsizeduringdrought_ID_37*100
###########################################################################################################
#normalized to total size delta delta
###########################################################################################################
uniqueID <- unique(Predictedplantsizedrought$ID)
Predictedplantsizedrought_normalized37 <- Predictedplantsizedrought %>% filter(ID == "I_feel_fine")
for (val in uniqueID){
predictedplantsizeduringdrought_ID <- Predictedplantsizedrought %>% filter(ID == val)
predictedplantsizeduringdrought_ID_37 <- predictedplantsizeduringdrought_ID %>% filter(time == 37)
predictedplantsizeduringdrought_ID_37 <- predictedplantsizeduringdrought_ID_37$predictedplantsize
predictedplantsizeduringdrought_ID$predictedplantsize <- predictedplantsizeduringdrought_ID$predictedplantsize/predictedplantsizeduringdrought_ID_37*100
Predictedplantsizedrought_normalized37 <- rbind(Predictedplantsizedrought_normalized37,predictedplantsizeduringdrought_ID)
}
View(Predictedplantsizedrought_normalized37)
uniqueID <- unique(Predictedplantsizedrought$ID)
Predictedplantsizedrought_normalized26 <- Predictedplantsizedrought %>% filter(ID == "I_feel_fine")
for (val in uniqueID){
predictedplantsizeduringdrought_ID <- Predictedplantsizedrought %>% filter(ID == val)
predictedplantsizeduringdrought_ID_26 <- predictedplantsizeduringdrought_ID %>% filter(time == 26)
predictedplantsizeduringdrought_ID_26 <- predictedplantsizeduringdrought_ID_37$predictedplantsize
predictedplantsizeduringdrought_ID$predictedplantsize <- predictedplantsizeduringdrought_ID$predictedplantsize/predictedplantsizeduringdrought_ID_26*100
Predictedplantsizedrought_normalized26 <- rbind(Predictedplantsizedrought_normalized26,predictedplantsizeduringdrought_ID)
}
###########################################################################################################
#normalized to total size delta delta
###########################################################################################################
uniqueID <- unique(Predictedplantsizedrought$ID)
Predictedplantsizedrought_normalized26 <- Predictedplantsizedrought %>% filter(ID == "I_feel_fine")
predictedplantsizeduringdrought_ID <- Predictedplantsizedrought %>% filter(ID == val)
predictedplantsizeduringdrought_ID_26 <- predictedplantsizeduringdrought_ID %>% filter(time == 26)
predictedplantsizeduringdrought_ID_26 <- predictedplantsizeduringdrought_ID_37$predictedplantsize
predictedplantsizeduringdrought_ID$predictedplantsize <- predictedplantsizeduringdrought_ID$predictedplantsize/predictedplantsizeduringdrought_ID_26*100
###########################################################################################################
#normalized to total size delta delta
###########################################################################################################
uniqueID <- unique(Predictedplantsizedrought$ID)
Predictedplantsizedrought_normalized26 <- Predictedplantsizedrought %>% filter(ID == "I_feel_fine")
for (val in uniqueID){
predictedplantsizeduringdrought_ID <- Predictedplantsizedrought %>% filter(ID == val)
predictedplantsizeduringdrought_ID_26 <- predictedplantsizeduringdrought_ID %>% filter(time == 26)
predictedplantsizeduringdrought_ID_26 <- predictedplantsizeduringdrought_ID_26$predictedplantsize
predictedplantsizeduringdrought_ID$predictedplantsize <- predictedplantsizeduringdrought_ID$predictedplantsize/predictedplantsizeduringdrought_ID_26*100
Predictedplantsizedrought_normalized26 <- rbind(Predictedplantsizedrought_normalized26,predictedplantsizeduringdrought_ID)
}
rm(delta_growth_drought_normalized26)
delta_growth_drought_normalized26<-data.frame(time=numeric(0),  ID=character(0),  Genotype=character(0),  stress=character(0),  gene=character(0),  GT=character(0),  Delta_growth=numeric(0))
uniquedelta <- unique(Predictedplantsizedrought_normalized26$ID)
for (val in uniquedelta) {
deltadf <- Predictedplantsizedrought_normalized26 %>% filter(Predictedplantsizedrought_normalized26)
daysdelta <- unique(deltadf$time)
daysdelta2 <- head(daysdelta, -1)
rm(deltaIDdf)
deltaIDdf <- data.frame(time=numeric(0),  ID=character(0),  Genotype=character(0),  stress=character(0),  gene=character(0),  GT=character(0),  Delta_growth=numeric(0))
for (day in daysdelta2) {
time <- as.numeric(day) + 1
time2 <- time
deltaIDdf2 <- data.frame(time)
deltaIDdf2$ID <- val
deltaIDdf2$Genotype <- unique(deltadf$Genotype)
deltaIDdf2$stress <- unique(deltadf$stress)
deltaIDdf2$gene <- unique(deltadf$gene)
deltaIDdf2$GT <- unique(deltadf$GT)
d <- deltadf %>% filter(deltadf$time == day)
d <- d$predictedplantsize
d1 <- deltadf %>% filter(deltadf$time == (time2))
d1 <- d1$predictedplantsize
deltaIDdf2$Delta_growth <- (d1 - d)
deltaIDdf <- (rbind(deltaIDdf,deltaIDdf2))
}
delta_growth_drought_normalized26 <- rbind(delta_growth_drought_normalized26, deltaIDdf)
}
deltadf <- Predictedplantsizedrought_normalized26 %>% filter(Predictedplantsizedrought_normalized26)
deltadf <- Predictedplantsizedrought_normalized26 %>% filter(Predictedplantsizedrought_normalized26$ID == val)
for (val in uniquedelta) {
deltadf <- Predictedplantsizedrought_normalized26 %>% filter(Predictedplantsizedrought_normalized26$ID == val)
daysdelta <- unique(deltadf$time)
daysdelta2 <- head(daysdelta, -1)
rm(deltaIDdf)
deltaIDdf <- data.frame(time=numeric(0),  ID=character(0),  Genotype=character(0),  stress=character(0),  gene=character(0),  GT=character(0),  Delta_growth=numeric(0))
for (day in daysdelta2) {
time <- as.numeric(day) + 1
time2 <- time
deltaIDdf2 <- data.frame(time)
deltaIDdf2$ID <- val
deltaIDdf2$Genotype <- unique(deltadf$Genotype)
deltaIDdf2$stress <- unique(deltadf$stress)
deltaIDdf2$gene <- unique(deltadf$gene)
deltaIDdf2$GT <- unique(deltadf$GT)
d <- deltadf %>% filter(deltadf$time == day)
d <- d$predictedplantsize
d1 <- deltadf %>% filter(deltadf$time == (time2))
d1 <- d1$predictedplantsize
deltaIDdf2$Delta_growth <- (d1 - d)
deltaIDdf <- (rbind(deltaIDdf,deltaIDdf2))
}
delta_growth_drought_normalized26 <- rbind(delta_growth_drought_normalized26, deltaIDdf)
}
UniqueIDDelta <- unique(delta_growth_drought_normalized26$ID)
delta_growth_drought_normalized26$delta_delta <- 0
delta_delta_growth_drought_normalized26 <- delta_growth_drought_normalized26 %>% filter(delta_growth_drought_normalized26$time == "The_end_times")
for (val in UniqueIDDelta){
delta_growth_ID <- delta_growth_drought_normalized26 %>% filter(delta_growth_drought_normalized26$ID == val)
growth_27 <- delta_growth_ID %>% filter(delta_growth_ID$time == 27)
growth_28 <- delta_growth_ID %>% filter(delta_growth_ID$time == 28)
growth_27$delta_delta <-  growth_27$Delta_growth - growth_28$Delta_growth
delta_delta_growth_drought_normalized26 <- rbind(delta_delta_growth_drought_normalized26,growth_27)
}
uniqueTrait <- sort(unique(delta_delta_growth_drought_normalized26$Genotype))
rm(delta_delta_growth_drought_export_normalized26)
delta_delta_growth_drought_export_normalized26 <- as.data.frame(sort(uniqueTrait))
for (val in uniqueTrait){
delta_delta_growth_drought_Genotype <- delta_delta_growth_drought_normalized26 %>% filter(delta_delta_growth_drought_normalized26$Genotype == val)
delta_delta_growth_drought_Genotype <- as.data.frame(delta_delta_growth_drought_Genotype$delta_delta)
colnames(delta_delta_growth_drought_Genotype) <- c(val)
delta_delta_growth_drought_export_normalized26 <- cbind.fill(delta_delta_growth_drought_export_normalized26,delta_delta_growth_drought_Genotype)
delta_delta_growth_drought_export_normalized26 <- as.data.frame(delta_delta_growth_drought_export_normalized26)
}
setwd("D:/phd doc/surfdrive/Documents/phenotyping_platform/compiled_data/graphs2/predicted_PlantSurfaceArea")
#write.csv(delta_delta_growth_drought_export_normalized26, 'delta_delta_growth_drought_export__normalized26_GT.csv')
write.csv(delta_delta_growth_drought_export_normalized26, 'delta_delta_growth_drought_export_normalized_26_genotype.csv')
uniqueTrait <- sort(unique(delta_delta_growth_drought_normalized26$GT))
rm(delta_delta_growth_drought_export_normalized26)
delta_delta_growth_drought_export_normalized26 <- as.data.frame(sort(uniqueTrait))
for (val in uniqueTrait){
delta_delta_growth_drought_GT <- delta_delta_growth_drought_normalized26 %>% filter(delta_delta_growth_drought_normalized26$GT == val)
delta_delta_growth_drought_GT <- as.data.frame(delta_delta_growth_drought_GT$delta_delta)
colnames(delta_delta_growth_drought_GT) <- c(val)
delta_delta_growth_drought_export_normalized26 <- cbind.fill(delta_delta_growth_drought_export_normalized26,delta_delta_growth_drought_GT)
delta_delta_growth_drought_export_normalized26 <- as.data.frame(delta_delta_growth_drought_export_normalized26)
}
write.csv(delta_delta_growth_drought_export_normalized26, 'delta_delta_growth_drought_export__normalized26_GT.csv')
View(duringdroughtsizenormalized)
#####################################################################################################
#Relative growth during and after growth
################################################################################################
view(Predictedplantsizedrought)
view(seeds)
View(seeds)
View(dat)
View(dat)
germtime <- dat %>% filter(dat$Trait == "germinationtime")
View(germtime)
sowtimetime <- dat %>% filter(dat$Trait == "rMean")
germtime2 <- merge(germtime, sowtimetime, by="ShootIDs", all = T)
View(germtime2)
germtime2$germinationtime <- as.POSIXct(as.numeric(germtime2$Value.x), origin = "1970-01-01", tz = "CET")
germtime2$sowtime <- as.POSIXct(as.numeric(germtime2$MeasurementDate.y), origin = "1970-01-01", tz = "CET")
germtime2$sowtime <- as.POSIXct(as.numeric(germtime2$MeasurementDate.y), origin = "1970-01-01", tz = "CET")
germtime2$germinationage <- germtime2$germinationtime - germtime$sowtime
germtime2$germinationage <- germtime2$germinationtime - germtime2$sowtime
for (val in unique(germtime2$GT)) {
germtemp <- germtime2 %>% filter(germtime2$GT == val)
germtemp <- as.data.frame(germtemp$germinationage)
colnames(germtemp) <- c(val)
germtime3 <- cbind.fill(germtime3, germtemp)
}
for (val in unique(germtime2$GT)) {
germtemp <- germtime2 %>% filter(germtime2$GT.x == val)
germtemp <- as.data.frame(germtemp$germinationage)
colnames(germtemp) <- c(val)
germtime3 <- cbind.fill(germtime3, germtemp)
}
for (val in unique(germtime2$GT.x)) {
germtemp <- germtime2 %>% filter(germtime2$GT.x == val)
germtemp <- as.data.frame(germtemp$germinationage)
colnames(germtemp) <- c(val)
germtime3 <- cbind.fill(germtime3, germtemp)
}
germtime3 <- germtemp
for (val in unique(germtime2$GT.x)) {
germtemp <- germtime2 %>% filter(germtime2$GT.x == val)
germtemp <- as.data.frame(germtemp$germinationage)
colnames(germtemp) <- c(val)
germtime3 <- cbind.fill(germtime3, germtemp)
}
View(germtime3)
######################################################################################################
###########################################################################################################
#Germination rate
#####
setwd("D:/phd doc/surfdrive/Documents/phenotyping_platform/compiled_data/germination")
write.csv(germtime3, 'GerminationtimesGType.csv')
for (val in sort(unique(germtime2$GT.x))) {
germtemp <- germtime2 %>% filter(germtime2$GT.x == val)
germtemp <- as.data.frame(germtemp$germinationage)
colnames(germtemp) <- c(val)
germtime3 <- cbind.fill(germtime3, germtemp)
}
write.csv(germtime3, 'GerminationtimesGType.csv')
for (val in sort(unique(germtime2$Genotype.x))) {
germtemp <- germtime2 %>% filter(germtime2$GT.x == val)
germtemp <- as.data.frame(germtemp$germinationage)
colnames(germtemp) <- c(val)
germtime3 <- cbind.fill(germtime3, germtemp)
}
write.csv(germtime3, 'GerminationtimesGenotype.csv')
rm(germtime3)
germtime3 <- germtemp
for (val in sort(unique(germtime2$Genotype.x))) {
germtemp <- germtime2 %>% filter(germtime2$Genotype.x == val)
germtemp <- as.data.frame(germtemp$germinationage)
colnames(germtemp) <- c(val)
germtime3 <- cbind.fill(germtime3, germtemp)
}
write.csv(germtime3, 'GerminationtimesGenotype.csv')
rm(germtime3)
germtime3 <- germtemp
for (val in sort(unique(germtime2$GT.x))) {
germtemp <- germtime2 %>% filter(germtime2$GT.x == val)
germtemp <- as.data.frame(germtemp$germinationage)
colnames(germtemp) <- c(val)
germtime3 <- cbind.fill(germtime3, germtemp)
}
write.csv(germtime3, 'GerminationtimesGT.csv')
source('D:/phd doc/surfdrive/Documents/phenotyping_platform/compiled_data/Phenotyping platform data.R')
