daysdelta2 <- head(daysdelta, -20)
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 <- day + 1
moment <- day+1
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 == moment)
d1 <- d1$predictedplantsize
if (length(d1) == 0){
d1 <- "bleuh"
}
deltaIDdf2$d <- d
deltaIDdf2$d1 <- d1
tryCatch({
deltaIDdf <- (rbind(deltaIDdf,deltaIDdf2))
}, error=function(e){})
}
delta_growth_drought_more <- rbind(delta_growth_drought_more, deltaIDdf)
}
sapply(delta_growth_drought_more, colnames)
delta_growth_drought_more$d <- as.numeric(delta_growth_drought_more$d)
delta_growth_drought_more$d1 <- as.numeric(delta_growth_drought_more$d1)
delta_growth_drought_more$delta <- delta_growth_drought_more$d1 - delta_growth_drought_more$d
delta_growth_drought_more$delta_square <- delta_growth_drought_more$delta * delta_growth_drought_more$delta
rm(min_delta)
min_delta_drought <-data.frame(ID=character(0),  Genotype=character(0),  stress=character(0),  gene=character(0),  GT=character(0),  time=numeric(0))
uniqueMinDelta <- unique(delta_growth_drought_more$ID)
for (val in uniqueMinDelta) {
ID <- c(val)
minsizetemp <- delta_growth_drought_more %>% filter(delta_growth_drought_more$ID == val)
minsizetemp <- na.omit(minsizetemp)
mingrowth <- min(minsizetemp$delta_square)
minsizetemp <- minsizetemp %>% filter(minsizetemp$delta_square == mingrowth)
min_delta_drought <- rbind(min_delta_drought,minsizetemp)
}
ggplot(min_delta_drought,mapping = aes(color=gene, x = Genotype ,y=time)) +
geom_boxplot() +
theme(axis.text.x = element_text(angle = 90)) +
labs(
title = "when do plants stop growing"
)
#take out plants that are still growing -> all the plots with a positive Alpha
predictiondroughtduringcofficients_growing <- predictiondroughtduringcofficients %>% filter(predictiondroughtduringcofficients$cofficients == "alpha")
predictiondroughtduringcofficients_growing <- predictiondroughtduringcofficients_growing %>% filter(predictiondroughtduringcofficients_growing$Estimate > 0)
unique_predictiondroughtduringcofficients_growing <- unique(predictiondroughtduringcofficients_growing$ID)
min_delta_drought_filter <- min_delta_drought
for (val in unique_predictiondroughtduringcofficients_growing) {
min_delta_drought_filter <- min_delta_drought_filter %>% filter(min_delta_drought_filter$ID != val)
}
#take out plants that don't stop growing untill after the end of the experiment
min_delta_drought_filter1 <- min_delta_drought_filter %>% filter(min_delta_drought_filter$time < 38)
ggplot(min_delta_drought_filter,mapping = aes(color=gene, x = Genotype ,y=time)) +
geom_boxplot() +
theme(axis.text.x = element_text(angle = 90)) +
labs(
title = "Timepoint at which growth becomes closest to 0"
)
ggplot(min_delta_drought_filter1,mapping = aes(color=gene, x = Genotype,y=time)) +
geom_violin() +
theme(axis.text.x = element_text(angle = 90)) +
labs(
title = "Timepoint at which growth becomes closest to 0"
)
min_delta_drought_filter1_summery <- min_delta_drought_filter1 %>%
group_by(Genotype, stress) %>%
summarise(
mean = mean(time, na.rm = TRUE),
sd = sd(time, na.rm = TRUE),
se = sd / 2^0.5
)
write.csv(min_delta_drought_filter1_summery,'min_delta_drought_filter1_summery.csv')
#####
#Plant biomass
#####
disconnectedplantpart %>%
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"
)
#there are a bunch of dried plants that have triple measurements and are way to big. By filtering these can be (exactly) removed
disconnectedplantpart2 <- disconnectedplantpart %>%
filter(disconnectedplantpart$Value < 0.0011)
disconnectedplantpart2 <- disconnectedplantpart2 %>%
filter(disconnectedplantpart2$Value > 0.0000005)
hist(disconnectedplantpart2$Value, breaks = "sturges")
disconnectedplantpart_small <- as.data.frame(disconnectedplantpart2$ID)
disconnectedplantpart_small <- disconnectedplantpart_small %>%
rename(
"ID" = "disconnectedplantpart2$ID"
)
disconnectedplantpart_small$ShootIDs <- disconnectedplantpart2$ShootIDs
disconnectedplantpart_small$Trait <- disconnectedplantpart2$Trait
disconnectedplantpart_small$Value <- disconnectedplantpart2$Value
Disconnect_dry <- disconnectedplantpart_small %>% filter(Trait == "dry weight")
disconnectedplantpart_small$GT <- disconnectedplantpart2$GT
disconnectedplantpart_small$gene <- disconnectedplantpart2$gene
disconnectedplantpart_small$Genotype <- disconnectedplantpart2$Genotype
disconnectedplantpart_small$Treatments <- disconnectedplantpart2$Treatments
disconnectedplantpart_small$MeasurementDate_das <- disconnectedplantpart2$MeasurementDate_das
Disconnect_fresh <- disconnectedplantpart_small %>% filter(Trait == "fresh weight")
disconnectedplantpart_small2 <- merge(Disconnect_fresh, Disconnect_dry, by = "ID")
disconnectedplantpart_small2 <- disconnectedplantpart_small2 %>%
rename(
"dry_weight" = "Value.y",
"fresh_weight" = "Value.x"
)
disconnectedplantpart_small2$Trait.x <- NULL
disconnectedplantpart_small2$Trait.y <- NULL
disconnectedplantpart_small2$ShootIDs.y <- NULL
disconnectedplantpart_small2 <- disconnectedplantpart_small2 %>%
rename(
"ShootIDs" = "ShootIDs.x",
)
fresh weight
dry weigh
control fresh weig
control dry
#####
#size and weight linear dependend?
#####
Predictdroughtday42 <- Predictedplantsizedrought %>% filter(time == "42")
disconnectVSpredict <- merge(disconnectedplantpart_small2,Predictdroughtday42, by="ShootIDs")
ggplot(disconnectVSpredict,mapping = aes(color=GT.x, x = dry_weight ,y=predictedplantsize)) +
geom_point() +
labs(
title = "growth per day OEs all days"
)
#####
#Germination rate
#####
germtime <- dat %>% filter(dat$Trait == "germinationtime")
germtime790 <- germtime %>% filter(germtime$ExperimentID == "790")
germtime812 <- germtime %>% filter(germtime$ExperimentID == "812")
germtime2 <- subset(germtime, select=c("GT", "MeasurementDate_das"))
germtime2 <- germtime2 %>% spread(GT, MeasurementDate_das)
#manually make a germtime3
for (val in unique(germtime2$GT)) {
germtemp <- germtime2 %>% filter(germtime2$GT == val)
germtemp <- as.data.frame(germtemp$MeasurementDate_das)
colnames(germtemp) <- c(val)
germtime3 <- qpcR:::cbind.na(germtime3, germtemp)
}
write.csv(germtime3, 'GerminationtimesGType.csv')
germtime %>%
group_by(GT, gene) %>%
summarise(
mean = mean(MeasurementDate_das, na.rm = TRUE),
sd = sd(MeasurementDate_das, na.rm = TRUE),
se = sd / 2^0.5
) %>%
ggplot(germtime,mapping = aes(color=gene, x = GT,y=mean)) +
geom_point() +
geom_errorbar(aes(ymin = mean - se, ymax = mean + se),) +
labs(
title = "growth per day OEs all days"
)
#####
#plantPerimeter_mm
#####
#PlantSize3 <- PlantSize3 %>% filter(PlantSize3$ExperimentID == 812)
PlantSize3_OE <- PlantSize3 %>% filter(PlantSize3$gene == "WT" | PlantSize3$gene == "OE")
PlantSize3_Tissue <- PlantSize3 %>% filter(PlantSize3$gene == "WT" | PlantSize3$gene == "Tissue")
PlantSize3_KO <- PlantSize3 %>% filter(PlantSize3$gene == "WT" | PlantSize3$gene == "KO")
#Plant4 <- Plant4 %>% filter(Plant4$ExperimentID == 812)
Plant4_OE <- Plant4 %>% filter(Plant4$gene == "WT" | Plant4$gene == "OE")
Plant4_Tissue <- Plant4 %>% filter(Plant4$gene == "WT" | Plant4$gene == "Tissue")
Plant4_KO <- Plant4 %>% filter(Plant4$gene == "WT" | Plant4$gene == "KO")
setwd("D:/phd doc/surfdrive/Documents/phenotyping_platform/compiled_data/graphs/812/plantPerimeter")
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantStockiness > 0.0001, PlantSize3_OE$stress == "drought")%>%
group_by(MeasurementDate_das,gene, GT,stress) %>%
summarise(mean = mean(plantStockiness, na.rm = TRUE), sd = sd(plantStockiness, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_rect(aes(xmin = 25, xmax = 38, ymin = -Inf, ymax = Inf),fill = "light grey", alpha = 0.03)+
geom_line(aes(linetype=GT, color=GT),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,2))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
geom_point(aes(shape=GT, color=GT, size=GT))+
scale_shape_manual(values=c(19,19,19,19,19,19,19))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantPerimeter (mm)") +labs(title = "plantPerimeter")
ggsave("plantPerimeterGT_OE_drought_no_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantStockiness > 0.0001, PlantSize3_OE$stress == "control")%>%
group_by(MeasurementDate_das,gene, GT,stress) %>%
summarise(mean = mean(plantStockiness, na.rm = TRUE), sd = sd(plantStockiness, na.rm = TRUE), se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_line(aes(linetype=GT, color=GT),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,2))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
geom_point(aes(shape=GT, color=GT, size=GT))+
scale_shape_manual(values=c(19,19,19,19,19,19,19))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2))+
theme_bw() +theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantPerimeter (mm)") +labs(title = "plantPerimeter")
ggsave("plantPerimeterGT_OE_control_no_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantStockiness > 0.0001, PlantSize3_OE$stress == "drought")%>%
group_by(MeasurementDate_das,gene, GT,stress) %>%
summarise(mean = mean(plantStockiness, na.rm = TRUE), sd = sd(plantStockiness, na.rm = TRUE), se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_rect(aes(xmin = 25, xmax = 38, ymin = -Inf, ymax = Inf),fill = "light grey", alpha = 0.03)+
geom_errorbar(aes(ymin = mean - se, ymax = mean + se,color=GT)) +
geom_line(aes(linetype=GT, color=GT),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,2))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
geom_point(aes(shape=GT, color=GT, size=GT))+
scale_shape_manual(values=c(19,19,19,19,19,19,19))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2))+
theme_bw() +  theme(legend.title = element_blank())+
xlab("DAS") + ylab("PlantSurfaceArea(mm2)") +labs(title = "PlantSurfaceArea")
ggsave("plantPerimeterGT_OE_drought_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantStockiness > 0.0001, PlantSize3_OE$stress == "control")%>%
group_by(MeasurementDate_das,gene, GT,stress) %>%
summarise(mean = mean(plantStockiness, na.rm = TRUE), sd = sd(plantStockiness, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_errorbar(aes(ymin = mean - se, ymax = mean + se,color=GT)) +
geom_line(aes(linetype=GT, color=GT),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,2))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
geom_point(aes(shape=GT, color=GT, size=GT))+
scale_shape_manual(values=c(19,19,19,19,19,19,19))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2))+
theme_bw() +  theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantPerimeter (mm)") +labs(title = "plantPerimeter")
ggsave("plantPerimeterGT_OE_control_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantStockiness > 0.0001, PlantSize3_OE$stress == "drought")%>%
group_by(MeasurementDate_das,gene, Genotype,stress) %>%
summarise(mean = mean(plantStockiness, na.rm = TRUE), sd = sd(plantStockiness, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_rect(aes(xmin = 25, xmax = 38, ymin = -Inf, ymax = Inf),fill = "light grey", alpha = 0.03)+
geom_line(aes(linetype=Genotype, color=Genotype),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,1,1,1,1,1,1,2,2))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
geom_point(aes(shape=Genotype, color=Genotype, size=Genotype))+
scale_shape_manual(values=c(19,1,19,1,19,1,19,1,19,1,19,1,19,1))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2,2,2,2,2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantPerimeter (mm)") +labs(title = "plantPerimeter")
ggsave("plantPerimeterGenotype_OE_drought_no_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantStockiness > 0.0001, PlantSize3_OE$stress == "control")%>%
group_by(MeasurementDate_das,gene, Genotype,stress) %>%
summarise(mean = mean(plantStockiness, na.rm = TRUE), sd = sd(plantStockiness, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_line(aes(linetype=Genotype, color=Genotype),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,1,1,1,1,1,1,2,2))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
geom_point(aes(shape=Genotype, color=Genotype, size=Genotype))+
scale_shape_manual(values=c(19,1,19,1,19,1,19,1,19,1,19,1,19,1))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2,2,2,2,2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantPerimeter (mm)") +labs(title = "plantPerimeter")
ggsave("plantPerimeterGenotype_OE_control_no_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantStockiness > 0.0001, PlantSize3_OE$stress == "drought")%>%
group_by(MeasurementDate_das,gene, Genotype,stress) %>%
summarise(mean = mean(plantStockiness, na.rm = TRUE), sd = sd(plantStockiness, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_rect(aes(xmin = 25, xmax = 38, ymin = -Inf, ymax = Inf),fill = "light grey", alpha = 0.03)+
geom_errorbar(aes(ymin = mean - se, ymax = mean + se,color=Genotype)) +
geom_line(aes(linetype=Genotype, color=Genotype),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,1,1,1,1,1,1,2,2))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
geom_point(aes(shape=Genotype, color=Genotype, size=Genotype))+
scale_shape_manual(values=c(19,1,19,1,19,1,19,1,19,1,19,1,19,1))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2,2,2,2,2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantPerimeter (mm)") +labs(title = "plantPerimeter")
ggsave("plantPerimeterGenotype_OE_drought_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantStockiness > 0.0001, PlantSize3_OE$stress == "control")%>%
group_by(MeasurementDate_das,gene, Genotype,stress) %>%
summarise(mean = mean(plantStockiness, na.rm = TRUE), sd = sd(plantStockiness, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_errorbar(aes(ymin = mean - se, ymax = mean + se,color=Genotype)) +
geom_line(aes(linetype=Genotype, color=Genotype),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,1,1,1,1,1,1,2,2))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
geom_point(aes(shape=Genotype, color=Genotype, size=Genotype))+
scale_shape_manual(values=c(19,1,19,1,19,1,19,1,19,1,19,1,19,1))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2,2,2,2,2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantPerimeter (mm)") +labs(title = "plantPerimeter")
ggsave("plantPerimeterGenotype_OE_control_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_Tissue  %>%
filter(PlantSize3_Tissue$MeasurementDate_das > 18,PlantSize3_Tissue$plantStockiness > 0.0001)%>%
group_by(MeasurementDate_das,gene, Genotype,stress) %>%
summarise(mean = mean(plantStockiness, na.rm = TRUE), sd = sd(plantStockiness, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_line(aes(linetype=Genotype, color=Genotype),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2))+
scale_color_manual(values=c('#a6cee3','#a6cee3','#a6cee3','#1f78b4','#1f78b4','#b2df8a','#b2df8a','#33a02c','#33a02c','#fb9a99','#fb9a99','#e31a1c','#e31a1c','#fdbf6f','#fdbf6f','#ff7f00','#ff7f00','#cab2d6','#cab2d6','#6a3d9a','#6a3d9a','#ffff99','#ffff99','#b15928','#b15928','#e6ab02','#e6ab02','#000000','#000000'))+
geom_point(aes(shape=Genotype, color=Genotype, size=Genotype))+
scale_shape_manual(values=c(19,1,2,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1))+
scale_color_manual(values=c('#a6cee3','#a6cee3','#a6cee3','#1f78b4','#1f78b4','#b2df8a','#b2df8a','#33a02c','#33a02c','#fb9a99','#fb9a99','#e31a1c','#e31a1c','#fdbf6f','#fdbf6f','#ff7f00','#ff7f00','#cab2d6','#cab2d6','#6a3d9a','#6a3d9a','#ffff99','#ffff99','#b15928','#b15928','#e6ab02','#e6ab02','#000000','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantPerimeter (mm)") +labs(title = "plantPerimeter")
ggsave("plantPerimeterGenotype_Tissue_no_errorbar.png", plot = last_plot(),width = 16, height =8)
PlantSize3_KO  %>%
filter(PlantSize3_KO$MeasurementDate_das > 18,PlantSize3_KO$plantStockiness > 0.0001)%>%
group_by(MeasurementDate_das,gene, Genotype,stress) %>%
summarise(mean = mean(plantStockiness, na.rm = TRUE), sd = sd(plantStockiness, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_line(aes(linetype=Genotype, color=Genotype),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,2,2))+
scale_color_manual(values=c('#1b9e77','#e6ab02','#000000','#000000'))+
geom_point(aes(shape=Genotype, color=Genotype, size=Genotype))+
scale_shape_manual(values=c(19,19,19,1))+
scale_color_manual(values=c('#1b9e77','#e6ab02','#000000','#000000'))+
scale_size_manual(values=c(2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantPerimeter (mm)") +labs(title = "plantPerimeter")
ggsave("plantPerimeterGenotype_KO_control_no_errorbar.png", plot = last_plot(),width = 7, height =5)
#####
#plantConvexHullArea_mm2
#####
setwd("D:/phd doc/surfdrive/Documents/phenotyping_platform/compiled_data/graphs/812/plantConvexHullArea")
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantConvexHullArea_mm2 > 0.0001, PlantSize3_OE$stress == "drought")%>%
group_by(MeasurementDate_das,gene, GT,stress) %>%
summarise(mean = mean(plantConvexHullArea_mm2, na.rm = TRUE), sd = sd(plantConvexHullArea_mm2, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_rect(aes(xmin = 25, xmax = 38, ymin = -Inf, ymax = Inf),fill = "light grey", alpha = 0.03)+
geom_line(aes(linetype=GT, color=GT),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,2))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
geom_point(aes(shape=GT, color=GT, size=GT))+
scale_shape_manual(values=c(19,19,19,19,19,19,19))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantConvexHullArea (mm2)") +labs(title = "plantConvexHullArea")
ggsave("plantConvexHullArea_GT_OE_drought_no_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantConvexHullArea_mm2 > 0.0001, PlantSize3_OE$stress == "control")%>%
group_by(MeasurementDate_das,gene, GT,stress) %>%
summarise(mean = mean(plantConvexHullArea_mm2, na.rm = TRUE), sd = sd(plantConvexHullArea_mm2, na.rm = TRUE), se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_line(aes(linetype=GT, color=GT),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,2))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
geom_point(aes(shape=GT, color=GT, size=GT))+
scale_shape_manual(values=c(19,19,19,19,19,19,19))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2))+
theme_bw() +theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantConvexHullArea (mm2)") +labs(title = "plantConvexHullArea")
ggsave("plantConvexHullArea_GT_OE_control_no_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantConvexHullArea_mm2 > 0.0001, PlantSize3_OE$stress == "drought")%>%
group_by(MeasurementDate_das,gene, GT,stress) %>%
summarise(mean = mean(plantConvexHullArea_mm2, na.rm = TRUE), sd = sd(plantConvexHullArea_mm2, na.rm = TRUE), se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_rect(aes(xmin = 25, xmax = 38, ymin = -Inf, ymax = Inf),fill = "light grey", alpha = 0.03)+
geom_errorbar(aes(ymin = mean - se, ymax = mean + se,color=GT)) +
geom_line(aes(linetype=GT, color=GT),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,2))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
geom_point(aes(shape=GT, color=GT, size=GT))+
scale_shape_manual(values=c(19,19,19,19,19,19,19))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2))+
theme_bw() +  theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantConvexHullArea (mm2)") +labs(title = "plantConvexHullArea")
ggsave("plantConvexHullArea_GT_OE_drought_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantConvexHullArea_mm2 > 0.0001, PlantSize3_OE$stress == "control")%>%
group_by(MeasurementDate_das,gene, GT,stress) %>%
summarise(mean = mean(plantConvexHullArea_mm2, na.rm = TRUE), sd = sd(plantConvexHullArea_mm2, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_errorbar(aes(ymin = mean - se, ymax = mean + se,color=GT)) +
geom_line(aes(linetype=GT, color=GT),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,2))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
geom_point(aes(shape=GT, color=GT, size=GT))+
scale_shape_manual(values=c(19,19,19,19,19,19,19))+
scale_color_manual(values=c('#1b9e77','#d95f02','#7570b3','#e7298a','#66a61e','#e6ab02','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2))+
theme_bw() +  theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantConvexHullArea (mm2)") +labs(title = "plantConvexHullArea")
ggsave("plantConvexHullArea_GT_OE_control_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantConvexHullArea_mm2 > 0.0001, PlantSize3_OE$stress == "drought")%>%
group_by(MeasurementDate_das,gene, Genotype,stress) %>%
summarise(mean = mean(plantConvexHullArea_mm2, na.rm = TRUE), sd = sd(plantConvexHullArea_mm2, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_rect(aes(xmin = 25, xmax = 38, ymin = -Inf, ymax = Inf),fill = "light grey", alpha = 0.03)+
geom_line(aes(linetype=Genotype, color=Genotype),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,1,1,1,1,1,1,2,2))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
geom_point(aes(shape=Genotype, color=Genotype, size=Genotype))+
scale_shape_manual(values=c(19,1,19,1,19,1,19,1,19,1,19,1,19,1))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2,2,2,2,2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantConvexHullArea (mm2)") +labs(title = "plantConvexHullArea")
ggsave("plantConvexHullArea_Genotype_OE_drought_no_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantConvexHullArea_mm2 > 0.0001, PlantSize3_OE$stress == "control")%>%
group_by(MeasurementDate_das,gene, Genotype,stress) %>%
summarise(mean = mean(plantConvexHullArea_mm2, na.rm = TRUE), sd = sd(plantConvexHullArea_mm2, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_line(aes(linetype=Genotype, color=Genotype),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,1,1,1,1,1,1,2,2))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
geom_point(aes(shape=Genotype, color=Genotype, size=Genotype))+
scale_shape_manual(values=c(19,1,19,1,19,1,19,1,19,1,19,1,19,1))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2,2,2,2,2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantConvexHullArea (mm2)") +labs(title = "plantConvexHullArea")
ggsave("plantConvexHullArea_Genotype_OE_control_no_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantConvexHullArea_mm2 > 0.0001, PlantSize3_OE$stress == "drought")%>%
group_by(MeasurementDate_das,gene, Genotype,stress) %>%
summarise(mean = mean(plantConvexHullArea_mm2, na.rm = TRUE), sd = sd(plantConvexHullArea_mm2, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_rect(aes(xmin = 25, xmax = 38, ymin = -Inf, ymax = Inf),fill = "light grey", alpha = 0.03)+
geom_errorbar(aes(ymin = mean - se, ymax = mean + se,color=Genotype)) +
geom_line(aes(linetype=Genotype, color=Genotype),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,1,1,1,1,1,1,2,2))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
geom_point(aes(shape=Genotype, color=Genotype, size=Genotype))+
scale_shape_manual(values=c(19,1,19,1,19,1,19,1,19,1,19,1,19,1))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2,2,2,2,2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantConvexHullArea (mm2)") +labs(title = "plantConvexHullArea")
ggsave("plantConvexHullArea_Genotype_OE_drought_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_OE  %>%
filter(PlantSize3_OE$MeasurementDate_das > 18,PlantSize3_OE$plantConvexHullArea_mm2 > 0.0001, PlantSize3_OE$stress == "control")%>%
group_by(MeasurementDate_das,gene, Genotype,stress) %>%
summarise(mean = mean(plantConvexHullArea_mm2, na.rm = TRUE), sd = sd(plantConvexHullArea_mm2, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_errorbar(aes(ymin = mean - se, ymax = mean + se,color=Genotype)) +
geom_line(aes(linetype=Genotype, color=Genotype),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,1,1,1,1,1,1,2,2))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
geom_point(aes(shape=Genotype, color=Genotype, size=Genotype))+
scale_shape_manual(values=c(19,1,19,1,19,1,19,1,19,1,19,1,19,1))+
scale_color_manual(values=c('#1b9e77','#1b9e77','#d95f02','#d95f02','#7570b3','#7570b3','#e7298a','#e7298a','#66a61e','#66a61e','#e6ab02','#e6ab02','#000000','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2,2,2,2,2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantConvexHullArea (mm2)") +labs(title = "plantConvexHullArea")
ggsave("plantConvexHullArea_Genotype_OE_control_errorbar.png", plot = last_plot(),width = 6, height =5)
PlantSize3_Tissue  %>%
filter(PlantSize3_Tissue$MeasurementDate_das > 18,PlantSize3_Tissue$plantConvexHullArea_mm2 > 0.0001)%>%
group_by(MeasurementDate_das,gene, Genotype,stress) %>%
summarise(mean = mean(plantConvexHullArea_mm2, na.rm = TRUE), sd = sd(plantConvexHullArea_mm2, na.rm = TRUE),se = sd / 2^0.5) %>%
ggplot(mapping = aes(x = MeasurementDate_das,y=mean)) +
geom_line(aes(linetype=Genotype, color=Genotype),size = 1)+
facet_wrap(~stress)+
scale_linetype_manual(values=c(1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2))+
scale_color_manual(values=c('#a6cee3','#a6cee3','#a6cee3','#1f78b4','#1f78b4','#b2df8a','#b2df8a','#33a02c','#33a02c','#fb9a99','#fb9a99','#e31a1c','#e31a1c','#fdbf6f','#fdbf6f','#ff7f00','#ff7f00','#cab2d6','#cab2d6','#6a3d9a','#6a3d9a','#ffff99','#ffff99','#b15928','#b15928','#e6ab02','#e6ab02','#000000','#000000'))+
geom_point(aes(shape=Genotype, color=Genotype, size=Genotype))+
scale_shape_manual(values=c(19,1,2,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1))+
scale_color_manual(values=c('#a6cee3','#a6cee3','#a6cee3','#1f78b4','#1f78b4','#b2df8a','#b2df8a','#33a02c','#33a02c','#fb9a99','#fb9a99','#e31a1c','#e31a1c','#fdbf6f','#fdbf6f','#ff7f00','#ff7f00','#cab2d6','#cab2d6','#6a3d9a','#6a3d9a','#ffff99','#ffff99','#b15928','#b15928','#e6ab02','#e6ab02','#000000','#000000'))+
scale_size_manual(values=c(2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2))+
theme_bw() + theme(legend.title = element_blank())+
xlab("DAS") + ylab("plantConvexHullArea (mm2)") +labs(title = "plantConvexHullArea")
ggsave("plantConvexHullArea_Genotype_Tissue_no_errorbar.png", plot = last_plot(),width = 16, height =8)
