This notebook contains code for the EVT, FW, DW, WC analysis of cowpea phenotyping screen #6.
list.files(pattern = ".csv")
## [1] "EVT_exp6.csv" "exp6_FWDWWC.csv" "exp6_photosynq.csv"
## [4] "Pot_Geno_exp6.csv"
EVT_exp6 <- read.csv("EVT_exp6.csv")
EVT_exp6
library("ggplot2")
library("reshape2")
library("cowplot")
library("ggpubr")
##
## Attaching package: 'ggpubr'
## The following object is masked from 'package:cowplot':
##
## get_legend
melt6_EVT <- melt(EVT_exp6, id.vars = c("Pot.number", "Genotype", "Treatment"))
colnames(melt6_EVT)[4] <- "Day"
colnames(melt6_EVT)[5] <- "Evapotranspiration"
melt6_EVT$Day <- gsub("Day", "", melt6_EVT$Day)
melt6_EVT$Day <- as.numeric(melt6_EVT$Day)
unique(melt6_EVT$Treatment)
## [1] "Control " "Drought" "Control"
melt6_EVT$Treatment <- gsub("Control ", "Control", melt6_EVT$Treatment)
melt6_EVT$Evapotranspiration <- as.numeric(melt6_EVT$Evapotranspiration)
#Omit NA and negative values
melt6_EVTb <- na.omit(melt6_EVT, c("Evapotranspiration"))
melt6_EVTneg <- subset(melt6_EVTb, melt6_EVTb$Evapotranspiration < 0)
#There are 2 points with a negative EVT. Pot 138 d1, pot 139 d1. Arduino system recorded a higher weight when watering Before7.8 than After7.7. This is most likely a glitch in the system and these points will be removed.
melt6_EVTc <- subset(melt6_EVTb, melt6_EVTb$Evapotranspiration >= 0)
#write.csv(melt6_EVTc, "EVT_exp6_melted.csv", row.names = TRUE)
###Plotting of EVT over time
melt6_EVTc$Pot.number <- as.numeric(melt6_EVTc$Pot.number)
EVT6_over_time <- ggplot(data = melt6_EVTc, aes(x = Day, y = Evapotranspiration, group = Pot.number, colour = Treatment), na.rm = TRUE) + theme_classic() + ylim(0, NA)
EVT6_over_time <- EVT6_over_time + geom_line(alpha = 0.1)
EVT6_over_time <- EVT6_over_time + stat_summary(fun.data = mean_se, linetype = 0, aes(group = Treatment), alpha = 0.3) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "dashed")
EVT6_over_time <- EVT6_over_time + facet_wrap(~ Treatment)
EVT6_over_time <- EVT6_over_time + ylab("Evapotranspiration (g)") + xlab("Day") + rremove("legend")
EVT6_over_time
melt6_EVTc$Day <- as.factor(melt6_EVTc$Day)
EVT6_graph_cd <- ggplot(data = melt6_EVTc, aes(x = Day, y = Evapotranspiration, group = Pot.number, colour = Treatment), na.rm = TRUE) + theme_classic() + ylim(0, NA)
EVT6_graph_cd <- EVT6_graph_cd + geom_line(alpha = 0.1)
EVT6_graph_cd <- EVT6_graph_cd + stat_summary(fun.data = mean_se, geom = "ribbon", linetype = 0, aes(group = Treatment), alpha = 0.1) + stat_summary(fun = mean, aes(group = Treatment), size = 0.7, geom = "line", linetype = "dashed")
EVT6_graph_cd <- EVT6_graph_cd + stat_compare_means(aes(group = Treatment), label = "p.signif", method = "t.test", hide.ns = TRUE)
EVT6_graph_cd <- EVT6_graph_cd + scale_color_manual(labels=c("Control", "Drought"), values=c("blue", "red"))
EVT6_graph_cd <- EVT6_graph_cd + ylab("Evapotranspiration (g)") + xlab("Day")
EVT6_graph_cd
###FW_DW_WC boxplots
list.files(pattern = ".csv")
## [1] "EVT_exp6.csv" "exp6_FWDWWC.csv" "exp6_photosynq.csv"
## [4] "Pot_Geno_exp6.csv"
fw_dw_exp6 <- read.csv("exp6_FWDWWC.csv")
fw_dw_exp6$FW <- as.numeric(fw_dw_exp6$FW)
fw_dw_exp6$DW <- as.numeric(fw_dw_exp6$DW)
fw_dw_exp6$WC <- as.numeric(fw_dw_exp6$WC)
FW6_by_treatment <- ggboxplot(fw_dw_exp6, x="Treatment", y="FW", add="jitter")
FW6_by_treatment <- FW6_by_treatment + theme(axis.text.x = element_text(angle = 90))
FW6_by_treatment
DW6_by_treatment <- ggboxplot(fw_dw_exp6, x="Treatment", y="DW", add="jitter")
DW6_by_treatment <- DW6_by_treatment + theme(axis.text.x = element_text(angle = 90))
DW6_by_treatment
WC6_by_treatment <- ggboxplot(fw_dw_exp6, x="Treatment", y="WC", add="jitter")
WC6_by_treatment <- WC6_by_treatment + theme(axis.text.x = element_text(angle = 90))
WC6_by_treatment