Data processing pipeline for Experiment 95 data collected on Crop Reporter camera within BTI’s PhenoSight facility.
list.files()
## [1] "Exp00089_ExpDesign.tsv" "Exp00089_Pipeline.html"
## [3] "Exp00089_Pipeline.nb.html" "Exp00089_Pipeline.Rmd"
## [5] "Exp00089_plots.pdf" "Exp00089_PS2_Analysis_new.TXT"
## [7] "Exp00089_PS2_Analysis.TXT" "Exp00092_ExpDesign.tsv"
## [9] "Exp00092_Pipeline.html" "Exp00092_Pipeline.Rmd"
## [11] "Exp00092_plots.pdf" "Exp00092_PS_analysis.TXT"
## [13] "Exp00092_PS2_Analysis_new.TXT" "Exp00094_ExpDesign.tsv"
## [15] "Exp00094_Pipeline.html" "Exp00094_Pipeline.Rmd"
## [17] "Exp00094_plots.pdf" "Exp00094_PS2_Analysis_clean.TXT"
## [19] "Exp00094_PS2_Analysis_new.TXT" "Exp00095_Analysis_new.TXT"
## [21] "Exp00095_ExpDesign.tsv" "Exp00095_Pipeline.Rmd"
## [23] "Exp00095_plots.pdf" "Exp00095_PS2_Analysis_clean.TXT"
## [25] "Exp00096_ExpDesign.tsv" "Exp00096_Pipeline.html"
## [27] "Exp00096_Pipeline.Rmd" "Exp00096_plots.pdf"
## [29] "Exp00096_PS2_Analysis_clean.TXT" "Exp00096_PS2_Analysis_new.TXT"
## [31] "Exp010098_ExpDesign.tsv" "Exp010098_Pipeline.html"
## [33] "Exp010098_Pipeline.Rmd" "Exp010098_plots.pdf"
## [35] "Exp010098_PS2_Analysis_clean.TXT" "Exp010098_PS2_Analysis_new.TXT"
## [37] "Exp010099_ExpDesign.tsv" "Exp010099_Pipeline.html"
## [39] "Exp010099_Pipeline.Rmd" "Exp010099_plots.pdf"
## [41] "Exp010099_PS2_Analysis_clean.TXT" "Exp010099_PS2_Analysis_new.TXT"
## [43] "Exp010100_ExpDesign.tsv" "Exp010100_Pipeline.html"
## [45] "Exp010100_Pipeline.Rmd" "Exp010100_plots.pdf"
## [47] "Exp010100_PS2_Analysis_clean.TXT" "Exp010100_PS2_Analysis_new.TXT"
## [49] "Exp010102_ExpDesign.tsv" "Exp010102_Pipeline.html"
## [51] "Exp010102_Pipeline.Rmd" "Exp010102_plots.pdf"
## [53] "Exp010102_PS2_Analysis_clean.TXT" "Exp010102_PS2_Analysis_new.TXT"
## [55] "Exp010103_ExpDesign.tsv" "Exp010103_Pipeline.html"
## [57] "Exp010103_Pipeline.Rmd" "Exp010103_plots.pdf"
## [59] "Exp010103_PS2_Analysis_clean.TXT" "Exp010103_PS2_Analysis_new.TXT"
## [61] "Exp010104_ExpDesign.tsv" "Exp010104_Pipeline.html"
## [63] "Exp010104_Pipeline.Rmd" "Exp010104_plots.pdf"
## [65] "Exp010104_PS2_Analysis_clean.TXT" "Exp010104_PS2_Analysis_new.TXT"
## [67] "Exp010105_ExpDesign.tsv" "Exp010105_Pipeline.html"
## [69] "Exp010105_Pipeline.Rmd" "Exp010105_plots.pdf"
## [71] "Exp010105_PS2_Analysis_clean.TXT" "Exp010105_PS2_Analysis_new.TXT"
## [73] "Exp010108_ExpDesign.tsv" "Exp010108_PS2_Analysis_clean.TXT"
## [75] "Exp010109_ExpDesign.tsv" "Exp010109_PS2_Analysis_clean.TXT"
## [77] "Exp010111_PS2_Analysis_clean.TXT" "Exp010113_PS2_Analysis.TXT"
## [79] "Exp010134_ExpDesign.tsv" "Exp010134_PS2_Analysis.TXT"
## [81] "Exp010136_ExpDesign.tsv" "Exp010136_PS2_Analysis.TXT"
## [83] "Exp010190A_PS2_Analysis_clean.TXT" "Exp010190B_PS2_Analysis.TXT"
## [85] "Exp010190C_PS2_Analysis_clean.TXT" "Exp010191_ExpDesign.txt"
## [87] "Exp010191_PS2_Analysis_new.TXT" "Exp10214_PS2_Analysis_clean.TXT"
## [89] "Exp10215_PS2_Analysis_clean.TXT" "Exp10217_PS2_Analysis.TXT"
## [91] "Exp10218_PS2_Analysis.TXT" "rsconnect"
#install.packages("data.table")
library(data.table)
## Warning: package 'data.table' was built under R version 4.3.3
data <- fread("Exp00095_PS2_Analysis_clean.TXT", sep = "\t")
data
colnames(data)
## [1] "File" "Date" "Time" "Obj.No"
## [5] "nTmPam" "Obj.Size" "Obj.Xc" "Obj.Yc"
## [9] "Fv/Fm" "s.d." "Fq'/Fm'" "s.d."
## [13] "NPQ" "s.d." "F0'" "s.d."
## [17] "qP" "s.d." "qN" "s.d."
## [21] "qL" "s.d." "qE" "s.d."
## [25] "qI" "s.d." "фno" "s.d."
## [29] "фnpq" "s.d." "npq(t)" "s.d."
## [33] "ChlIdx" "s.d." "AriIdx" "s.d."
## [37] "NDVI" "s.d." "Border" "Mask/Border"
## [41] "Points" "Area (CH)" "Mask/Area (CH)" "X-Centre"
## [45] "Y-Centre" "Radius" "Area (MC)" "Mask/Area (MC)"
## [49] "Width" "Height" "Area (MR)" "Mask/Area (MR)"
## [53] "Alpha" "Size (SK)" "Junction (SK)" "Endpoint (SK)"
## [57] "Path (SK)" "V58"
PS <- subset(data, data$Obj.No == "All")
PS
PS2 <- PS[,c(1:4, 6, 9, 11, 33, 35, 37)]
PS2
for(i in 1:nrow(PS2)){
PS2$PhenoTray.ID[i] <- strsplit(PS2$File[i], "_")[[1]][3]
}
length(unique(PS2$PhenoTray.ID))
## [1] 8
for(i in 1:nrow(PS2)){
PS2$month <- substr(PS2$Date, 5, 6)
PS2$day <- substr(PS2$Date, 7, 8)
PS2$hour <- substr(PS2$Time, 1, 2)
}
PS2
unique(PS2$month)
## [1] "03" "04"
temp <- subset(PS2, PS2$month == "03")
min(temp$day)
## [1] "17"
temp <- subset(temp, temp$day == "17")
min(temp$hour)
## [1] "14"
PS2$cum.days <- 0
for(i in 1:nrow(PS2)){
if(PS2$month[i] == "03"){
PS2$cum.days[i] <- 0}
if(PS2$month[i] == "04"){
PS2$cum.days[i] <- 31}
}
PS2
so first day of the experiment is March 17 and the measurements are starting around 14:00.
Let’s calculate Time of Experiment (TOE).
PS2$TOE <- (as.numeric(as.character(PS2$day)) - 17)*24 + (PS2$cum.days*24) + (as.numeric(as.character(PS2$hour)) - 14)
unique(PS2$TOE)
## [1] 108 170 174 178 182 186 189 194 204 216 0 362 372 384 404 426 459 24 31
## [20] 36 48 60 91 94 190 427 92
PS2
PS4 <- PS2[,c(1:4, 11, 16, 5:10)]
PS4
There are still some odd things in the column names - that I would like to straighten out:
colnames(PS4)[8] <- "Fv.Fm"
colnames(PS4)[9] <- "Fq.Fm"
PS4
PS4 <- na.omit(PS4)
unique(PS4$PhenoTray.ID)
## [1] "24739" "24740" "24741" "24742" "24743" "24744" "24745" "24746"
write.table(PS4, file = "Exp00095_Analysis_new.TXT", sep="\t", row.names = F)
#install.packages("ggplot2")
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.3.3
PS5 <- subset(PS4, PS4$Fv.Fm > 0)
FvFm_graph <- ggplot(data=PS5, aes(x= TOE, y=Fv.Fm, group = PhenoTray.ID))
FvFm_graph <- FvFm_graph + geom_line(alpha = 0.7)
FvFm_graph <- FvFm_graph + ylab("Fv/Fm") + xlab("Hours of Imaging")
FvFm_graph
PS5 <- subset(PS4, PS4$Fq.Fm > 0)
FqFm_graph <- ggplot(data=PS5, aes(x= TOE, y=Fq.Fm, group = PhenoTray.ID))
FqFm_graph <- FqFm_graph + geom_line(alpha = 0.7)
FqFm_graph <- FqFm_graph + ylab("Fq/Fm") + xlab("Hours of Imaging")
FqFm_graph
ChlIdx_graph <- ggplot(data=PS4, aes(x= TOE, y=ChlIdx, group = PhenoTray.ID))
ChlIdx_graph <- ChlIdx_graph + geom_line(alpha = 0.7)
ChlIdx_graph <- ChlIdx_graph + ylab("ChlIdx") + xlab("Hours of Imaging")
ChlIdx_graph
AriIdx_graph <- ggplot(data=PS4, aes(x= TOE, y=AriIdx, group = PhenoTray.ID))
AriIdx_graph <- AriIdx_graph + geom_line(alpha = 0.7)
AriIdx_graph <- AriIdx_graph + ylab("AriIdx") + xlab("Hours of Imaging")
AriIdx_graph
NDVI_graph <- ggplot(data=PS4, aes(x= TOE, y=NDVI, group = PhenoTray.ID))
NDVI_graph <- NDVI_graph + geom_line(alpha = 0.7)
NDVI_graph <- NDVI_graph + ylab("NDVI") + xlab("Hours of Imaging")
NDVI_graph
library(cowplot)
pdf("Exp00095_plots.pdf", height = 10, width = 7)
plot_grid(FvFm_graph, FqFm_graph, NDVI_graph, AriIdx_graph, ChlIdx_graph, labels = "AUTO", ncol = 2)
dev.off()
## quartz_off_screen
## 2