Experiment description:

The plate assay was conducted by sterilizing the S. pimpinellifollium seeds with 50% bleach for 10 minutes and washing it 5x with sterile MQ water in the laminar hood.

The seeds were placed on an agar plate containing ¼ MS media, supplemented with 1% sucrose, 0.5% MES buffer (pH 5.8, KOH) and 1 % Dashin agar. The plates were placed at 4 C overnight. The seeds were germinated for 4 days in growth chamber set at 24C with 12h/12h dark/light cycle at 400 umol/m2/sec.

After 4 days of germination, the seedlings were transferred to control or salt (100 mM NaCl) containing plates (media composition same as germination media). The detailed procedure is described here.

The plates were scanned immediately after the transfer, and every 24h after until 7 days after transfer. The images from 0 - 4 days after transfer were analyzed with SmartRoot (Lobet et al. 2011), extracting the main root length, lateral root length, lateral root number, and the position of lateral roots along the main root axis. Based on the time-series data, for each plant, we estimated the growth rate of the main root, average lateral root, lateral root emergence rate by fitting the linear function to the increase of main root length, average lateral root length and number of lateral roots over time.

The list of all accessions screened and their distribution among six experimental batches can be found here. The decoding of the M000 codes (KAUST code) into the LA codes (Davis code) can be found here.

All of the csv files used in this analysis can be found in here.

file preparation

PimpBig experiment analysis - loading all of the data

setwd("/Users/magdalena/Dropbox_backup/DataAndAnalysis/Tomato/PimpiBIG csv raw files/")
list.files(pattern=".csv")
##  [1] "Big01to04_incl.PF.csv"                 
##  [2] "Big01to05_incl.PF.csv"                 
##  [3] "metadata.csv"                          
##  [4] "Pimp_pareto_RSA_for_GWAS.csv"          
##  [5] "Pimp_RSA_and_Pareto_clean.csv"         
##  [6] "Pimp_RSA_for_GWAS.csv"                 
##  [7] "PimpBig6_all_days.csv"                 
##  [8] "PimpBig6_d3oeps.csv"                   
##  [9] "pimpi_Big1_D0_D1.csv"                  
## [10] "pimpi_Big1_D1_D2.csv"                  
## [11] "pimpi_Big1_D2_D3.csv"                  
## [12] "pimpi_Big1_D4_D5.csv"                  
## [13] "pimpi_BIG2_arbor_stats.csv"            
## [14] "pimpi_Big2_D0_D1.csv"                  
## [15] "pimpi_Big2_D2_D3.csv"                  
## [16] "pimpi_Big2_D4_D5.csv"                  
## [17] "pimpi_Big2_manual-scoring-last-day.csv"
## [18] "pimpi_Big3_D0_D1.csv"                  
## [19] "pimpi_Big3_D2_D3.csv"                  
## [20] "pimpi_Big3_D3_D4.csv"                  
## [21] "pimpi_Big3_D4_D5.csv"                  
## [22] "pimpi_Big4_D0_D1.csv"                  
## [23] "pimpi_Big4_D0_FU.csv"                  
## [24] "pimpi_Big4_D0.csv"                     
## [25] "pimpi_Big4_D2_D3.csv"                  
## [26] "pimpi_Big4_D3_D4.csv"                  
## [27] "pimpi_Big4_D4_D5.csv"                  
## [28] "pimpi_Big5_all_days.csv"               
## [29] "sum_growth_pimp_all.csv"               
## [30] "sum_growth_pimp_thusfar.csv"
Big1_D0D1 <- read.csv("pimpi_Big1_D0_D1.csv")
Big1_D2D3 <- read.csv("pimpi_Big1_D2_D3.csv")
Big1_D4D5 <- read.csv("pimpi_Big1_D4_D5.csv")

Big2_D0D1 <- read.csv("pimpi_Big2_D0_D1.csv")
Big2_D2D3 <- read.csv("pimpi_Big2_D2_D3.csv")
Big2_D4D5 <- read.csv("pimpi_Big2_D4_D5.csv")

Big3_D0D1 <- read.csv("pimpi_Big3_D0_D1.csv")
Big3_D2D3 <- read.csv("pimpi_Big3_D2_D3.csv")
Big3_D4D5 <- read.csv("pimpi_Big3_D4_D5.csv")

Big4_D0D1 <- read.csv("pimpi_Big4_D0_D1.csv")
Big4_D0_FU <- read.csv("pimpi_Big4_D0_FU.csv")
Big4_D2D3 <- read.csv("pimpi_Big4_D2_D3.csv")
Big4_D4D5 <- read.csv("pimpi_Big4_D4_D5.csv")

Big5 <- read.csv("pimpi_Big5_all_days.csv")

Big6_all <- read.csv("PimpBig6_all_days.csv")
Big6_oeps <- read.csv("PimpBig6_d3oeps.csv")

head(Big4_D0D1)
head(Big4_D0_FU)
# Need to add this because otherwise we have images that are called exactly the same and it is causing problems later on 
Big4_D0_FU$image <- gsub(".rsml", "_FU.rsml", Big4_D0_FU$image)
head(Big4_D0_FU)
head(Big4_D2D3)
head(Big4_D4D5)

Let’s fuse all the files into one big file per experiment

Big1 <- rbind(Big1_D0D1, Big1_D2D3)
Big1 <- rbind(Big1, Big1_D4D5)

Big2 <- rbind(Big2_D0D1, Big2_D2D3)
Big2 <- rbind(Big2, Big2_D4D5)

Big3 <- rbind(Big3_D0D1, Big3_D2D3)
Big3 <- rbind(Big3, Big3_D4D5)

Big4 <- rbind(Big4_D0D1, Big4_D0_FU)
Big4 <- rbind(Big4, Big4_D2D3)
Big4 <- rbind(Big4, Big4_D4D5)

Big6 <- rbind(Big6_all, Big6_oeps)

Let’s make sure we have a collumn indicating the experimental batch as well:

Big1$experiment <- "Big01"
Big2$experiment <- "Big02"
Big3$experiment <- "Big03"
Big4$experiment <- "Big04"
Big5$experiment <- "Big05"
Big6$experiment <- "Big06"

There is an issue with the images from Big02 also being in Big04 - so we have to make sure that we have only images from particular experiment in there. So - we need to make a collumn for everyone with “date” to make sure we only have the following days

Big 1 experiment:

Big1$info <- strsplit(Big1$image, "_")
dim(Big1)
## [1] 8555   21
Big1$date <- "none"
for(i in 1:8555){
  Big1$date[i] <- sapply(Big1$info[i], function(x){
  x[4]})
}
unique(Big1$date)
## [1] "20190909" "20190910" "20190911" "20190912" "20190913"

Big 2 experiment:

Big2$info <- strsplit(Big2$image, "_")
dim(Big2)
## [1] 13695    21
Big2$date <- "none"
for(i in 1:13695){
  Big2$date[i] <- sapply(Big2$info[i], function(x){
  x[4]})
}
unique(Big2$date)
## [1] "20190923" "20190924" "20190926" "20190925" "20190927"

Big 3 experiment:

Big3$info <- strsplit(Big3$image, "_")
dim(Big3)
## [1] 13232    21
Big3$date <- "none"
for(i in 1:13232){
  Big3$date[i] <- sapply(Big3$info[i], function(x){
  x[4]})
}
unique(Big3$date)
## [1] "20190930" "20191001" "20191002" "20191003" "20191004"

Big 4 experiment:

Big4$info <- strsplit(Big4$image, "_")
dim(Big4)
## [1] 13346    21
Big4$date <- "none"
for(i in 1:13346){
  Big4$date[i] <- sapply(Big4$info[i], function(x){
  x[4]})
}
unique(Big4$date)
## [1] "20191009" "20191008" "20191010" "20191012" "20191011"

Big 5 experiment:

Big5$info <- strsplit(Big5$image, "_")
dim(Big5)
## [1] 10113    23
Big5$date <- "none"
for(i in 1:10113){
  Big5$date[i] <- sapply(Big5$info[i], function(x){
  x[4]})
}
unique(Big5$date)
## [1] "20191020" "20191023" "20191019" "20191021" "20191022"

Big 6 experiment:

Big6$info <- strsplit(Big6$image, "_")
dim(Big6)
## [1] 7371   23
Big6$date <- "none"
for(i in 1:7371){
  Big6$date[i] <- sapply(Big6$info[i], function(x){
  x[4]})
}
unique(Big6$date)
## [1] "20191101" "20191102" "20191103" "20191104" "20191105"

check if all is right

colnames(Big1)
##  [1] "image"                 "root_name"             "root"                 
##  [4] "length"                "surface"               "volume"               
##  [7] "diameter"              "root_order"            "root_ontology"        
## [10] "parent_name"           "parent"                "insertion_position"   
## [13] "insertion_angle"       "n_child"               "child_density"        
## [16] "first_child"           "insertion_first_child" "last_child"           
## [19] "insertion_last_child"  "experiment"            "info"                 
## [22] "date"
colnames(Big5)
##  [1] "image"                 "root_name"             "root"                 
##  [4] "length"                "vector_length"         "surface"              
##  [7] "volume"                "direction"             "diameter"             
## [10] "root_order"            "root_ontology"         "parent_name"          
## [13] "parent"                "insertion_position"    "insertion_angle"      
## [16] "n_child"               "child_density"         "first_child"          
## [19] "insertion_first_child" "last_child"            "insertion_last_child" 
## [22] "experiment"            "info"                  "date"
colnames(Big6)
##  [1] "image"                 "root_name"             "root"                 
##  [4] "length"                "vector_length"         "surface"              
##  [7] "volume"                "direction"             "diameter"             
## [10] "root_order"            "root_ontology"         "parent_name"          
## [13] "parent"                "insertion_position"    "insertion_angle"      
## [16] "n_child"               "child_density"         "first_child"          
## [19] "insertion_first_child" "last_child"            "insertion_last_child" 
## [22] "experiment"            "info"                  "date"
dim(Big5)
## [1] 10113    24
dim(Big6)
## [1] 7371   24
Big5 <- Big5[,c(1:4,6:7,9:24)]
Big6 <- Big6[,c(1:4,6:7,9:24)]

Now we can fuse all the data into one:

all_data <- rbind(Big1, Big2)
all_data <- rbind(all_data, Big3)
all_data <- rbind(all_data, Big4)
all_data <- rbind(all_data, Big5)
all_data <- rbind(all_data, Big6)
dim(all_data)
## [1] 66312    22

Then - we need to check how many “Root” values we have per unique image and how many “Lateral root” values we have. This will save us heaps of headache in the future

In total we have X many images

length(unique(all_data$image))
## [1] 8150

and we have X many Main Roots - which should be the same as image number…

onlyMr <- subset(all_data, all_data$root_order == 0)
dim(onlyMr)
## [1] 9316   22

… but it isn’t - so let’s figure which images have more MR per image than 1 and remove these specific values (or decide which one to remove :)

We need to make a file where: Col. A > image Col. B > # Root Col. C > # Lateral Root

names <- c(text="image", "MR.no", "LR.no")
check_table <- data.frame()

for (k in names) check_table[[k]] <- as.character()

Then - we will subset the entire dataset for one image and calculate how many MR and LR are there and integrate it into the table

i=1

uni <- subset(all_data, all_data$image == unique(all_data$image)[i])
uni
MR <- subset(uni, uni$root_order == 0)
LR <- subset(uni, uni$root_order == 1)

check_table[i,1] <- as.character(unique(uni$image))
check_table[i,2] <- dim(MR)[1]
check_table[i,3] <- dim(LR)[1]
check_table

Cool - now let’s loop it for all the images:

for (i in 2:8150) {
  uni <- subset(all_data, all_data$image == unique(all_data$image)[i])
  uni
  MR <- subset(uni, uni$root_order == 0)
  LR <- subset(uni, uni$root_order == 1)
  
  check_table[i,1] <- as.character(unique(uni$image))
  check_table[i,2] <- dim(MR)[1]
  check_table[i,3] <- dim(LR)[1]
}

check_table

Cool - now let’s fish out all the images where we have multiple MR:

suspicious <- subset(check_table, check_table$MR.no > 1)
dim(suspicious)
## [1] 1154    3
suspicious

Let’s have a closer look at these suspicious images:

closer_look <- subset(all_data, all_data$image == suspicious$image[100])
closer_look2 <- subset(closer_look, closer_look$root_order == 0)
closer_look2

It looks like these double roots are just duplications - let’s see what happens when we remove exact duplicates using tidyverse package

library(tidyverse)
## ── Attaching packages ──────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.3.1     ✓ purrr   0.3.4
## ✓ tibble  3.0.1     ✓ dplyr   1.0.0
## ✓ tidyr   1.1.0     ✓ stringr 1.4.0
## ✓ readr   1.3.1     ✓ forcats 0.5.0
## ── Conflicts ─────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
all_data2 <- all_data %>% distinct()
length(unique((all_data2$image)))
## [1] 8150
onlyMr2 <- subset(all_data2, all_data2$root_order == 0)
dim(onlyMr2)
## [1] 8198   22

cool - so now we have majority of the images where the MR is simply duplicated - so let’s repeat the exercise from above again to identify what other images we have left over which have two MR:

names <- c(text="image", "MR.no", "LR.no")
check_table2 <- data.frame()

for (k in names) check_table2[[k]] <- as.character()

for (i in 1:8150) {
  uni <- subset(all_data2, all_data2$image == unique(all_data2$image)[i])
  MR <- subset(uni, uni$root_order == 0)
  LR <- subset(uni, uni$root_order == 1)
  
  check_table2[i,1] <- as.character(unique(uni$image))
  check_table2[i,2] <- dim(MR)[1]
  check_table2[i,3] <- dim(LR)[1]
}

suspicious <- subset(check_table2, check_table2$MR.no > 1)
suspicious

Let’s have a closer look at these images and their MRs:

closer_look <- subset(all_data2, all_data2$image == suspicious$image[1])
closer_look1 <- subset(closer_look, closer_look$root_order == 0)
closer_look1
closer_look <- subset(all_data2, all_data2$image == suspicious$image[22])
closer_look2 <- subset(closer_look, closer_look$root_order == 0)
closer_look2

OK - so clearly - we have something that wasnt classified as LR properly (as in case of closer_look1).

We can recognize the “mistake MR” by saying that the name would start with root_ but let’s see if this is the case for many of them:

onlyMr <- subset(all_data2, all_data2$root_order == 0)
unique(onlyMr$root_name)
##    [1] " 288_2_C"  " 189_3_C"  " 214_2_S"  " 201_1_C"  " root_0"   " 292_3_S" 
##    [7] " 306_1_C"  " 288_1_C"  " 213_3_S"  " 207_3_S"  " 212_1_S"  " 207_3_C" 
##   [13] " 199_1_S"  " 307_2_C"  " 282_3_C"  " 199_2_S"  " 298_3_S"  " 212_3_C" 
##   [19] " 212_2_C"  " 278_1_S"  " 301_1_C"  " 201_1_S"  " 286_1_S"  " 287_1_S" 
##   [25] " 213_2_C"  " 220_2_C"  " 286_2_S"  " 214_1_C"  " 286_2_C"  " 194_1_S" 
##   [31] " 212_1_C"  " 294_2_C"  " 213_1_C"  " 287_2_S"  " 285_2_S"  " 293_2_C" 
##   [37] " 284_2_S"  " 195_3_C"  " 277_1_C"  " 285_3_S"  " 278_1_C"  " 300_1_S" 
##   [43] " 214_3_C"  " 196_2_S"  " 292_1_C"  " 283_2_C"  " 201_2_S"  " 307_1_S" 
##   [49] " 279_1_S"  " 298_1_S"  " 293_3_S"  " 280_1_S"  " 194_3_S"  " 294_3_S" 
##   [55] " 299_2_C"  " 291_2_S"  " 207_1_S"  " 298_3_C"  " 282_1_C"  " 285_3_C" 
##   [61] " 280_3_C"  " 307_3_C"  " 200_1_S"  " 211_3_S"  " 308_3_C"  " 284_1_S" 
##   [67] " 298_1_C"  " 308_2_C"  " 197_3_S"  " 290_2_C"  " 287_1_C"  " 301_1_S" 
##   [73] " 196_1_C"  " 284_2_C"  " 299_1_C"  " 220_3_C"  " 278_3_C"  " 293_2_S" 
##   [79] " 308_3_S"  " 207_1_C"  " 283_2_S"  " 306_2_S"  " 280_1_C"  " 220_1_C" 
##   [85] " 200_3_S"  " 214_3_S"  " 213_2_S"  " 287_3_S"  " 195_3_S"  " 290_1_S" 
##   [91] " 194_3_C"  " 194_1_C"  " 288_3_S"  " 195_2_C"  " 282_2_S"  " 290_3_C" 
##   [97] " 196_2_C"  " 200_2_S"  " 300_2_C"  " 198_2_C"  " 211_1_C"  " 200_1_C" 
##  [103] " 285_2_C"  " 197_1_C"  " 288_2_S"  " 292_2_C"  " 308_1_S"  " 301_2_C" 
##  [109] " 279_3_C"  " 299_3_S"  " 195_2_S"  " 294_2_S"  " 279_2_C"  " 289_2_S" 
##  [115] " 282_2_C"  " 301_3_S"  " 299_1_S"  " 300_3_C"  " 197_2_C"  " 286_1_C" 
##  [121] " 298_2_C"  " 288_3_C"  " 194_2_S"  " 306_2_C"  " 213_3_C"  " 307_1_C" 
##  [127] " 201_3_C"  " 291_1_S"  " 291_3_C"  " 277_2_S"  " 220_1_S"  " 2800_3_S"
##  [133] " 280_2_C"  " 196_1_S"  " 207_2_S"  " 235_1_C"  " 279_1_C"  " 278_3_S" 
##  [139] " 199_2_C"  " 287_3_C"  " 195_1_S"  " 290_2_S"  " 306_3_S"  " 213_1_S" 
##  [145] " 294_1_C"  " 294_1_S"  " 290_3_S"  " 306_3_C"  " 195_1_C"  " 199_3_C" 
##  [151] " 283_3_C"  " 278_2_S"  " 290_1_C"  " 299_2_S"  " 197_3_C"  " 212_2_S" 
##  [157] " 211_2_S"  " 211_2_C"  " 293_3_C"  " 199_3_S"  " 199_1_C"  " 214_1_S" 
##  [163] " 277_1_S"  " 197_1_S"  " 299_3_C"  " 292_3_C"  " 291_2_C"  " 198_1_S" 
##  [169] " 207_2_C"  " 220_2_S"  " 282_1_S"  " 214_2_C"  " 285_1_S"  " 292_2_S" 
##  [175] " 194_2_C"  " 278_2_C"  " 291_1_C"  " 198_2_S"  " 286_3_S"  " 212_3_S" 
##  [181] " 200_2_C"  " 220_3_S"  " 198_1_C"  " 200_3_C"  " 300_3_S"  " 284_1_C" 
##  [187] " 293_1_S"  " 283_1_C"  " 211_3_C"  " 283_3_S"  " 201_2_C"  " 286_3_C" 
##  [193] " 306_1_S"  " 277_2_C"  " 293_4_C"  " 279_3_S"  " 283_1_S"  " 307_3_S" 
##  [199] " 307_2_S"  " 211_1_S"  " 197_2_S"  " 308_2_S"  " 301_2_S"  " 288_1_S" 
##  [205] " 300_2_S"  " 282_3_S"  " 287_2_C"  " 301_3"    " 291_3_S"  " 294_3_C" 
##  [211] " 198_3_S"  " root_1"   " 308_1_C"  " 201_3_S"  " 192_3_C"  " 171_3_C" 
##  [217] " 147_3_C"  " 252_1_S"  " 252_3_S"  " 258_1_S"  " 166_1_C"  " 269_3_C" 
##  [223] " 064_1_C"  " 253_2_S"  " 264_2_S"  " 193_1_S"  " 146_3_C"  " 141_2_C" 
##  [229] " 267_1_C"  " 256_3_S"  " 061_1_S"  " 062_2_S"  " 065_2_S"  " 251_3_S" 
##  [235] " 064_1_S"  " 139_3_S"  " 141_1_S"  " 169_1_S"  " 083_3_S"  " 258_3_S" 
##  [241] " 138_1_C"  " 083_2_S"  " 192_1_C"  " 172_2_S"  " 144_2_C"  " 168_1_S" 
##  [247] " 268_1_S"  " 147_2_C"  " 253_3_S"  " 193_1_C"  " 264_2_C"  " 165_2_S" 
##  [253] " 138_3_S"  " 146_2_C"  " 258_2_S"  " 061_2_C"  " 065_3_S"  " 262_3_S" 
##  [259] " 140_3_C"  " 260_2_S"  " 170_3_C"  " 141_1_C"  " 144_1_C"  " 142_4_S" 
##  [265] " 258_1_C"  " 259_1_C"  " 270_1_C"  " 139_1_S"  " 191_1_S"  " 168_3_S" 
##  [271] " 272_2_C"  " 138_4_C"  " 269_3_S"  " 147_1_S"  " 165_1_S"  " 144_2_S" 
##  [277] " 255_1_S"  " 147_3_S"  " 138_4_S"  " 170_1_S"  " 060_1_S"  " 272_3_S" 
##  [283] " 065_3_C"  " 260_2_C"  " 251_2_C"  " 269_1_C"  " 172_2_C"  " 262_3_C" 
##  [289] " 261_1_S"  " 261_2_S"  " 192_3_S"  " 166_3_C"  " 168_3_C"  " 260_1_C" 
##  [295] " 167_1_S"  " 262_2_C"  " 066_2_S"  " 253_2_C"  " 142_3_C"  " 060_3_S" 
##  [301] " 165_2_C"  " 066_2_C"  " 136_3_C"  " 251_1_S"  " 191_2_C"  " 142_3_S" 
##  [307] " 140_2_S"  " 141_2_S"  " 143_1_S"  " 256_2_S"  " 139_2_C"  " 193_3_S" 
##  [313] " 143_2_C"  " 064_2_S"  " 262_1_C"  " 251_3_C"  " 138_2_C"  " 165_1_C" 
##  [319] " 252_3_C"  " 139_2_S"  " 083_3_C"  " 166_1_S"  " 171_3_S"  " 262_4_C" 
##  [325] " 167_1_C"  " 256_1_C"  " 264_1_C"  " 146_1_C"  " 259_3_S"  " 143_2_S" 
##  [331] " 136_2_C"  " 170_2_C"  " 146_2_S"  " 192_2_C"  " 061_3_C"  " 255_2_C" 
##  [337] " 147_1_C"  " 259_2_C"  " 140_2_C"  " 169_2_C"  " 258_3_C"  " 146_3_S" 
##  [343] " 169_3_S"  " 138_2_S"  " 061_1_C"  " 267_1_S"  " 170_3_S"  " 252_2_S" 
##  [349] " 141_3_C"  " 140_3_S"  " 060_2_S"  " 166_3_S"  " 082_3_C"  " 136_1_C" 
##  [355] " 141_3_S"  " 168_2_C"  " 165_3_C"  " 270_2_S"  " 272_3_C"  " 193_3_C" 
##  [361] " 256_2_C"  " 252_2_C"  " 140_1_C"  " 142_2_C"  " 170_2_S"  " 171_2_C" 
##  [367] " 144_3_C"  " 193_2_S"  " 262_2_S"  " 144_1_S"  " 272_1_C"  " 259_3_C" 
##  [373] " 138_1_S"  " 191_3_S"  " 062_1_C"  " 083_1_S"  " 147_2_S"  " 172_1_C" 
##  [379] " 252_1_C"  " 136_2_S"  " 170_1_C"  " 063_1_S"  " 260_3_C"  " 264_3_C" 
##  [385] " 142_4_C"  " 270_2_C"  " 256_3_C"  " 140_1_S"  " 269_2_S"  " 065_1_C" 
##  [391] " 191_1_C"  " 066_1_S"  " 061_2_S"  " 171_2_S"  " 142_1_S"  " 082_3_S" 
##  [397] " 256_1_S"  " 193_2_C"  " 253_1_C"  " 168_2_S"  " 253_1_S"  " 142_2_S" 
##  [403] " 259_2_S"  " 065_2_C"  " 169_2_S"  " 143_1_C"  " 171_1_C"  " 264_3_S" 
##  [409] " 260_3_S"  " 060_3_C"  " 192_1_S"  " 171_1_S"  " 261_2_C"  " 169_1_C" 
##  [415] " 258_2_C"  " 063_1_C"  " 261_3_C"  " 082_2_C"  " 083_2_C"  " 082_1_S" 
##  [421] " 259_1_S"  " 191_2_S"  " 169_3_C"  " 168_1_C"  " 272_2_S"  " 172_3_C" 
##  [427] " 255_1_C"  " 061_3_S"  " 261_3_S"  " 138_3_C"  " 261_1_C"  " 139_3_C" 
##  [433] " 136_3_S"  " 082_1_C"  " 264_1_S"  " 268_2_S"  " 082_2_S"  " 270_1_S" 
##  [439] " 172_1_S"  " 262_4_S"  " 269_2_C"  " 253_3_C"  " 251_1_C"  " 191_3_C" 
##  [445] " 272_1_S"  " 262_1_S"  " 268_2_C"  " 192_2_S"  " 066_1_C"  " 144_3_S" 
##  [451] " 251_2_S"  " 136_1_S"  " 142_1_C"  " 255_2_S"  " 166_2_S"  " 083_1_C" 
##  [457] " 267_2_C"  " 060_1_C"  " 268_3_C"  " 146_1_S"  " 065_1_S"  " 165_3_S" 
##  [463] " 268_3_S"  " 269_1_S"  " 166_2_C"  " 260_1_S"  " 172_3_S"  " 060_2_C" 
##  [469] " 139_1_C"  " root_5"   " 230_2_C"  " 174_1_S"  " 234_1_C"  " 245_3_S" 
##  [475] " 173_4_C"  " 236_3_S"  " 084_3_C"  " 240_4_C"  " 229_4_C"  " 245_1_S" 
##  [481] " 236_4_C"  " 241_1_C"  " 231_2_S"  " 175_1_S"  " 176_3_S"  " 245_4_S" 
##  [487] " 064_3_S"  " 228_1_C"  " 244_2_S"  " 244_1_S"  " 227_1_C"  " 237_1_C" 
##  [493] " 228_1_S"  " 174_3_C"  " 176_1_C"  " 229_4_S"  " 274_1_C"  " 249_3_S" 
##  [499] " 090_3_S"  " 090_1_S"  " 247_2_S"  " 235_2_S"  " 091_4_C"  " 087_1_S" 
##  [505] " 091_4_S"  " 090_3_C"  " 085_2_S"  " 227_2_C"  " 237_3_C"  " 228_2_C" 
##  [511] " 230_3_s"  " 175_4_C"  " 250_1_C"  " 222_2_S"  " 093_3_S"  " 229_2_S" 
##  [517] " 239_4_C"  " 240_1_C"  " 229_3_S"  " 233_1_C"  " 250_4_S"  " 274_2_C" 
##  [523] " 093_1_C"  " 091_1_C"  " 247_3_S"  " 088_1_C"  " 230_1_S"  " 234_2_C" 
##  [529] " 271_2_S"  " 173_1_C"  " 240_2_S"  " 092_4_C"  " 084_1_S"  " 227_3_C" 
##  [535] " 084_1_C"  " 229_3_C"  " 221_1_S"  " 233_3_S"  " 088_2_S"  " 236_1_S" 
##  [541] " 239_4_S"  " 236_2_S"  " 221_1_C"  " 247_4_S"  " 225_1_C"  " 234_1_S" 
##  [547] " 173_3_C"  " 233_2_C"  " 089_3_C"  " 234_2_S"  " 225_1_S"  " 241_2_C" 
##  [553] " 084_3_S"  " 247_1_S"  " 245_3_C"  " 089_1_"   " 247_3_C"  " 239_3_C" 
##  [559] " 244_3_S"  " 038_2_S"  " 250_3_S"  " 085_1_S"  " 176_1_S"  " 228_3_C" 
##  [565] " 234_3_S"  " 038_3_S"  " 273_1_S"  " 248_1_C"  " 247_2_C"  " 298_2_S" 
##  [571] " 228_4_C"  " 248_4_C"  " 089_2_S"  " 274_3_C"  " 086_3_C"  " 231_2_C" 
##  [577] " 239_1_C"  " 173_1_S"  " 085_3_S"  " 086_1_C"  " 085_2_C"  " 093_2_C" 
##  [583] " 228_2_S"  " 084_2_S"  " 231_3_C"  " 273_3_C"  " 175_3_C"  " 176_2_S" 
##  [589] " 091_2_S"  " 271_1_C"  " 084_4_C"  " 273_2_C"  " 173_4_S"  " 240_4_S" 
##  [595] " 228_3_S"  " 274_4_C"  " 239_1_S"  " 236_2_C"  " 084_2_C"  " 173_2_C" 
##  [601] " 230_2_S"  " 093_2_S"  " 093_4_C"  " 092_1_C"  " 250_4_C"  " 240_3_C" 
##  [607] " 174_1_C"  " 038_1_S"  " 176_4_C"  " 092_3_C"  " 244_3_C"  " 176_2_C" 
##  [613] " 240_2_C"  " 241_2_S"  " 274_1_S"  " 064_2_C"  " 088_1_S"  " 227_2_S" 
##  [619] " 240_1_S"  " 087_2_S"  " 221_2_C"  " 088_3_C"  " 092_2_C"  " 174_3_S" 
##  [625] " 235_1_S"  " 090_2_S"  " 086_3_S"  " 086_1_S"  " 089_2_C"  " 249_2_S" 
##  [631] " 176_4_S"  " 231_1_C"  " 092_3_S"  " 091_3_S"  " 093_3_C"  " 229_1_S" 
##  [637] " 175_2_S"  " 236_3_C"  " 087_3_C"  " 092_2_S"  " 239_2_S"  " 248_2_C" 
##  [643] " 229_1_C"  " 250_3_C"  " 222_2_C"  " 225_2_C"  " 038_3_C"  " 222_1_S" 
##  [649] " 274_4_S"  " 233_3_C"  " 230_1_C"  " 090_1_C"  " 236_4_S"  " 175_2_C" 
##  [655] " 248_1_S"  " 271_4_S"  " 064_3_C"  " 175_1_C"  " 093_1_S"  " 249_2_C" 
##  [661] " 173_2_S"  " 087_4_C"  " 230_3_C"  " 225_2_S"  " 090_2_C"  " 273_1_C" 
##  [667] " 247_1_C"  " 237_2_C"  " 084_4_S"  " 249_3_C"  " 239_2_C"  " 237_4_C" 
##  [673] " 237_3_S"  " 231_1_S"  " 271_1_S"  " 239_3_S"  " 233_4_S"  " 271_2_C" 
##  [679] " 175_3_S"  " 087_4_S"  " 092_1_S"  " 233_1_S"  " 174_4_C"  " 038_1_C" 
##  [685] " 174_4_S"  " 087_1_C"  " 228_4_S"  " 092_4_S"  " 231_3_S"  " 273_2_S" 
##  [691] " 176_3_C"  " 247_4_C"  " 248_4_S"  " 245_2_S"  " 240_3_S"  " 241_3_C" 
##  [697] " 245_1_C"  " 091_1_S"  " 233_2_S"  " 241_1_S"  " 085_1_C"  " 174_2_S" 
##  [703] " 089_4_C"  " 244_1_C"  " 087_2_C"  " 248_3_C"  " 227_3_S"  " 273_3_S" 
##  [709] " 250_2_C"  " 271_3_C"  " 273_4_C"  " 222_1_C"  " 248_2_S"  " 249_1_S" 
##  [715] " 093_4_S"  " 271_3_S"  " 236_1_C"  " 089_3_S"  " 237_1_S"  " 248_3_S" 
##  [721] " 229_2_C"  " 273_4_S"  " 091_2_C"  " 085_3_C"  " 175_4_S"  " 244_2_C" 
##  [727] " 088_2_C"  " 089_4_S"  " 271_4_C"  " 086_2_S"  " 237_4_S"  " 227_1_S" 
##  [733] " 087_3_S"  " 089_1_S"  " 250_2_S"  " 274_2_S"  " 091_3_C"  " 038_2_C" 
##  [739] " 174_2_C"  " 274_3_S"  " 234_3_C"  " 241_3_S"  " 233_4_C"  " 245_2_C" 
##  [745] " 237_2_S"  " 173_3_S"  " 086_2_C"  " 249_1_C"  " 088_3_S"  " 230_3_S" 
##  [751] " 089_1_C"  " 250_1_S"  " 237_1_s"  " 031_3_S"  " 030_3_C"  " 103_4_S" 
##  [757] " 028_3_S"  " 098_1_S"  " 055_2_S"  " 075_3_C"  " 059_4_C"  " 095_4_C" 
##  [763] " 101_1_S"  " 034_1_C"  " 002_1_C"  " 030_2_S"  " 103_3_S"  " 056_3_S" 
##  [769] " 001_3_C"  " 099_3_C"  " 102_4_C"  " 012_3_C"  " 076_1_C"  " 098_1_C" 
##  [775] " 079_1_C"  " 080_2_S"  " 104_3_S"  " 005_3_S"  " 080_1_S"  " 006_2_C" 
##  [781] " 102_3_C"  " 081_1_C"  " 101_2_C"  " 096_1_C"  " 101_2_S"  " 058_4_C" 
##  [787] " 028_4_C"  " 059_3_S"  " 099_2_S"  " 104_3_C"  " 103_3_C"  " 079_4_C" 
##  [793] " 030_1_S"  " 105_4_S"  " 040_1_C"  " 080_4_S"  " 029_3_C"  " 036_2_C" 
##  [799] " 058_1_C"  " 057_3_S"  " 035_4_C"  " 040_1_S"  " 010_2_S"  " 094_3_C" 
##  [805] " 032_3_S"  " 011_1_C"  " 010_2_C"  " 074_4_C"  " 032_4_S"  " 056_2_C" 
##  [811] " 103_1_S"  " 103_1_C"  " 022_4_C"  " 010_1_S"  " 102_2_S"  " 105_3_C" 
##  [817] " 081_2_S"  " 003_3_S"  " 056_2_S"  " 095_1_S"  " 009_3_S"  " 011_4_S" 
##  [823] " 002_2_S"  " 106_1_S"  " 098_3_C"  " 058_2_S"  " 040_3_S"  " 103_2_S" 
##  [829] " 075_2_C"  " 001_4_S"  " 009_2_S"  " 081_1_S"  " 057_1_C"  " 028_3_C" 
##  [835] " 033_2_C"  " 012_1_S"  " 006_3_C"  " 080_1_C"  " 098_3_S"  " 094_2_C" 
##  [841] " 029_3_S"  " 058_4_S"  " 074_3_C"  " 095_4_S"  " 028_1_S"  " 013_3_C" 
##  [847] " 097_1_S"  " 001_2_S"  " 031_1_S"  " 105_1_S"  " 040_2_C"  " 094_2_S" 
##  [853] " 007_2_C"  " 075_3_S"  " 013_2_S"  " 074_4_S"  " 007_1_C"  " 006_3_S" 
##  [859] " 035_2_C"  " 008_1_S"  " 057_1_S"  " 007_3_C"  " 059_3_C"  " 076_3_C" 
##  [865] " 012_3_S"  " 008_3_C"  " 007_1_S"  " 094_3_S"  " 099_4_C"  " 057_3_C" 
##  [871] " 099_1_C"  " 040_4_C"  " 035_2_S"  " 029_4_S"  " 104_2_S"  " 030_2_C" 
##  [877] " 012_2_S"  " 103_4_C"  " 079_3_S"  " 105_3_S"  " 007_2_S"  " 032_2_C" 
##  [883] " 012_4_S"  " 057_4_S"  " 013_1_C"  " 032_1_C"  " 055_2_C"  " 010_3_S" 
##  [889] " 009_2_C"  " 078_3_S"  " 099_1_S"  " 001_1_C"  " 057_2_S"  " 098_4_S" 
##  [895] " 079_2_S"  " 056_3_C"  " 003_3_C"  " 031_2_C"  " 106_2_C"  " 001_2_C" 
##  [901] " 005_3_C"  " 059_1_C"  " 096_2_S"  " 009_1_C"  " root_3"   " 081_3_C" 
##  [907] " 081_4_S"  " 059_2_C"  " 037_1_C"  " 031_4_C"  " 038_4_C"  " 057_2_C" 
##  [913] " 057_4_C"  " 030_1_C"  " 078_1_C"  " 035_1_S"  " 029_1_C"  " 101_3_S" 
##  [919] " 055_1_S"  " 008_1_C"  " 034_1_S"  " 005_2_S"  " 011_3_C"  " 095_2_S" 
##  [925] " 001_1_S"  " 055_3_C"  " 003_2_S"  " 105_4_C"  " 104_4_S"  " 031_4_S" 
##  [931] " 102_4_S"  " 059_2_S"  " 013_2_C"  " 079_3_C"  " 009_3_C"  " 074_2_S" 
##  [937] " 006_1_C"  " 010_1_C"  " 075_1_S"  " 008_3_S"  " 009_4_C"  " 104_1_S" 
##  [943] " 058_3_C"  " 008_4_C"  " 011_4_C"  " 010_3_C"  " 078_1_S"  " 058_2_C" 
##  [949] " 029_1_S"  " 076_2_C"  " 099_4_S"  " 106_2_S"  " 075_1_C"  " 009_1_S" 
##  [955] " 008_4_S"  " 095_3_C"  " 080_2_C"  " 099_2_C"  " 033_2_S"  " 074_1_S" 
##  [961] " 003_1_S"  " 002_1_S"  " 011_3_S"  " 105_2_C"  " 059_4_S"  " 080_3_S" 
##  [967] " 055_3_S"  " 028_1_C"  " 008_2_S"  " 035_3_C"  " 011_2_C"  " 094_1_C" 
##  [973] " 013_3_S"  " 034_2_C"  " 055_1_C"  " 056_1_S"  " 005_2_C"  " 005_4_C" 
##  [979] " 035_3_S"  " 028_2_S"  " 005_4_S"  " 058_3_S"  " 104_2_C"  " 056_1_C" 
##  [985] " 101_4_S"  " 079_4_S"  " 012_2_C"  " 002_4_S"  " 101_4_C"  " 031_1_C" 
##  [991] " 059_1_S"  " 105_1_C"  " 095_3_S"  " 097_1_C"  " 098_4_C"  " 008_2_C" 
##  [997] " 033_3_S"  " 029_4_C"  " 094_1_S"  " 034_3_C"  " 081_3_S"  " 036_1_C" 
## [1003] " 002_2_C"  " 081_4_C"  " 033_1_C"  " 074_2_C"  " 079_1_S"  " 006_1_S" 
## [1009] " 036_2_S"  " 033_1_S"  " 106_1_C"  " 035_4_S"  " 035_1_C"  " 029_2_S" 
## [1015] " 080_4_C"  " 030_3_S"  " 011_2_S"  " 007_3_S"  " 040_3_C"  " 005_1_S" 
## [1021] " 040_4_S"  " 029_2_C"  " 001_4_C"  " 032_3_C"  " 101_3_C"  " 028_2_C" 
## [1027] " 078_2_C"  " 101_1_C"  " 013_1_S"  " 006_2_S"  " 037_1_S"  " 096_2_C" 
## [1033] " 002_3_C"  " 038_4_S"  " 003_1_C"  " 076_4_C"  " 098_2_C"  " 040_2_S" 
## [1039] " 102_1_C"  " 012_1_C"  " 102_2_C"  " 078_2_S"  " 001_3_S"  " 032_4_C" 
## [1045] " 002_3_S"  " 012_4_C"  " 076_2_S"  " 032_1_S"  " 096_3_S"  " 032_2_S" 
## [1051] " 079_2_C"  " 036_1_S"  " 011_1_S"  " 095_2_C"  " 031_2_S"  " 034_3_S" 
## [1057] " 076_1_S"  " 105_2_S"  " 034_2_S"  " 096_3_C"  " 102_1_S"  " 076_4_S" 
## [1063] " 076_3_S"  " 104_1_C"  " 098_2_S"  " 102_3_S"  " 058_1_S"  " 075_2_S" 
## [1069] " 099_3_S"  " 009_4_S"  " 081_2_C"  " 031_3_C"  " 028_4_S"  " 103_2_C" 
## [1075] " 104_4_C"  " 096_1_S"  " 074_1_C"  " 074_3_S"  " 033_3_C"  " 095_1_C" 
## [1081] " 003_2_C"  " root_11"  " root_4"   " 182-2_C"  " 130-3_C"  " 117-3_C" 
## [1087] " 186-3_S"  " 127-2_S"  " 187-3_C"  " 159-3_S"  " 125-3_C"  " 178-4_S" 
## [1093] " 151-3_C"  " 109-2_S"  " 158-2_C"  " 121-3_S"  " 181-1_C"  " 190-3_S" 
## [1099] " 158-3_C"  " 182-3_S"  " 121-2_S"  " 150-4_S"  " 178-1_C"  " 186-2_S" 
## [1105] " 112-3_C"  " 159-4_C"  " 115-1_S"  " 188-1_S"  " 125-3_S"  " 182-2_S" 
## [1111] " 181-3_C"  " 128-2_C"  " 151-2_S"  " 183-1_C"  " 108-2_S"  " 185-1_C" 
## [1117] " 125-2_C"  " 183-2_C"  " 188-1_C"  " 181-2_C"  " 128-3_C"  " 117-3_S" 
## [1123] " 159-1_C"  " 121-1_C"  " 154-1_S"  " 185-2_S"  " 155-4_S"  " 120-4_C" 
## [1129] " 108-2_C"  " 182-4_C"  " 162-3_S"  " 112-1_C"  " 118-1_S"  " 112-4_S" 
## [1135] " 149-2_C"  " 162-3_C"  " 119-4_C"  " 162-1_S"  " 118-3_S"  " 188-3_S" 
## [1141] " 186-4_S"  " 151-1_S"  " 154-2_C"  " 159-2_C"  " 113-3_C"  " 149-4_S" 
## [1147] " 133-1_S"  " 121-4_C"  " 178-4_C"  " 125-4_C"  " 151-2_C"  " 187-2_C" 
## [1153] " 109-2_C"  " 127-2_C"  " 150-1_S"  " 182-1_C"  " 117-1_C"  " 156-4_C" 
## [1159] " 183-1_S"  " 113-1_C"  " 189-2_C"  " 149-1_C"  " 133-4_C"  " 133-3_S" 
## [1165] " 159-1_S"  " 118-4_C"  " 156-2_S"  " 125-1_C"  " 131-2_C"  " 131-4_C" 
## [1171] " 119-3_C"  " 129-1_C"  " 117-2_C"  " 160-2_C"  " 159-3_C"  " 132-1_S" 
## [1177] " 121-2_C"  " 186-1_C"  " 189-1_S"  " 120-3_S"  " 178-2_C"  " 151-4_S" 
## [1183] " 117-4_S"  " 133-2_C"  " 151-1_C"  " 108-4_S"  " 150-3_C"  " 118-4_S" 
## [1189] " 131-1_S"  " 190-1_S"  " 157-1_C"  " 178-3_S"  " 158-1_S"  " 129-4_C" 
## [1195] " 160-2_S"  " 156-1_S"  " 149-4_C"  " 109-1_C"  " 133-1_C"  " 126-3_S" 
## [1201] " 184-1_S"  " 109-3_S"  " 117-2_S"  " 112-2_S"  " 178-3_C"  " 108-4_C" 
## [1207] " 151-3_S"  " 150-2_S"  " 151-4_C"  " 131-4_S"  " 108-3_S"  " 111-1_C" 
## [1213] " 153-2_C"  " 182-1_S"  " 128-2_S"  " 129-2_C"  " 108-1_S"  " 118-3_C" 
## [1219] " 188-3_C"  " 187-1_C"  " 186-2_C"  " 185-3_S"  " 111-1_S"  " 119-2_S" 
## [1225] " 135-1_S"  " 150-3_S"  " 119-2_C"  " 159-4_S"  " 121-3_C"  " 158-4_C" 
## [1231] " 130-4_S"  " 131-2_S"  " 181-1_S"  " 155-1_C"  " 108-1_c"  " 127-4_S" 
## [1237] " 127-1_C"  " 160-1_S"  " 185-2_C"  " 155-4_C"  " 119-3_S"  " 107-2_S" 
## [1243] " 158-1_C"  " 185-3_C"  " 182-3_C"  " 185-4_C"  " 112-1_S"  " 117-4_C" 
## [1249] " 111-4_C"  " 111-3_C"  " 155-3_S"  " 149-3_C"  " 130-1_C"  " 107-2_C" 
## [1255] " 130-4_C"  " 120-1_C"  " 126-2_C"  " 134-1_S"  " 115-2_C"  " 113-1_S" 
## [1261] " 156-4_S"  " 132-2_S"  " 126-3_C"  " 150-4_C"  " 125-2_S"  " 132-3_C" 
## [1267] " 120-1_S"  " 189-1_C"  " 183-2_S"  " 109-1_S"  " 190-2_S"  " 187-2_S" 
## [1273] " 130-2_C"  " 155-2_C"  " 135-2_S"  " 184-2_C"  " 131-3_C"  " 155-1_S" 
## [1279] " 107-4_C"  " 181-3_S"  " 153-3_C"  " 154-2_S"  " 179_C"    " 107-1_S" 
## [1285] " 162-1_C"  " 111-4_S"  " 182-4_S"  " 111-2_S"  " 127-1_S"  " 128-3_S" 
## [1291] " 129-3_S"  " 184-2_S"  " 112-3_S"  " 113-4_C"  " 185-1_S"  " 126-1_C" 
## [1297] " 129-2_S"  " 120-2_C"  " 115-2_S"  " 108-3_C"  " 130-2_S"  " 135-1_C" 
## [1303] " 112-4_C"  " 162-2_S"  " 129-1_S"  " 107-3_S"  " 160-3_S"  " 132-1_C" 
## [1309] " 153-4_C"  " 160-3_C"  " 184-1_C"  " 185-4_S"  " 156-1_C"  " 130-1_S" 
## [1315] " 107-4_S"  " 119-1_S"  " 190-3_C"  " 118-2_S"  " 112-2_C"  " 121-4_S" 
## [1321] " 149-3_S"  " 159-2_S"  " 129-3_C"  " 155_1_C"  " 121-1_S"  " 132-2_C" 
## [1327] " 186-3_C"  " 120-3_C"  " 125-1_S"  " 157-2_C"  " 133-2_S"  " 113-3_S" 
## [1333] " 158-3_S"  " 150-2_C"  " 118-1_C"  " 156-3_S"  " 127-4_C"  " 128-4_C" 
## [1339] " 181-2_S"  " 127-3_S"  " 117-1_S"  " 155-2_S"  " 178-1_S"  " 120-2_S" 
## [1345] " 126-2_S"  " 126-1_S"  " 107-1_C"  " 132-3_S"  " 155-3_C"  " 156-3_C" 
## [1351] " 135-2_C"  " 133-3_C"  " 130-3_S"  " 156-2_C"  " 128-1_S"  " 149-2_S" 
## [1357] " 113-2_S"  " 108-1_C"  " 187-3_S"  " 190-4_C"  " root_17"  " 162-2_C" 
## [1363] " 113-4_S"  " 186-4_C"  " 107-3_C"  " 160-1_C"  " 188-2_S"  " root_9"  
## [1369] " 190-4_S"  " 150-1_C"  " 129-4_S"  " 125-4_s"  " 186-1_S"  " 157-1_S" 
## [1375] " 153-3_S"  " 119-4_S"  " 131-3_S"  " 116-1_C"  " 120-4_S"  " 109-3_C" 
## [1381] " 158-4_S"  " 128-1_C"  " 131-1_C"  " 153-1_C"  " root_15"  " 157-2_S" 
## [1387] " lat_5"    " lat_1"    " 190-2_C"  " 154-1_C"  " 153-1_S"  " 118-2_C" 
## [1393] " 178-2_S"  " 153-4_S"  " 189-2_S"  " 125-4_S"  " 190-1_C"  " root_2"  
## [1399] " 111-2_C"  " 127-3_C"  " 149-1_S"  " 111-3_S"  " 188-2_C"  " 153-2_S" 
## [1405] " 119-1_C"  " 158-2_S"  " 133-4_S"  " 128-4_S"  " 113-2_C"  " 115-1_C" 
## [1411] " root_16"  " 155-2_c"  " 155-1_c"  " 84-2_C"   " 190-1-C"  " M021_5_S"
## [1417] " 042_5_S"  " 027_5_S"  " M023_4_S" " 046_4_S"  " M054_2_S" " 073_1_S" 
## [1423] " 069_1_C"  " 049_2_C"  " M022_1_C" " M048_5_S" " M045_1_S" " M043_3_S"
## [1429] " M046_5_S" " 022_3_S"  " 073_2_S"  " 044_1_C"  " 024_4_S"  " 015_3_C" 
## [1435] " 054_5_C"  " 043_4_C"  " 044_2_C"  " 050_5_C"  " 043_5_S"  " 072_1_C" 
## [1441] " 049_3_S"  " 045_3_C"  " 022_4_S"  " 044_3_C"  " 049_5_C"  " 045_5_S" 
## [1447] " 050_5_S"  " 070_2_C"  " 073_5_S"  " 022_5_S"  " 024_5_C"  " 045_2_S" 
## [1453] " 015_1_C"  " 050_2_S"  " 049_2_S"  " 069_2_C"  " 050_3_S"  " 072_1_S" 
## [1459] " 043_4_S"  " 073_3_S"  " 050_4_C"  " 027_1_C"  " 050_4_S"  " 024_2_C" 
## [1465] " 015_2_C"  " 014_2_C"  " 049_4_C"  " 073_4_S"  " 049_4_S"  " 015_4_C" 
## [1471] " 072_3_C"  " 017_3_C"  " 070_2_S"  " 044_3_S"  " 072_3_S"  " 023_5_S" 
## [1477] " 022_2_C"  " 014_1_C"  " 050_3_C"  " 054_4_C"  " 015_2_S"  " 024_3_C" 
## [1483] " 069_3_C"  " 044_1_S"  " 072_2_C"  " 044_2_S"  " 049_3_C"  " 069_3_S" 
## [1489] " 043_3_C"  " 027_1_S"  " 072_2_S"  " 045_4_C"  " 015_3_S"  " 027_2_C" 
## [1495] " 022_5_C"  " 024_5_S"  " 017_4_S"  " 045_5_C"  " 021_5_C"  " 019_1_C" 
## [1501] " 067_4_C"  " 019_1_S"  " 042_5_C"  " 023_3_S"  " 050_1_C"  " 048_1_C" 
## [1507] " 046_4_C"  " 042_2_S"  " 050_1_S"  " 069_1_S"  " 015_5_S"  " 021_2_S" 
## [1513] " 021_3_C"  " 046_3_C"  " 052_3_S"  " 048_4_C"  " 054_1_C"  " 067_4_S" 
## [1519] " 052_1_S"  " 048_4_S"  " 043_1_S"  " 020_3_C"  " 020_1_S"  " 042_1_S" 
## [1525] " 042_2_C"  " 048_5_C"  " 023_4_C"  " 049_1_C"  " 043_2_S"  " 022_1_S" 
## [1531] " 023_5_C"  " 050_2_C"  " 054_2_C"  " 023_2_S"  " 052_3_C"  " 042_1_C" 
## [1537] " 046_2_S"  " 042_4_S"  " 027_4_S"  " 023_3_C"  " 054_1_S"  " 027_5_C" 
## [1543] " 020_2_S"  " 052_1_C"  " 046_3_S"  " 052_4_C"  " 048_1_S"  " 049_1_S" 
## [1549] " 045_1_C"  " 069_2_S"  " 073_1_C"  " 022_2_S"  " 017_4_C"  " 052_4_S" 
## [1555] " 014_1_S"  " 024_2_S"  " 020_4_S"  " 053_5_C"  " 044_5_C"  " 020_2_C" 
## [1561] " 021_3_S"  " 024_1_S"  " 020_3_S"  " 024_1_C"  " 046_5_C"  " 020_4_C" 
## [1567] " 054_3_S"  " 043_1_C"  " 043_2_C"  " 048_2_C"  " 053_4_S"  " 053_4_C" 
## [1573] " 048_2_S"  " 067_3_C"  " 042_3_S"  " 027_3_S"  " 021_2_C"  " 015_5_C" 
## [1579] " 072_5_S"  " 052_2_S"  " 044_4_C"  " 072_4_C"  " 044_4_S"  " 053_2_C" 
## [1585] " 021_1_C"  " 052_5_S"  " 067_2_C"  " 046_1_C"  " 027_3_C"  " 067_2_S" 
## [1591] " 046_1_S"  " 015_4_S"  " 067_1_C"  " 073_5_C"  " 023_1_S"  " 072_5_C" 
## [1597] " 020_1_C"  " 053_5_S"  " 067_3_S"  " 046_2_C"  " 023_2_C"  " 044_5_S" 
## [1603] " 042_4_C"  " 053_3_S"  " 053_3_C"  " 067_1_S"  " 023_1_C"  " 049_5_S" 
## [1609] " 052_2_C"  " 042_3_C"  " 072_4_S"  " 052_5_C"  " 021_1_S"  " 027_4_C" 
## [1615] " 048_3_C"  " 015_1_S"  " 014_2_S"  " 054_4_S"  " 017_1_S"  " 022_3_C" 
## [1621] " 054_5_S"  " 045_4_S"  " 070_1_C"  " 024_4_C"  " 017_3_S"  " 043_5_C" 
## [1627] " 073_4_C"  " 054_3_C"  " 024_3_S"  " 073_2_C"  " 017_1_C"  " 017_2_S" 
## [1633] " 070_1_S"  " 073_3_C"  " 017_2_C"  " 053_1_C"  " 045_2_C"  " 045_3_S" 
## [1639] " 053_2_S"  " 027_2_S"  " 053_1_S"  " 048_3_S"  " 073_2_c"  " 054_2_S" 
## [1645] " root_7"   " root_8"   " 021_5_S"  " 023_4_S"  " 022_1_C"  " 048_5_S" 
## [1651] " 045_1_S"  " 043_3_S"  " 046_5_S"
dim(onlyMr)
## [1] 8198   22

ok - so then we have to split the root name into individual tiers and select MR which start with “root_”:

all_data2$root_info <- strsplit(all_data2$root_name, "_")
dim(all_data2)
## [1] 58801    23
for(i in 1:58801){
  all_data2$genotype[i] <- sapply(all_data2$root_info[i], function(x){
  x[1]})
  all_data2$rep[i] <- sapply(all_data2$root_info[i], function(x){
  x[2]})
  all_data2$cond[i] <- sapply(all_data2$root_info[i], function(x){
  x[3]})
}

head(all_data2)

Now we have to subset for Mr and look at their individual genotype information

onlyMr <- subset(all_data2, all_data2$root_order == 0)
dim(onlyMr)
## [1] 8198   26
unique(onlyMr$genotype)
##   [1] " 288"     " 189"     " 214"     " 201"     " root"    " 292"    
##   [7] " 306"     " 213"     " 207"     " 212"     " 199"     " 307"    
##  [13] " 282"     " 298"     " 278"     " 301"     " 286"     " 287"    
##  [19] " 220"     " 194"     " 294"     " 285"     " 293"     " 284"    
##  [25] " 195"     " 277"     " 300"     " 196"     " 283"     " 279"    
##  [31] " 280"     " 299"     " 291"     " 200"     " 211"     " 308"    
##  [37] " 197"     " 290"     " 198"     " 289"     " 2800"    " 235"    
##  [43] " 192"     " 171"     " 147"     " 252"     " 258"     " 166"    
##  [49] " 269"     " 064"     " 253"     " 264"     " 193"     " 146"    
##  [55] " 141"     " 267"     " 256"     " 061"     " 062"     " 065"    
##  [61] " 251"     " 139"     " 169"     " 083"     " 138"     " 172"    
##  [67] " 144"     " 168"     " 268"     " 165"     " 262"     " 140"    
##  [73] " 260"     " 170"     " 142"     " 259"     " 270"     " 191"    
##  [79] " 272"     " 255"     " 060"     " 261"     " 167"     " 066"    
##  [85] " 136"     " 143"     " 082"     " 063"     " 230"     " 174"    
##  [91] " 234"     " 245"     " 173"     " 236"     " 084"     " 240"    
##  [97] " 229"     " 241"     " 231"     " 175"     " 176"     " 228"    
## [103] " 244"     " 227"     " 237"     " 274"     " 249"     " 090"    
## [109] " 247"     " 091"     " 087"     " 085"     " 250"     " 222"    
## [115] " 093"     " 239"     " 233"     " 088"     " 271"     " 092"    
## [121] " 221"     " 225"     " 089"     " 038"     " 273"     " 248"    
## [127] " 086"     " 031"     " 030"     " 103"     " 028"     " 098"    
## [133] " 055"     " 075"     " 059"     " 095"     " 101"     " 034"    
## [139] " 002"     " 056"     " 001"     " 099"     " 102"     " 012"    
## [145] " 076"     " 079"     " 080"     " 104"     " 005"     " 006"    
## [151] " 081"     " 096"     " 058"     " 105"     " 040"     " 029"    
## [157] " 036"     " 057"     " 035"     " 010"     " 094"     " 032"    
## [163] " 011"     " 074"     " 022"     " 003"     " 009"     " 106"    
## [169] " 033"     " 013"     " 097"     " 007"     " 008"     " 078"    
## [175] " 037"     " 182-2"   " 130-3"   " 117-3"   " 186-3"   " 127-2"  
## [181] " 187-3"   " 159-3"   " 125-3"   " 178-4"   " 151-3"   " 109-2"  
## [187] " 158-2"   " 121-3"   " 181-1"   " 190-3"   " 158-3"   " 182-3"  
## [193] " 121-2"   " 150-4"   " 178-1"   " 186-2"   " 112-3"   " 159-4"  
## [199] " 115-1"   " 188-1"   " 181-3"   " 128-2"   " 151-2"   " 183-1"  
## [205] " 108-2"   " 185-1"   " 125-2"   " 183-2"   " 181-2"   " 128-3"  
## [211] " 159-1"   " 121-1"   " 154-1"   " 185-2"   " 155-4"   " 120-4"  
## [217] " 182-4"   " 162-3"   " 112-1"   " 118-1"   " 112-4"   " 149-2"  
## [223] " 119-4"   " 162-1"   " 118-3"   " 188-3"   " 186-4"   " 151-1"  
## [229] " 154-2"   " 159-2"   " 113-3"   " 149-4"   " 133-1"   " 121-4"  
## [235] " 125-4"   " 187-2"   " 150-1"   " 182-1"   " 117-1"   " 156-4"  
## [241] " 113-1"   " 189-2"   " 149-1"   " 133-4"   " 133-3"   " 118-4"  
## [247] " 156-2"   " 125-1"   " 131-2"   " 131-4"   " 119-3"   " 129-1"  
## [253] " 117-2"   " 160-2"   " 132-1"   " 186-1"   " 189-1"   " 120-3"  
## [259] " 178-2"   " 151-4"   " 117-4"   " 133-2"   " 108-4"   " 150-3"  
## [265] " 131-1"   " 190-1"   " 157-1"   " 178-3"   " 158-1"   " 129-4"  
## [271] " 156-1"   " 109-1"   " 126-3"   " 184-1"   " 109-3"   " 112-2"  
## [277] " 150-2"   " 108-3"   " 111-1"   " 153-2"   " 129-2"   " 108-1"  
## [283] " 187-1"   " 185-3"   " 119-2"   " 135-1"   " 158-4"   " 130-4"  
## [289] " 155-1"   " 127-4"   " 127-1"   " 160-1"   " 107-2"   " 185-4"  
## [295] " 111-4"   " 111-3"   " 155-3"   " 149-3"   " 130-1"   " 120-1"  
## [301] " 126-2"   " 134-1"   " 115-2"   " 132-2"   " 132-3"   " 190-2"  
## [307] " 130-2"   " 155-2"   " 135-2"   " 184-2"   " 131-3"   " 107-4"  
## [313] " 153-3"   " 179"     " 107-1"   " 111-2"   " 129-3"   " 113-4"  
## [319] " 126-1"   " 120-2"   " 162-2"   " 107-3"   " 160-3"   " 153-4"  
## [325] " 119-1"   " 118-2"   " 155"     " 157-2"   " 156-3"   " 128-4"  
## [331] " 127-3"   " 128-1"   " 113-2"   " 190-4"   " 188-2"   " 116-1"  
## [337] " 153-1"   " lat"     " 84-2"    " 190-1-C" " M021"    " 042"    
## [343] " 027"     " M023"    " 046"     " M054"    " 073"     " 069"    
## [349] " 049"     " M022"    " M048"    " M045"    " M043"    " M046"   
## [355] " 044"     " 024"     " 015"     " 054"     " 043"     " 050"    
## [361] " 072"     " 045"     " 070"     " 014"     " 017"     " 023"    
## [367] " 021"     " 019"     " 067"     " 048"     " 052"     " 020"    
## [373] " 053"
onlyMr$genotype <- gsub(" ", "", onlyMr$genotype)
unique(onlyMr$genotype)
##   [1] "288"     "189"     "214"     "201"     "root"    "292"     "306"    
##   [8] "213"     "207"     "212"     "199"     "307"     "282"     "298"    
##  [15] "278"     "301"     "286"     "287"     "220"     "194"     "294"    
##  [22] "285"     "293"     "284"     "195"     "277"     "300"     "196"    
##  [29] "283"     "279"     "280"     "299"     "291"     "200"     "211"    
##  [36] "308"     "197"     "290"     "198"     "289"     "2800"    "235"    
##  [43] "192"     "171"     "147"     "252"     "258"     "166"     "269"    
##  [50] "064"     "253"     "264"     "193"     "146"     "141"     "267"    
##  [57] "256"     "061"     "062"     "065"     "251"     "139"     "169"    
##  [64] "083"     "138"     "172"     "144"     "168"     "268"     "165"    
##  [71] "262"     "140"     "260"     "170"     "142"     "259"     "270"    
##  [78] "191"     "272"     "255"     "060"     "261"     "167"     "066"    
##  [85] "136"     "143"     "082"     "063"     "230"     "174"     "234"    
##  [92] "245"     "173"     "236"     "084"     "240"     "229"     "241"    
##  [99] "231"     "175"     "176"     "228"     "244"     "227"     "237"    
## [106] "274"     "249"     "090"     "247"     "091"     "087"     "085"    
## [113] "250"     "222"     "093"     "239"     "233"     "088"     "271"    
## [120] "092"     "221"     "225"     "089"     "038"     "273"     "248"    
## [127] "086"     "031"     "030"     "103"     "028"     "098"     "055"    
## [134] "075"     "059"     "095"     "101"     "034"     "002"     "056"    
## [141] "001"     "099"     "102"     "012"     "076"     "079"     "080"    
## [148] "104"     "005"     "006"     "081"     "096"     "058"     "105"    
## [155] "040"     "029"     "036"     "057"     "035"     "010"     "094"    
## [162] "032"     "011"     "074"     "022"     "003"     "009"     "106"    
## [169] "033"     "013"     "097"     "007"     "008"     "078"     "037"    
## [176] "182-2"   "130-3"   "117-3"   "186-3"   "127-2"   "187-3"   "159-3"  
## [183] "125-3"   "178-4"   "151-3"   "109-2"   "158-2"   "121-3"   "181-1"  
## [190] "190-3"   "158-3"   "182-3"   "121-2"   "150-4"   "178-1"   "186-2"  
## [197] "112-3"   "159-4"   "115-1"   "188-1"   "181-3"   "128-2"   "151-2"  
## [204] "183-1"   "108-2"   "185-1"   "125-2"   "183-2"   "181-2"   "128-3"  
## [211] "159-1"   "121-1"   "154-1"   "185-2"   "155-4"   "120-4"   "182-4"  
## [218] "162-3"   "112-1"   "118-1"   "112-4"   "149-2"   "119-4"   "162-1"  
## [225] "118-3"   "188-3"   "186-4"   "151-1"   "154-2"   "159-2"   "113-3"  
## [232] "149-4"   "133-1"   "121-4"   "125-4"   "187-2"   "150-1"   "182-1"  
## [239] "117-1"   "156-4"   "113-1"   "189-2"   "149-1"   "133-4"   "133-3"  
## [246] "118-4"   "156-2"   "125-1"   "131-2"   "131-4"   "119-3"   "129-1"  
## [253] "117-2"   "160-2"   "132-1"   "186-1"   "189-1"   "120-3"   "178-2"  
## [260] "151-4"   "117-4"   "133-2"   "108-4"   "150-3"   "131-1"   "190-1"  
## [267] "157-1"   "178-3"   "158-1"   "129-4"   "156-1"   "109-1"   "126-3"  
## [274] "184-1"   "109-3"   "112-2"   "150-2"   "108-3"   "111-1"   "153-2"  
## [281] "129-2"   "108-1"   "187-1"   "185-3"   "119-2"   "135-1"   "158-4"  
## [288] "130-4"   "155-1"   "127-4"   "127-1"   "160-1"   "107-2"   "185-4"  
## [295] "111-4"   "111-3"   "155-3"   "149-3"   "130-1"   "120-1"   "126-2"  
## [302] "134-1"   "115-2"   "132-2"   "132-3"   "190-2"   "130-2"   "155-2"  
## [309] "135-2"   "184-2"   "131-3"   "107-4"   "153-3"   "179"     "107-1"  
## [316] "111-2"   "129-3"   "113-4"   "126-1"   "120-2"   "162-2"   "107-3"  
## [323] "160-3"   "153-4"   "119-1"   "118-2"   "155"     "157-2"   "156-3"  
## [330] "128-4"   "127-3"   "128-1"   "113-2"   "190-4"   "188-2"   "116-1"  
## [337] "153-1"   "lat"     "84-2"    "190-1-C" "M021"    "042"     "027"    
## [344] "M023"    "046"     "M054"    "073"     "069"     "049"     "M022"   
## [351] "M048"    "M045"    "M043"    "M046"    "044"     "024"     "015"    
## [358] "054"     "043"     "050"     "072"     "045"     "070"     "014"    
## [365] "017"     "023"     "021"     "019"     "067"     "048"     "052"    
## [372] "020"     "053"
onlyMr2 <- subset(onlyMr, onlyMr$genotype != "root")
dim(onlyMr2)
## [1] 8151   26
unique(onlyMr2$genotype)
##   [1] "288"     "189"     "214"     "201"     "292"     "306"     "213"    
##   [8] "207"     "212"     "199"     "307"     "282"     "298"     "278"    
##  [15] "301"     "286"     "287"     "220"     "194"     "294"     "285"    
##  [22] "293"     "284"     "195"     "277"     "300"     "196"     "283"    
##  [29] "279"     "280"     "299"     "291"     "200"     "211"     "308"    
##  [36] "197"     "290"     "198"     "289"     "2800"    "235"     "192"    
##  [43] "171"     "147"     "252"     "258"     "166"     "269"     "064"    
##  [50] "253"     "264"     "193"     "146"     "141"     "267"     "256"    
##  [57] "061"     "062"     "065"     "251"     "139"     "169"     "083"    
##  [64] "138"     "172"     "144"     "168"     "268"     "165"     "262"    
##  [71] "140"     "260"     "170"     "142"     "259"     "270"     "191"    
##  [78] "272"     "255"     "060"     "261"     "167"     "066"     "136"    
##  [85] "143"     "082"     "063"     "230"     "174"     "234"     "245"    
##  [92] "173"     "236"     "084"     "240"     "229"     "241"     "231"    
##  [99] "175"     "176"     "228"     "244"     "227"     "237"     "274"    
## [106] "249"     "090"     "247"     "091"     "087"     "085"     "250"    
## [113] "222"     "093"     "239"     "233"     "088"     "271"     "092"    
## [120] "221"     "225"     "089"     "038"     "273"     "248"     "086"    
## [127] "031"     "030"     "103"     "028"     "098"     "055"     "075"    
## [134] "059"     "095"     "101"     "034"     "002"     "056"     "001"    
## [141] "099"     "102"     "012"     "076"     "079"     "080"     "104"    
## [148] "005"     "006"     "081"     "096"     "058"     "105"     "040"    
## [155] "029"     "036"     "057"     "035"     "010"     "094"     "032"    
## [162] "011"     "074"     "022"     "003"     "009"     "106"     "033"    
## [169] "013"     "097"     "007"     "008"     "078"     "037"     "182-2"  
## [176] "130-3"   "117-3"   "186-3"   "127-2"   "187-3"   "159-3"   "125-3"  
## [183] "178-4"   "151-3"   "109-2"   "158-2"   "121-3"   "181-1"   "190-3"  
## [190] "158-3"   "182-3"   "121-2"   "150-4"   "178-1"   "186-2"   "112-3"  
## [197] "159-4"   "115-1"   "188-1"   "181-3"   "128-2"   "151-2"   "183-1"  
## [204] "108-2"   "185-1"   "125-2"   "183-2"   "181-2"   "128-3"   "159-1"  
## [211] "121-1"   "154-1"   "185-2"   "155-4"   "120-4"   "182-4"   "162-3"  
## [218] "112-1"   "118-1"   "112-4"   "149-2"   "119-4"   "162-1"   "118-3"  
## [225] "188-3"   "186-4"   "151-1"   "154-2"   "159-2"   "113-3"   "149-4"  
## [232] "133-1"   "121-4"   "125-4"   "187-2"   "150-1"   "182-1"   "117-1"  
## [239] "156-4"   "113-1"   "189-2"   "149-1"   "133-4"   "133-3"   "118-4"  
## [246] "156-2"   "125-1"   "131-2"   "131-4"   "119-3"   "129-1"   "117-2"  
## [253] "160-2"   "132-1"   "186-1"   "189-1"   "120-3"   "178-2"   "151-4"  
## [260] "117-4"   "133-2"   "108-4"   "150-3"   "131-1"   "190-1"   "157-1"  
## [267] "178-3"   "158-1"   "129-4"   "156-1"   "109-1"   "126-3"   "184-1"  
## [274] "109-3"   "112-2"   "150-2"   "108-3"   "111-1"   "153-2"   "129-2"  
## [281] "108-1"   "187-1"   "185-3"   "119-2"   "135-1"   "158-4"   "130-4"  
## [288] "155-1"   "127-4"   "127-1"   "160-1"   "107-2"   "185-4"   "111-4"  
## [295] "111-3"   "155-3"   "149-3"   "130-1"   "120-1"   "126-2"   "134-1"  
## [302] "115-2"   "132-2"   "132-3"   "190-2"   "130-2"   "155-2"   "135-2"  
## [309] "184-2"   "131-3"   "107-4"   "153-3"   "179"     "107-1"   "111-2"  
## [316] "129-3"   "113-4"   "126-1"   "120-2"   "162-2"   "107-3"   "160-3"  
## [323] "153-4"   "119-1"   "118-2"   "155"     "157-2"   "156-3"   "128-4"  
## [330] "127-3"   "128-1"   "113-2"   "190-4"   "188-2"   "116-1"   "153-1"  
## [337] "lat"     "84-2"    "190-1-C" "M021"    "042"     "027"     "M023"   
## [344] "046"     "M054"    "073"     "069"     "049"     "M022"    "M048"   
## [351] "M045"    "M043"    "M046"    "044"     "024"     "015"     "054"    
## [358] "043"     "050"     "072"     "045"     "070"     "014"     "017"    
## [365] "023"     "021"     "019"     "067"     "048"     "052"     "020"    
## [372] "053"

Now - lets get rid of these bad MR from the original all_data2 file:

badMr <- subset(onlyMr, onlyMr$genotype == "root")
badMr
wrong_MR <- badMr$root
wrong_MR
##  [1] " 506f645e-11ef-4f56-809d-b68535967791"
##  [2] " b6640da9-642f-4afe-8885-8aef081c64f2"
##  [3] " 4db776d9-a41e-41db-95d3-5bbaf22712fa"
##  [4] " 4db776d9-a41e-41db-95d3-5bbaf22712fa"
##  [5] " b671303e-fa10-4a09-b4ec-40d709f73703"
##  [6] " 1f9d1645-51c0-4c5d-9ef2-e15aacd51a65"
##  [7] " 4db776d9-a41e-41db-95d3-5bbaf22712fa"
##  [8] " db20a3aa-2bc0-422d-bd9b-0c03f785f936"
##  [9] " 4db776d9-a41e-41db-95d3-5bbaf22712fa"
## [10] " 6c352368-f3d3-44a9-9d9b-1a6ac64b3636"
## [11] " f2fa1001-0b9b-4714-ab14-9baec299245b"
## [12] " e9280635-2275-4439-af3b-8d83ba551df1"
## [13] " b6f9a393-91fa-40b8-b537-06a06ead5808"
## [14] " a1c527ec-b83e-427b-8d3f-701df49f942f"
## [15] " e93664ce-1b47-4d7b-821a-78b92049879c"
## [16] " dd977aaa-fc38-4c4e-af58-fa3412af7478"
## [17] " 049886f7-3a40-40b9-a4a9-160e7c2948d3"
## [18] " 647a5d35-7a55-4281-8602-be4046f26ca1"
## [19] " a3fa1354-196b-4b71-99fd-21545cb9e6aa"
## [20] " 09d4bbd2-5f7f-4efe-a06e-aea8a173b02f"
## [21] " cfa05ed0-4cca-4b09-8611-b315d8a8dc16"
## [22] " 6b193102-e41c-401d-90ca-3278d1220e1e"
## [23] " eecb776e-7fc2-4483-8a76-83b299756f67"
## [24] " 7f9fe490-f3e2-4db2-bfdb-f99bf3968853"
## [25] " d349a5fe-d57a-4400-bbf5-a9f864c2c579"
## [26] " 5b21c373-b99f-4edd-855b-2c0058572012"
## [27] " 5c25081f-e122-4604-9992-e907871c3b30"
## [28] " 50e39a92-9f75-4e06-86d3-c1687d5607ba"
## [29] " 5c4da9cf-bfa1-4214-b742-23980e200fee"
## [30] " 0300e879-277a-42a5-bc56-60eb29191fb2"
## [31] " 72781b97-5153-4305-9e56-7a3ccbcc2cfd"
## [32] " 76c3fde7-6d57-4406-872e-842848557fbf"
## [33] " d57cf620-b86d-4690-baa4-fe3d5d5c42c9"
## [34] " 0b9bb4fa-4e37-41f1-8f34-c4016ee95cbc"
## [35] " 0312ee8b-ce63-41fe-b9ca-5975a5b8e9c1"
## [36] " f6dc240c-1da4-4dc6-93a8-841f9e0c9a87"
## [37] " a14ad38a-aeee-4232-ad73-93679ba0e3ec"
## [38] " 62ef00a2-985a-4e37-b0b1-bc58c00d3b36"
## [39] " 19114064-5bb5-4801-ad8d-1cd87f8d2066"
## [40] " fdf7d655-3e50-4be1-8584-46025962ed59"
## [41] " 4a17c7f3-6514-4fbf-9deb-a465778f4878"
## [42] " 95430a25-e2ed-4e93-850c-81239c27c9ca"
## [43] " 25957ad7-7a35-4bcd-a73e-dc80f57f2b1b"
## [44] " b09888c2-8f51-4543-8a11-3a8456f711ed"
## [45] " 4f862ef0-4077-49ac-8f75-9f1063893e84"
## [46] " 1d9b7ffe-4bb1-4626-8a0f-c95bb9da798b"
## [47] " 73fbb80f-108f-4c42-9715-756ebe44cbc7"
all_data2_single_MR <- all_data2[!(all_data2$root %in% wrong_MR),]
dim(all_data2_single_MR)
## [1] 58734    26
dim(all_data2)
## [1] 58801    26
length(unique((all_data2_single_MR$image)))
## [1] 8149
onlyMr3 <- subset(all_data2_single_MR, all_data2_single_MR$root_order == 0)
dim(onlyMr3)
## [1] 8144   26

So we still have just few images that supposedly contain more than 2 roots

Let’s look at these images:

names <- c(text="image", "MR.no", "LR.no")
check_table2 <- data.frame()

for (k in names) check_table2[[k]] <- as.character()

for (i in 1:8149) {
  uni <- subset(all_data2_single_MR, all_data2_single_MR$image == unique(all_data2_single_MR$image)[i])
  MR <- subset(uni, uni$root_order == 0)
  LR <- subset(uni, uni$root_order == 1)
  
  check_table2[i,1] <- as.character(unique(uni$image))
  check_table2[i,2] <- dim(MR)[1]
  check_table2[i,3] <- dim(LR)[1]
}

suspicious <- subset(check_table2, check_table2$MR.no > 1)
suspicious
closer_look <- subset(all_data2_single_MR, all_data2_single_MR$image == suspicious$image[1])
closer_look1 <- subset(closer_look, closer_look$root_order == 0)
closer_look1
closer_look <- subset(all_data2_single_MR, all_data2_single_MR$image == suspicious$image[2])
closer_look2 <- subset(closer_look, closer_look$root_order == 0)
closer_look2
closer_look <- subset(all_data2_single_MR, all_data2_single_MR$image == suspicious$image[3])
closer_look3 <- subset(closer_look, closer_look$root_order == 0)
closer_look3
closer_look <- subset(all_data2_single_MR, all_data2_single_MR$image == suspicious$image[4])
closer_look4 <- subset(closer_look, closer_look$root_order == 0)
closer_look4

The last closer_look3 - two roots should be removed - so we need to change this:

wrong <- closer_look3$root[c(1,2)]
wrong
## [1] " 83441bba-34e0-4f95-9839-0ca935a52d4c"
## [2] " 0a8c99b3-a98b-4688-9767-1e1e52553500"
wrong2 <- closer_look4$root[1]
wrong_all <- c(wrong,wrong2)
wrong_all
## [1] " 83441bba-34e0-4f95-9839-0ca935a52d4c"
## [2] " 0a8c99b3-a98b-4688-9767-1e1e52553500"
## [3] " 0a8c99b3-a98b-4688-9767-1e1e52553500"
all_data2_single_MR <- all_data2_single_MR[!(all_data2_single_MR$root %in% wrong_all),]
dim(all_data2_single_MR)
## [1] 58731    26

from the look of it - it seems we have two cases where we have exported twice the exact same root but one longer than the other (I presume longer is correct one). Problem is that their root and image are both identical.

After inspecting the images - it seems that: _set1_day3_20191002_238.tiff has > 2 lateral roots _set1_day3_20191002_001 has > 3 lateral roots

so in both cases - the 2nd Main Root is better. I am affraid that we will also get some oddness with positions of lateral roots. So maybe let’s inspect all the data belonging to these two images:

odd_stuff01 <- subset(all_data2_single_MR, all_data2_single_MR$image == "_set1_day3_20191002_238.rsml")
odd_stuff02 <- subset(all_data2_single_MR, all_data2_single_MR$image == "_set1_day3_20191002_001.rsml")
odd_stuff01
odd_stuff02

ok - so based on this data - it seems like: - the first 3 rows in odd_stuff01 are containing faulty data, and thus should be removed - the first 4 rows in odd_stuff02 are containing faulty data, and thus should be removed

So let’s remove these columns from individual odd_stuff files, remove the entire picture from the all_data2_single_MR, and then rbind() the odd_stuff together back into the all_data2_single_MR:

odd_stuff01 <- odd_stuff01[4:13,]
odd_stuff01
odd_stuff02 <- odd_stuff02[5:14,]
odd_stuff02
bye <- c("_set1_day3_20191002_238.rsml", "_set1_day3_20191002_001.rsml")
all_data3 <- subset(all_data2_single_MR, !(all_data2_single_MR$image %in% bye))
all_data3 <- rbind(all_data3, odd_stuff01)
all_data3 <- rbind(all_data3, odd_stuff02)
dim(all_data3)
## [1] 58724    26
length(unique(all_data3$image))
## [1] 8149

Let’s do a final check if we have NO other images that have two MR now:

length(unique(all_data3$image))
## [1] 8149
names <- c(text="image", "MR.no", "LR.no")
check_table2 <- data.frame()

for (k in names) check_table2[[k]] <- as.character()

for (i in 1:8149) {
  uni <- subset(all_data3, all_data3$image == unique(all_data3$image)[i])
  MR <- subset(uni, uni$root_order == 0)
  LR <- subset(uni, uni$root_order == 1)
  
  check_table2[i,1] <- as.character(unique(uni$image))
  check_table2[i,2] <- dim(MR)[1]
  check_table2[i,3] <- dim(LR)[1]
}

suspicious <- subset(check_table2, check_table2$MR.no > 1)
suspicious

Great - no suspicious images anymore - so we can move on :)

calculating desired traits:

Let’s now get rid of all the traits like volume and diameter that we are not directly interested in:

head(all_data3)
colnames(all_data3)
##  [1] "image"                 "root_name"             "root"                 
##  [4] "length"                "surface"               "volume"               
##  [7] "diameter"              "root_order"            "root_ontology"        
## [10] "parent_name"           "parent"                "insertion_position"   
## [13] "insertion_angle"       "n_child"               "child_density"        
## [16] "first_child"           "insertion_first_child" "last_child"           
## [19] "insertion_last_child"  "experiment"            "info"                 
## [22] "date"                  "root_info"             "genotype"             
## [25] "rep"                   "cond"
final <- all_data3[,c(1:3, 20, 22, 24:26, 4, 9, 11, 12:14,17,19)]
head(final)

then - we need to create a file that has all MR:

only_MR <- subset(final, final$root_ontology == unique(final$root_ontology)[1])
colnames(only_MR)[9] <- "MRL"
head(only_MR)

and since we dont need to calculate any LR related phenotypes for the plants that dont have LR - we need to subset our MR file a bit further:

no_LR_MR <- subset(only_MR, only_MR$n_child < 1)
only_MR <- subset(only_MR, only_MR$n_child > 0)
head(only_MR)
head(no_LR_MR)

Cool - there are now quite a lot of unneccessary information now - so let’s get to bare necessities:

colnames(only_MR)
##  [1] "image"                 "root_name"             "root"                 
##  [4] "experiment"            "date"                  "genotype"             
##  [7] "rep"                   "cond"                  "MRL"                  
## [10] "root_ontology"         "parent"                "insertion_position"   
## [13] "insertion_angle"       "n_child"               "insertion_first_child"
## [16] "insertion_last_child"
only_MR <- only_MR[,c(1:9,13:15)]
no_LR_MR <- no_LR_MR[,c(1:9,13:15)]
dim(only_MR)
## [1] 6664   12
head(only_MR)

We have the same root ID occurring multiple times - as we are tracing individual plants accross the time and transferring the data from one image to another - therefore - let’s check if it all adds up:

all_MR <- unique(only_MR$root)
length(all_MR)
## [1] 3110
all_img <- unique(only_MR$image)
length(all_img)
## [1] 6664
length(all_img) / length(all_MR)
## [1] 2.142765
only_MR$image_id <- paste(only_MR$image, "_", only_MR$root_name, sep="")
head(only_MR)
all_img_id <- unique(only_MR$image_id)
length(all_img_id)
## [1] 6664

Almost - but we will deal with it later.

So we have in total 6664 unique images - we will have to examine the LR belonging to each MR in each image by extracting them based on the “date”:

MR_now <- all_img[6664]
MR_now
## [1] "_set1_day3_20191002_001.rsml"
head(final)
super_temp <- subset(final, final$image %in% MR_now)
super_temp

Then - we need to create some info about the length of individual zones - for this we need info on MR_length:

MR_length <- subset(only_MR, only_MR$image %in% MR_now)
MR_length <- MR_length$MRL
MR_length
## [1] 5.284145

Length of Apical zone is basically equal to position of first lateral root Branched zone length is the position of last LR - position of first LR Basal zone is the MR length - position of last LR thus:

super_temp <- subset(super_temp, super_temp$root_ontology == unique(super_temp$root_ontology)[2])
super_temp
Apical <- min(super_temp$insertion_position)
Branched <- (max(super_temp$insertion_position) - Apical)
Basal <- MR_length - max(super_temp$insertion_position)
aLRL.median <- median(super_temp$length)
aLRL.SD <- sd(super_temp$length)
LRangle.median <- median(super_temp$insertion_angle)
LRangle.SD <- sd(super_temp$insertion_angle)


Apical
## [1] 0
Branched
## [1] 2.728526
Basal
## [1] 2.555619
aLRL.median
## [1] 0.4649159
aLRL.SD
## [1] 0.8579005
LRangle.median
## [1] 66.76294
LRangle.SD
## [1] 33.33675

Another thing that I am interested in is the distribution of LRL across the MR and how quickly that decreases across the MRL

super_temp
#super_temp$adj_position <- super_temp$insertion_position + 0.0000001
plot(super_temp$length ~ super_temp$insertion_position)
abline(lm(super_temp$length ~ super_temp$insertion_position))

model <- lm(super_temp$length ~ super_temp$insertion_position)
summary(model)
## 
## Call:
## lm(formula = super_temp$length ~ super_temp$insertion_position)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.27974 -0.14623 -0.03718  0.27756  0.93525 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                     1.7538     0.3756    4.67  0.00229 **
## super_temp$insertion_position  -0.5973     0.2254   -2.65  0.03293 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.648 on 7 degrees of freedom
## Multiple R-squared:  0.5009, Adjusted R-squared:  0.4296 
## F-statistic: 7.024 on 1 and 7 DF,  p-value: 0.03293
model$coefficients
##                   (Intercept) super_temp$insertion_position 
##                      1.753818                     -0.597283
LRL.START <- model$coefficients[[1]]
LRL.dec <- model$coefficients[[2]]
LRL.dec.R2 <- summary(model)$r.squared
LRL.dec.R2
## [1] 0.5008563
LRL.dec
## [1] -0.597283

Then - we can calculate the % of LR across the MR length - by dividing the MR into 4 or 10 parts

super_temp$LR_in_10_perc <- 0
super_temp$LR_in_20_perc <- 0
super_temp$LR_in_30_perc <- 0
super_temp$LR_in_40_perc <- 0
super_temp$LR_in_50_perc <- 0
super_temp$LR_in_60_perc <- 0
super_temp$LR_in_70_perc <- 0
super_temp$LR_in_80_perc <- 0
super_temp$LR_in_90_perc <- 0
super_temp$LR_in_100_perc <- 0


for(e in 1:nrow(super_temp)){
   if (super_temp$insertion_position[e] < (MR_length/10)){
    super_temp$LR_in_10_perc[e] <- 1
   } else {super_temp$LR_in_10_perc[e] <- 0}
  if (super_temp$insertion_position[e] < 2*(MR_length/10) & super_temp$insertion_position[e] > (MR_length/10)){
    super_temp$LR_in_20_perc[e] <- 1
  } else {super_temp$LR_in_20_perc[e] <- 0}
  if (super_temp$insertion_position[e] < 3*(MR_length/10) & super_temp$insertion_position[e] > 2*(MR_length/10)){
    super_temp$LR_in_30_perc[e] <- 1
  } else {super_temp$LR_in_30_perc[e] <- 0}
  if (super_temp$insertion_position[e] < 4*(MR_length/10) & super_temp$insertion_position[e] > 3*(MR_length/10)){
    super_temp$LR_in_40_perc[e] <- 1
  } else {super_temp$LR_in_40_perc[e] <- 0}
  if (super_temp$insertion_position[e] < 5*(MR_length/10) & super_temp$insertion_position[e] > 4*(MR_length/10)){
    super_temp$LR_in_50_perc[e] <- 1
  } else {super_temp$LR_in_50_perc[e] <- 0}
  if (super_temp$insertion_position[e] < 6*(MR_length/10) & super_temp$insertion_position[e] > 5*(MR_length/10)){
    super_temp$LR_in_60_perc[e] <- 1
  } else {super_temp$LR_in_60_perc[e] <- 0}
  if (super_temp$insertion_position[e] < 7*(MR_length/10) & super_temp$insertion_position[e] > 6*(MR_length/10)){
    super_temp$LR_in_70_perc[e] <- 1
  } else {super_temp$LR_in_70_perc[e] <- 0}
  if (super_temp$insertion_position[e] < 8*(MR_length/10) & super_temp$insertion_position[e] > 7*(MR_length/10)){
    super_temp$LR_in_80_perc[e] <- 1
  } else {super_temp$LR_in_80_perc[e] <- 0}
  if (super_temp$insertion_position[e] < 9*(MR_length/10) & super_temp$insertion_position[e] > 8*(MR_length/10)){
    super_temp$LR_in_90_perc[e] <- 1
  } else {super_temp$LR_in_90_perc[e] <- 0}
  if (super_temp$insertion_position[e] < 10*(MR_length/10) & super_temp$insertion_position[e] > 9*(MR_length/10)){
    super_temp$LR_in_100_perc[e] <- 1
  } else {super_temp$LR_in_100_perc[e] <- 0}
}

super_temp

so after classifying each LR to its respective portion of MR, we can then summarize them and calculate total LR length in this fragment:

super_temp$LRL_in_10_perc <- super_temp$length * super_temp$LR_in_10_perc
super_temp$LRL_in_20_perc <- super_temp$length * super_temp$LR_in_20_perc
super_temp$LRL_in_30_perc <- super_temp$length * super_temp$LR_in_30_perc
super_temp$LRL_in_40_perc <- super_temp$length * super_temp$LR_in_40_perc
super_temp$LRL_in_50_perc <- super_temp$length * super_temp$LR_in_50_perc
super_temp$LRL_in_60_perc <- super_temp$length * super_temp$LR_in_60_perc
super_temp$LRL_in_70_perc <- super_temp$length * super_temp$LR_in_70_perc
super_temp$LRL_in_80_perc <- super_temp$length * super_temp$LR_in_80_perc
super_temp$LRL_in_90_perc <- super_temp$length * super_temp$LR_in_90_perc
super_temp$LRL_in_100_perc <- super_temp$length * super_temp$LR_in_100_perc

LR_no_10_100 <- sum(super_temp$LR_in_10_perc)
LR_no_20_100 <- sum(super_temp$LR_in_20_perc)
LR_no_30_100 <- sum(super_temp$LR_in_30_perc)
LR_no_40_100 <- sum(super_temp$LR_in_40_perc)
LR_no_50_100 <- sum(super_temp$LR_in_50_perc)
LR_no_60_100 <- sum(super_temp$LR_in_60_perc)
LR_no_70_100 <- sum(super_temp$LR_in_70_perc)
LR_no_80_100 <- sum(super_temp$LR_in_80_perc)
LR_no_90_100 <- sum(super_temp$LR_in_90_perc)
LR_no_100_100 <- sum(super_temp$LR_in_100_perc)

LRL_10_100 <- sum(super_temp$LRL_in_10_perc)
LRL_20_100 <- sum(super_temp$LRL_in_20_perc)
LRL_30_100 <- sum(super_temp$LRL_in_30_perc)
LRL_40_100 <- sum(super_temp$LRL_in_40_perc)
LRL_50_100 <- sum(super_temp$LRL_in_50_perc)
LRL_60_100 <- sum(super_temp$LRL_in_60_perc)
LRL_70_100 <- sum(super_temp$LRL_in_70_perc)
LRL_80_100 <- sum(super_temp$LRL_in_80_perc)
LRL_90_100 <- sum(super_temp$LRL_in_90_perc)
LRL_100_100 <- sum(super_temp$LRL_in_100_perc)

OK - last but not least - we should calculate the center of gravity for LR:

super_temp$momentum <- (super_temp$insertion_position * super_temp$length)
all_momentum <- sum(super_temp$momentum)
all_momentum
## [1] 6.590597
all_length <- sum(super_temp$length)
all_length
## [1] 8.455498
CoG <- (all_momentum / all_length)
CoG
## [1] 0.7794452

Finally - let’s add all these values into our MR_only table

First we need to create needed columns:

only_MR$Apical <- 0
only_MR$Branched <- 0
only_MR$Basal <- 0
only_MR$aLRL.median <- 0
only_MR$aLRL.SD <- 0
only_MR$LRangle.median <- 0
only_MR$LRangle.SD <- 0

only_MR$Apical_perc <- 0
only_MR$Branched_perc <- 0
only_MR$Basal_perc <- 0
only_MR$LR_no_10_100 <- 0
only_MR$LR_no_20_100 <- 0
only_MR$LR_no_30_100 <- 0
only_MR$LR_no_40_100 <- 0
only_MR$LR_no_50_100 <- 0
only_MR$LR_no_60_100 <- 0
only_MR$LR_no_70_100 <- 0
only_MR$LR_no_80_100 <- 0
only_MR$LR_no_90_100 <- 0
only_MR$LR_no_100_100 <- 0

only_MR$LRL_10_100 <- 0
only_MR$LRL_20_100 <- 0
only_MR$LRL_30_100 <- 0
only_MR$LRL_40_100 <- 0
only_MR$LRL_50_100 <- 0
only_MR$LRL_60_100 <- 0
only_MR$LRL_70_100 <- 0
only_MR$LRL_80_100 <- 0
only_MR$LRL_90_100 <- 0
only_MR$LRL_100_100 <- 0

only_MR$CoG <- 0
only_MR$LRL.START <- 0
only_MR$LRL.dec <- 0
only_MR$LRL.dec.R2 <- 0
head(only_MR)

then add values to these columns:

only_MR$Apical[1] <- Apical
only_MR$Branched[1] <- Branched
only_MR$Basal[1] <- Basal
only_MR$aLRL.median[1] <- aLRL.median
only_MR$aLRL.SD[1] <- aLRL.SD
only_MR$LRangle.median[1] <- LRangle.median
only_MR$LRangle.SD[1] <- LRangle.SD

only_MR$Apical_perc[1] <- (Apical / MR_length)
only_MR$Branched_perc[1] <- (Branched / MR_length)
only_MR$Basal_perc[1] <- (Basal / MR_length)
only_MR$LR_no_10_100[1] <- LR_no_10_100
only_MR$LR_no_20_100[1] <- LR_no_20_100
only_MR$LR_no_30_100[1] <- LR_no_30_100
only_MR$LR_no_40_100[1] <- LR_no_40_100
only_MR$LR_no_50_100[1] <- LR_no_50_100
only_MR$LR_no_60_100[1] <- LR_no_60_100
only_MR$LR_no_70_100[1] <- LR_no_70_100
only_MR$LR_no_80_100[1] <- LR_no_80_100
only_MR$LR_no_90_100[1] <- LR_no_90_100
only_MR$LR_no_100_100[1] <- LR_no_100_100

only_MR$LRL_10_100[1] <- LRL_10_100
only_MR$LRL_20_100[1] <- LRL_20_100
only_MR$LRL_30_100[1] <- LRL_30_100
only_MR$LRL_40_100[1] <- LRL_40_100
only_MR$LRL_50_100[1] <- LRL_50_100
only_MR$LRL_60_100[1] <- LRL_60_100
only_MR$LRL_70_100[1] <- LRL_70_100
only_MR$LRL_80_100[1] <- LRL_80_100
only_MR$LRL_90_100[1] <- LRL_90_100
only_MR$LRL_100_100[1] <- LRL_100_100

only_MR$CoG[1] <- CoG
only_MR$LRL.START[1] <- LRL.START
only_MR$LRL.dec[1] <- LRL.dec
only_MR$LRL.dec.R2[1] <- LRL.dec.R2  

head(only_MR)

cool - looks good. Let’s loop it:

dim(final)
## [1] 58724    16
length(all_img)
## [1] 6664
for(i in c(2:6664)){
  MR_now <- all_img[i]
  super_temp <- subset(final, final$image %in% MR_now)
  MR_length <- subset(only_MR, only_MR$image %in% MR_now)
  MR_length <- MR_length$MRL
  super_temp <- subset(super_temp, super_temp$root_ontology == unique(super_temp$root_ontology)[2])
  Apical <- min(super_temp$insertion_position)
  Branched <- (max(super_temp$insertion_position) - Apical)
  Basal <- MR_length - max(super_temp$insertion_position)
  aLRL.median <- median(super_temp$length)
  aLRL.SD <- sd(super_temp$length)
  LRangle.median <- median(super_temp$insertion_angle)
  LRangle.SD <- sd(super_temp$insertion_angle)
  
  super_temp$LR_in_10_perc <- 0
  super_temp$LR_in_20_perc <- 0
  super_temp$LR_in_30_perc <- 0
  super_temp$LR_in_40_perc <- 0
  super_temp$LR_in_50_perc <- 0
  super_temp$LR_in_60_perc <- 0
  super_temp$LR_in_70_perc <- 0
  super_temp$LR_in_80_perc <- 0
  super_temp$LR_in_90_perc <- 0
  super_temp$LR_in_100_perc <- 0

  for(e in 1:nrow(super_temp)){
     if (super_temp$insertion_position[e] < (MR_length/10)){
      super_temp$LR_in_10_perc[e] <- 1
     } else {super_temp$LR_in_10_perc[e] <- 0}
    if (super_temp$insertion_position[e] < 2*(MR_length/10) & super_temp$insertion_position[e] > (MR_length/10)){
      super_temp$LR_in_20_perc[e] <- 1
    } else {super_temp$LR_in_20_perc[e] <- 0}
    if (super_temp$insertion_position[e] < 3*(MR_length/10) & super_temp$insertion_position[e] > 2*(MR_length/10)){
      super_temp$LR_in_30_perc[e] <- 1
    } else {super_temp$LR_in_30_perc[e] <- 0}
    if (super_temp$insertion_position[e] < 4*(MR_length/10) & super_temp$insertion_position[e] > 3*(MR_length/10)){
      super_temp$LR_in_40_perc[e] <- 1
    } else {super_temp$LR_in_40_perc[e] <- 0}
    if (super_temp$insertion_position[e] < 5*(MR_length/10) & super_temp$insertion_position[e] > 4*(MR_length/10)){
      super_temp$LR_in_50_perc[e] <- 1
    } else {super_temp$LR_in_50_perc[e] <- 0}
    if (super_temp$insertion_position[e] < 6*(MR_length/10) & super_temp$insertion_position[e] > 5*(MR_length/10)){
      super_temp$LR_in_60_perc[e] <- 1
    } else {super_temp$LR_in_60_perc[e] <- 0}
    if (super_temp$insertion_position[e] < 7*(MR_length/10) & super_temp$insertion_position[e] > 6*(MR_length/10)){
      super_temp$LR_in_70_perc[e] <- 1
    } else {super_temp$LR_in_70_perc[e] <- 0}
    if (super_temp$insertion_position[e] < 8*(MR_length/10) & super_temp$insertion_position[e] > 7*(MR_length/10)){
      super_temp$LR_in_80_perc[e] <- 1
    } else {super_temp$LR_in_80_perc[e] <- 0}
    if (super_temp$insertion_position[e] < 9*(MR_length/10) & super_temp$insertion_position[e] > 8*(MR_length/10)){
      super_temp$LR_in_90_perc[e] <- 1
    } else {super_temp$LR_in_90_perc[e] <- 0}
    if (super_temp$insertion_position[e] < 10*(MR_length/10) & super_temp$insertion_position[e] > 9*(MR_length/10)){
      super_temp$LR_in_100_perc[e] <- 1
    } else {super_temp$LR_in_100_perc[e] <- 0}
  } 

  super_temp$LRL_in_10_perc <- super_temp$length * super_temp$LR_in_10_perc
  super_temp$LRL_in_20_perc <- super_temp$length * super_temp$LR_in_20_perc
  super_temp$LRL_in_30_perc <- super_temp$length * super_temp$LR_in_30_perc
  super_temp$LRL_in_40_perc <- super_temp$length * super_temp$LR_in_40_perc
  super_temp$LRL_in_50_perc <- super_temp$length * super_temp$LR_in_50_perc
  super_temp$LRL_in_60_perc <- super_temp$length * super_temp$LR_in_60_perc
  super_temp$LRL_in_70_perc <- super_temp$length * super_temp$LR_in_70_perc
  super_temp$LRL_in_80_perc <- super_temp$length * super_temp$LR_in_80_perc
  super_temp$LRL_in_90_perc <- super_temp$length * super_temp$LR_in_90_perc
  super_temp$LRL_in_100_perc <- super_temp$length * super_temp$LR_in_100_perc
  
  LR_no_10_100 <- sum(super_temp$LR_in_10_perc)
  LR_no_20_100 <- sum(super_temp$LR_in_20_perc)
  LR_no_30_100 <- sum(super_temp$LR_in_30_perc)
  LR_no_40_100 <- sum(super_temp$LR_in_40_perc)
  LR_no_50_100 <- sum(super_temp$LR_in_50_perc)
  LR_no_60_100 <- sum(super_temp$LR_in_60_perc)
  LR_no_70_100 <- sum(super_temp$LR_in_70_perc)
  LR_no_80_100 <- sum(super_temp$LR_in_80_perc)
  LR_no_90_100 <- sum(super_temp$LR_in_90_perc)
  LR_no_100_100 <- sum(super_temp$LR_in_100_perc)
  
  LRL_10_100 <- sum(super_temp$LRL_in_10_perc)
  LRL_20_100 <- sum(super_temp$LRL_in_20_perc)
  LRL_30_100 <- sum(super_temp$LRL_in_30_perc)
  LRL_40_100 <- sum(super_temp$LRL_in_40_perc)
  LRL_50_100 <- sum(super_temp$LRL_in_50_perc)
  LRL_60_100 <- sum(super_temp$LRL_in_60_perc)
  LRL_70_100 <- sum(super_temp$LRL_in_70_perc)
  LRL_80_100 <- sum(super_temp$LRL_in_80_perc)
  LRL_90_100 <- sum(super_temp$LRL_in_90_perc)
  LRL_100_100 <- sum(super_temp$LRL_in_100_perc)
  
  super_temp$momentum <- (super_temp$insertion_position * super_temp$length)
  all_momentum <- sum(super_temp$momentum)
  all_length <- sum(super_temp$length)
  CoG <- (all_momentum / all_length)  
  
  if(dim(super_temp)[1] > 2){
  model <- lm(super_temp$length ~ super_temp$insertion_position)
  LRL.START <- model$coefficients[[1]]
  LRL.dec <- model$coefficients[[2]]
  LRL.dec.R2 <- summary(model)$r.squared
  } else {
    LRL.START <- "n.a."
    LRL.dec <- "n.a."
    LRL.dec.R2 <- "n.a."
  }
  
  
  only_MR$Apical[i] <- Apical
  only_MR$Branched[i] <- Branched
  only_MR$Basal[i] <- Basal
  only_MR$aLRL.median[i] <- aLRL.median
  only_MR$aLRL.SD[i] <- aLRL.SD
  only_MR$LRangle.median[i] <- LRangle.median
  only_MR$LRangle.SD[i] <- LRangle.SD

  
  only_MR$Apical_perc[i] <- (Apical / MR_length)
  only_MR$Branched_perc[i] <- (Branched / MR_length)
  only_MR$Basal_perc[i] <- (Basal / MR_length)
  only_MR$LR_no_10_100[i] <- LR_no_10_100
  only_MR$LR_no_20_100[i] <- LR_no_20_100
  only_MR$LR_no_30_100[i] <- LR_no_30_100
  only_MR$LR_no_40_100[i] <- LR_no_40_100
  only_MR$LR_no_50_100[i] <- LR_no_50_100
  only_MR$LR_no_60_100[i] <- LR_no_60_100
  only_MR$LR_no_70_100[i] <- LR_no_70_100
  only_MR$LR_no_80_100[i] <- LR_no_80_100
  only_MR$LR_no_90_100[i] <- LR_no_90_100
  only_MR$LR_no_100_100[i] <- LR_no_100_100
  
  only_MR$LRL_10_100[i] <- LRL_10_100
  only_MR$LRL_20_100[i] <- LRL_20_100
  only_MR$LRL_30_100[i] <- LRL_30_100
  only_MR$LRL_40_100[i] <- LRL_40_100
  only_MR$LRL_50_100[i] <- LRL_50_100
  only_MR$LRL_60_100[i] <- LRL_60_100
  only_MR$LRL_70_100[i] <- LRL_70_100
  only_MR$LRL_80_100[i] <- LRL_80_100
  only_MR$LRL_90_100[i] <- LRL_90_100
  only_MR$LRL_100_100[i] <- LRL_100_100
  
  only_MR$CoG[i] <- CoG
  only_MR$LRL.START[i] <- LRL.START
  only_MR$LRL.dec[i] <- LRL.dec
  only_MR$LRL.dec.R2[i] <- LRL.dec.R2  
}

let’s have a look at the entire table:

head(only_MR)
tail(only_MR)

then- we need to fuse all the main roots that dont own LR

Make sure that the data structure is the same as for the only_MR file

head(no_LR_MR)

let’s add missing collumns:

no_LR_MR$Apical <- "n.a."
no_LR_MR$Branched <- "n.a."
no_LR_MR$Basal <- "n.a."
no_LR_MR$aLRL.median <- "n.a."
no_LR_MR$aLRL.SD <- "n.a."
no_LR_MR$LRangle.median <- "n.a."
no_LR_MR$LRangle.SD <- "n.a."
no_LR_MR$Apical_perc <- "n.a."
no_LR_MR$Branched_perc <- "n.a."
no_LR_MR$Basal_perc <- "n.a."


no_LR_MR$LR_no_10_100 <- 0
no_LR_MR$LR_no_20_100 <- 0
no_LR_MR$LR_no_30_100 <- 0
no_LR_MR$LR_no_40_100 <- 0
no_LR_MR$LR_no_50_100 <- 0
no_LR_MR$LR_no_60_100 <- 0
no_LR_MR$LR_no_70_100 <- 0
no_LR_MR$LR_no_80_100 <- 0
no_LR_MR$LR_no_90_100 <- 0
no_LR_MR$LR_no_100_100 <- 0

no_LR_MR$LRL_10_100 <- 0
no_LR_MR$LRL_20_100 <- 0
no_LR_MR$LRL_30_100 <- 0
no_LR_MR$LRL_40_100 <- 0
no_LR_MR$LRL_50_100 <- 0
no_LR_MR$LRL_60_100 <- 0
no_LR_MR$LRL_70_100 <- 0
no_LR_MR$LRL_80_100 <- 0
no_LR_MR$LRL_90_100 <- 0
no_LR_MR$LRL_100_100 <- 0

no_LR_MR$CoG <- 0
no_LR_MR$LRL.START <- "n.a."
no_LR_MR$LRL.dec <- "n.a."
no_LR_MR$LRL.dec.R2 <- "n.a."

finally - let’s fuse the two files together:

colnames(only_MR) %in% colnames(no_LR_MR)
##  [1]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
## [13] FALSE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
## [25]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
## [37]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
dim(only_MR)
## [1] 6664   47
only_MR <- only_MR[,c(1:12,14:47)]
all_MR <- rbind(only_MR, no_LR_MR)
head(all_MR)
dim(all_MR)
## [1] 8139   46
length(unique(all_MR$root_name))
## [1] 1637
length(unique(all_MR$image))
## [1] 8139
length(unique(all_MR$image))/length(unique(all_MR$root_name))
## [1] 4.9719

Let’s add some more interesting columns:

all_MR$LRL <- (all_MR$LRL_10_100 + all_MR$LRL_20_100 + all_MR$LRL_30_100 + all_MR$LRL_40_100 + all_MR$LRL_50_100 + all_MR$LRL_60_100 + all_MR$LRL_70_100 + all_MR$LRL_80_100 + all_MR$LRL_90_100 + all_MR$LRL_100_100)
all_MR$LRno <- (all_MR$LR_no_10_100 + all_MR$LR_no_20_100 + all_MR$LR_no_30_100 + all_MR$LR_no_40_100 + all_MR$LR_no_50_100 + all_MR$LR_no_60_100 + all_MR$LR_no_70_100 + all_MR$LR_no_80_100 + all_MR$LR_no_90_100 + all_MR$LR_no_100_100)
all_MR$aLRL <- all_MR$LRL / all_MR$LRno
all_MR$TRS <- all_MR$MRL + all_MR$LRL
head(all_MR)
tail(all_MR)

There is still something off with some of the genotypes that are being separated by the - rather than by _ - and all is specific to Big05

unique(all_MR$genotype)
##   [1] " 189"     " 292"     " 213"     " 212"     " 307"     " 282"    
##   [7] " 298"     " 301"     " 286"     " 214"     " 194"     " 294"    
##  [13] " 285"     " 293"     " 284"     " 278"     " 300"     " 201"    
##  [19] " 279"     " 280"     " 299"     " 200"     " 211"     " 308"    
##  [25] " 197"     " 287"     " 196"     " 220"     " 207"     " 290"    
##  [31] " 198"     " 195"     " 289"     " 288"     " 291"     " 2800"   
##  [37] " 199"     " 277"     " 283"     " 306"     " 235"     " 192"    
##  [43] " 147"     " 252"     " 166"     " 269"     " 064"     " 253"    
##  [49] " 193"     " 146"     " 141"     " 251"     " 139"     " 169"    
##  [55] " 258"     " 144"     " 138"     " 061"     " 065"     " 170"    
##  [61] " 142"     " 140"     " 168"     " 272"     " 165"     " 255"    
##  [67] " 260"     " 264"     " 262"     " 261"     " 167"     " 060"    
##  [73] " 066"     " 136"     " 256"     " 143"     " 171"     " 082"    
##  [79] " 083"     " 191"     " 259"     " 062"     " 172"     " 063"    
##  [85] " 270"     " 268"     " 267"     " 234"     " 245"     " 173"    
##  [91] " 236"     " 084"     " 229"     " 241"     " 231"     " 227"    
##  [97] " 176"     " 087"     " 091"     " 090"     " 085"     " 228"    
## [103] " 230"     " 175"     " 250"     " 222"     " 239"     " 233"    
## [109] " 274"     " 088"     " 271"     " 240"     " 092"     " 089"    
## [115] " 247"     " 038"     " 248"     " 086"     " 273"     " 244"    
## [121] " 093"     " 174"     " 249"     " 237"     " 221"     " 225"    
## [127] " 103"     " 028"     " 098"     " 055"     " 075"     " 059"    
## [133] " 101"     " 034"     " 002"     " 030"     " 056"     " 001"    
## [139] " 102"     " 012"     " 076"     " 079"     " 104"     " 081"    
## [145] " 096"     " 058"     " 099"     " 105"     " 040"     " 035"    
## [151] " 094"     " 074"     " 032"     " 022"     " 003"     " 095"    
## [157] " 009"     " 106"     " 057"     " 033"     " 029"     " 013"    
## [163] " 031"     " 007"     " 008"     " 006"     " 080"     " 005"    
## [169] " 036"     " 011"     " 078"     " 010"     " 097"     " 037"    
## [175] " 182-2"   " 130-3"   " 187-3"   " 159-3"   " 125-3"   " 178-4"  
## [181] " 151-3"   " 109-2"   " 186-3"   " 121-3"   " 181-1"   " 158-3"  
## [187] " 182-3"   " 121-2"   " 150-4"   " 178-1"   " 186-2"   " 112-3"  
## [193] " 159-4"   " 115-1"   " 188-1"   " 181-3"   " 128-2"   " 151-2"  
## [199] " 183-1"   " 108-2"   " 185-1"   " 125-2"   " 183-2"   " 181-2"  
## [205] " 128-3"   " 117-3"   " 159-1"   " 121-1"   " 154-1"   " 120-4"  
## [211] " 182-4"   " 162-3"   " 112-1"   " 118-1"   " 112-4"   " 149-2"  
## [217] " 119-4"   " 162-1"   " 118-3"   " 188-3"   " 186-4"   " 151-1"  
## [223] " 154-2"   " 159-2"   " 113-3"   " 149-4"   " 133-1"   " 121-4"  
## [229] " 125-4"   " 187-2"   " 127-2"   " 150-1"   " 182-1"   " 117-1"  
## [235] " 156-4"   " 113-1"   " 189-2"   " 133-4"   " 118-4"   " 156-2"  
## [241] " 125-1"   " 131-2"   " 131-4"   " 129-1"   " 117-2"   " 160-2"  
## [247] " 132-1"   " 186-1"   " 120-3"   " 151-4"   " 117-4"   " 133-2"  
## [253] " 108-4"   " 131-1"   " 190-1"   " 157-1"   " 178-3"   " 158-1"  
## [259] " 129-4"   " 156-1"   " 109-1"   " 126-3"   " 184-1"   " 109-3"  
## [265] " 112-2"   " 108-3"   " 153-2"   " 129-2"   " 108-1"   " 187-1"  
## [271] " 185-3"   " 111-1"   " 119-2"   " 150-3"   " 158-4"   " 130-4"  
## [277] " 155-1"   " 127-4"   " 127-1"   " 185-2"   " 155-4"   " 119-3"  
## [283] " 107-2"   " 149-1"   " 185-4"   " 111-4"   " 111-3"   " 149-3"  
## [289] " 130-1"   " 120-1"   " 115-2"   " 132-3"   " 189-1"   " 190-2"  
## [295] " 130-2"   " 155-2"   " 184-2"   " 131-3"   " 107-4"   " 179"    
## [301] " 107-1"   " 111-2"   " 129-3"   " 113-4"   " 126-1"   " 120-2"  
## [307] " 190-3"   " 135-1"   " 162-2"   " 107-3"   " 160-3"   " 153-4"  
## [313] " 119-1"   " 118-2"   " 155"     " 132-2"   " 157-2"   " 150-2"  
## [319] " 156-3"   " 155-3"   " 128-4"   " 127-3"   " 126-2"   " 135-2"  
## [325] " 133-3"   " 153-3"   " 178-2"   " 128-1"   " 113-2"   " 158-2"  
## [331] " 190-4"   " 160-1"   " 153-1"   " 188-2"   " 116-1"   " 84-2"   
## [337] " 190-1-C" " M023"    " M054"    " M022"    " M043"    " 044"    
## [343] " 015"     " 054"     " 045"     " 049"     " 050"     " 024"    
## [349] " 072"     " 023"     " 069"     " 043"     " 048"     " 052"    
## [355] " 073"     " 053"     " 020"     " 042"     " 021"     " 027"    
## [361] " M048"    " M045"    " M046"    " 070"     " 014"     " 017"    
## [367] " 067"     " 046"     " 019"     " M021"    " 134-1"
subset(all_MR, all_MR$genotype == " 107-1")
funk01 <- subset(all_MR, all_MR$experiment == "Big05")
funk01$info <- strsplit(funk01$genotype, "-")
funk01$cond <- funk01$rep

dim(funk01)
## [1] 1484   51
for(i in 1:1484){
  funk01$genotype[i] <- sapply(funk01$info[i], function(x){
  x[1]})
  funk01$rep[i] <- sapply(funk01$info[i], function(x){
  x[2]})
}
head(funk01)
colnames(funk01)
##  [1] "image"                 "root_name"             "root"                 
##  [4] "experiment"            "date"                  "genotype"             
##  [7] "rep"                   "cond"                  "MRL"                  
## [10] "insertion_angle"       "n_child"               "insertion_first_child"
## [13] "Apical"                "Branched"              "Basal"                
## [16] "aLRL.median"           "aLRL.SD"               "LRangle.median"       
## [19] "LRangle.SD"            "Apical_perc"           "Branched_perc"        
## [22] "Basal_perc"            "LR_no_10_100"          "LR_no_20_100"         
## [25] "LR_no_30_100"          "LR_no_40_100"          "LR_no_50_100"         
## [28] "LR_no_60_100"          "LR_no_70_100"          "LR_no_80_100"         
## [31] "LR_no_90_100"          "LR_no_100_100"         "LRL_10_100"           
## [34] "LRL_20_100"            "LRL_30_100"            "LRL_40_100"           
## [37] "LRL_50_100"            "LRL_60_100"            "LRL_70_100"           
## [40] "LRL_80_100"            "LRL_90_100"            "LRL_100_100"          
## [43] "CoG"                   "LRL.START"             "LRL.dec"              
## [46] "LRL.dec.R2"            "LRL"                   "LRno"                 
## [49] "aLRL"                  "TRS"                   "info"
funk01 <- funk01[,c(1:50)]

all_MR2 <- subset(all_MR, all_MR$experiment != "Big05")
all_MR3 <- rbind(all_MR2, funk01)
unique(all_MR3$genotype)
##   [1] " 189"  " 292"  " 213"  " 212"  " 307"  " 282"  " 298"  " 301"  " 286" 
##  [10] " 214"  " 194"  " 294"  " 285"  " 293"  " 284"  " 278"  " 300"  " 201" 
##  [19] " 279"  " 280"  " 299"  " 200"  " 211"  " 308"  " 197"  " 287"  " 196" 
##  [28] " 220"  " 207"  " 290"  " 198"  " 195"  " 289"  " 288"  " 291"  " 2800"
##  [37] " 199"  " 277"  " 283"  " 306"  " 235"  " 192"  " 147"  " 252"  " 166" 
##  [46] " 269"  " 064"  " 253"  " 193"  " 146"  " 141"  " 251"  " 139"  " 169" 
##  [55] " 258"  " 144"  " 138"  " 061"  " 065"  " 170"  " 142"  " 140"  " 168" 
##  [64] " 272"  " 165"  " 255"  " 260"  " 264"  " 262"  " 261"  " 167"  " 060" 
##  [73] " 066"  " 136"  " 256"  " 143"  " 171"  " 082"  " 083"  " 191"  " 259" 
##  [82] " 062"  " 172"  " 063"  " 270"  " 268"  " 267"  " 234"  " 245"  " 173" 
##  [91] " 236"  " 084"  " 229"  " 241"  " 231"  " 227"  " 176"  " 087"  " 091" 
## [100] " 090"  " 085"  " 228"  " 230"  " 175"  " 250"  " 222"  " 239"  " 233" 
## [109] " 274"  " 088"  " 271"  " 240"  " 092"  " 089"  " 247"  " 038"  " 248" 
## [118] " 086"  " 273"  " 244"  " 093"  " 174"  " 249"  " 237"  " 221"  " 225" 
## [127] " 103"  " 028"  " 098"  " 055"  " 075"  " 059"  " 101"  " 034"  " 002" 
## [136] " 030"  " 056"  " 001"  " 102"  " 012"  " 076"  " 079"  " 104"  " 081" 
## [145] " 096"  " 058"  " 099"  " 105"  " 040"  " 035"  " 094"  " 074"  " 032" 
## [154] " 022"  " 003"  " 095"  " 009"  " 106"  " 057"  " 033"  " 029"  " 013" 
## [163] " 031"  " 007"  " 008"  " 006"  " 080"  " 005"  " 036"  " 011"  " 078" 
## [172] " 010"  " 097"  " 037"  " M023" " M054" " M022" " M043" " 044"  " 015" 
## [181] " 054"  " 045"  " 049"  " 050"  " 024"  " 072"  " 023"  " 069"  " 043" 
## [190] " 048"  " 052"  " 073"  " 053"  " 020"  " 042"  " 021"  " 027"  " M048"
## [199] " M045" " M046" " 070"  " 014"  " 017"  " 067"  " 046"  " 019"  " M021"
## [208] " 182"  " 130"  " 187"  " 159"  " 125"  " 178"  " 151"  " 109"  " 186" 
## [217] " 121"  " 181"  " 158"  " 150"  " 112"  " 115"  " 188"  " 128"  " 183" 
## [226] " 108"  " 185"  " 117"  " 154"  " 120"  " 162"  " 118"  " 149"  " 119" 
## [235] " 113"  " 133"  " 127"  " 156"  " 131"  " 129"  " 160"  " 132"  " 190" 
## [244] " 157"  " 126"  " 184"  " 153"  " 111"  " 155"  " 107"  " 179"  " 135" 
## [253] " 116"  " 84"   " 134"

Now - we have an issue that some genotypes are called M023 rather than 023 - let’s replace this:

all_MR3$genotype <- gsub("M", "", all_MR3$genotype)
unique(all_MR3$genotype)
##   [1] " 189"  " 292"  " 213"  " 212"  " 307"  " 282"  " 298"  " 301"  " 286" 
##  [10] " 214"  " 194"  " 294"  " 285"  " 293"  " 284"  " 278"  " 300"  " 201" 
##  [19] " 279"  " 280"  " 299"  " 200"  " 211"  " 308"  " 197"  " 287"  " 196" 
##  [28] " 220"  " 207"  " 290"  " 198"  " 195"  " 289"  " 288"  " 291"  " 2800"
##  [37] " 199"  " 277"  " 283"  " 306"  " 235"  " 192"  " 147"  " 252"  " 166" 
##  [46] " 269"  " 064"  " 253"  " 193"  " 146"  " 141"  " 251"  " 139"  " 169" 
##  [55] " 258"  " 144"  " 138"  " 061"  " 065"  " 170"  " 142"  " 140"  " 168" 
##  [64] " 272"  " 165"  " 255"  " 260"  " 264"  " 262"  " 261"  " 167"  " 060" 
##  [73] " 066"  " 136"  " 256"  " 143"  " 171"  " 082"  " 083"  " 191"  " 259" 
##  [82] " 062"  " 172"  " 063"  " 270"  " 268"  " 267"  " 234"  " 245"  " 173" 
##  [91] " 236"  " 084"  " 229"  " 241"  " 231"  " 227"  " 176"  " 087"  " 091" 
## [100] " 090"  " 085"  " 228"  " 230"  " 175"  " 250"  " 222"  " 239"  " 233" 
## [109] " 274"  " 088"  " 271"  " 240"  " 092"  " 089"  " 247"  " 038"  " 248" 
## [118] " 086"  " 273"  " 244"  " 093"  " 174"  " 249"  " 237"  " 221"  " 225" 
## [127] " 103"  " 028"  " 098"  " 055"  " 075"  " 059"  " 101"  " 034"  " 002" 
## [136] " 030"  " 056"  " 001"  " 102"  " 012"  " 076"  " 079"  " 104"  " 081" 
## [145] " 096"  " 058"  " 099"  " 105"  " 040"  " 035"  " 094"  " 074"  " 032" 
## [154] " 022"  " 003"  " 095"  " 009"  " 106"  " 057"  " 033"  " 029"  " 013" 
## [163] " 031"  " 007"  " 008"  " 006"  " 080"  " 005"  " 036"  " 011"  " 078" 
## [172] " 010"  " 097"  " 037"  " 023"  " 054"  " 043"  " 044"  " 015"  " 045" 
## [181] " 049"  " 050"  " 024"  " 072"  " 069"  " 048"  " 052"  " 073"  " 053" 
## [190] " 020"  " 042"  " 021"  " 027"  " 046"  " 070"  " 014"  " 017"  " 067" 
## [199] " 019"  " 182"  " 130"  " 187"  " 159"  " 125"  " 178"  " 151"  " 109" 
## [208] " 186"  " 121"  " 181"  " 158"  " 150"  " 112"  " 115"  " 188"  " 128" 
## [217] " 183"  " 108"  " 185"  " 117"  " 154"  " 120"  " 162"  " 118"  " 149" 
## [226] " 119"  " 113"  " 133"  " 127"  " 156"  " 131"  " 129"  " 160"  " 132" 
## [235] " 190"  " 157"  " 126"  " 184"  " 153"  " 111"  " 155"  " 107"  " 179" 
## [244] " 135"  " 116"  " 84"   " 134"

OK - great - the last mistake to correct is the genotype “2800”, which should be “280” and " 84" should be " 084"

all_MR3$genotype <- gsub(" 2800", " 280", all_MR3$genotype)
all_MR3$genotype <- gsub(" 84", " 084", all_MR3$genotype)
unique(all_MR3$genotype)
##   [1] " 189" " 292" " 213" " 212" " 307" " 282" " 298" " 301" " 286" " 214"
##  [11] " 194" " 294" " 285" " 293" " 284" " 278" " 300" " 201" " 279" " 280"
##  [21] " 299" " 200" " 211" " 308" " 197" " 287" " 196" " 220" " 207" " 290"
##  [31] " 198" " 195" " 289" " 288" " 291" " 199" " 277" " 283" " 306" " 235"
##  [41] " 192" " 147" " 252" " 166" " 269" " 064" " 253" " 193" " 146" " 141"
##  [51] " 251" " 139" " 169" " 258" " 144" " 138" " 061" " 065" " 170" " 142"
##  [61] " 140" " 168" " 272" " 165" " 255" " 260" " 264" " 262" " 261" " 167"
##  [71] " 060" " 066" " 136" " 256" " 143" " 171" " 082" " 083" " 191" " 259"
##  [81] " 062" " 172" " 063" " 270" " 268" " 267" " 234" " 245" " 173" " 236"
##  [91] " 084" " 229" " 241" " 231" " 227" " 176" " 087" " 091" " 090" " 085"
## [101] " 228" " 230" " 175" " 250" " 222" " 239" " 233" " 274" " 088" " 271"
## [111] " 240" " 092" " 089" " 247" " 038" " 248" " 086" " 273" " 244" " 093"
## [121] " 174" " 249" " 237" " 221" " 225" " 103" " 028" " 098" " 055" " 075"
## [131] " 059" " 101" " 034" " 002" " 030" " 056" " 001" " 102" " 012" " 076"
## [141] " 079" " 104" " 081" " 096" " 058" " 099" " 105" " 040" " 035" " 094"
## [151] " 074" " 032" " 022" " 003" " 095" " 009" " 106" " 057" " 033" " 029"
## [161] " 013" " 031" " 007" " 008" " 006" " 080" " 005" " 036" " 011" " 078"
## [171] " 010" " 097" " 037" " 023" " 054" " 043" " 044" " 015" " 045" " 049"
## [181] " 050" " 024" " 072" " 069" " 048" " 052" " 073" " 053" " 020" " 042"
## [191] " 021" " 027" " 046" " 070" " 014" " 017" " 067" " 019" " 182" " 130"
## [201] " 187" " 159" " 125" " 178" " 151" " 109" " 186" " 121" " 181" " 158"
## [211] " 150" " 112" " 115" " 188" " 128" " 183" " 108" " 185" " 117" " 154"
## [221] " 120" " 162" " 118" " 149" " 119" " 113" " 133" " 127" " 156" " 131"
## [231] " 129" " 160" " 132" " 190" " 157" " 126" " 184" " 153" " 111" " 155"
## [241] " 107" " 179" " 135" " 116" " 134"

Let’s check if conditions are all right:

unique(all_MR3$cond)
## [1] "C" "S" NA  "s" "c" "1"
all_MR3$cond <- gsub("s", "S", all_MR3$cond)
all_MR3$cond <- gsub("c", "C", all_MR3$cond)
subset(all_MR3, all_MR3$cond == "1")
all_MR3$cond <- gsub("1", "C", all_MR3$cond)

funky02 <- subset(all_MR3, all_MR3$root == " 5976b290-addf-4934-b785-a61ced91b23d")
funky02$rep <- "1"

all_MR4 <- subset(all_MR3, all_MR3$root != " 5976b290-addf-4934-b785-a61ced91b23d")
all_MR5 <- rbind(all_MR4, funky02)

unique(all_MR5$genotype)
##   [1] " 189" " 292" " 213" " 212" " 307" " 282" " 298" " 301" " 286" " 214"
##  [11] " 194" " 294" " 285" " 293" " 284" " 278" " 300" " 201" " 279" " 280"
##  [21] " 299" " 200" " 211" " 308" " 197" " 287" " 196" " 220" " 207" " 290"
##  [31] " 198" " 195" " 289" " 288" " 291" " 199" " 277" " 283" " 306" " 235"
##  [41] " 192" " 147" " 252" " 166" " 269" " 064" " 253" " 193" " 146" " 141"
##  [51] " 251" " 139" " 169" " 258" " 144" " 138" " 061" " 065" " 170" " 142"
##  [61] " 140" " 168" " 272" " 165" " 255" " 260" " 264" " 262" " 261" " 167"
##  [71] " 060" " 066" " 136" " 256" " 143" " 171" " 082" " 083" " 191" " 259"
##  [81] " 062" " 172" " 063" " 270" " 268" " 267" " 234" " 245" " 173" " 236"
##  [91] " 084" " 229" " 241" " 231" " 227" " 176" " 087" " 091" " 090" " 085"
## [101] " 228" " 230" " 175" " 250" " 222" " 239" " 233" " 274" " 088" " 271"
## [111] " 240" " 092" " 089" " 247" " 038" " 248" " 086" " 273" " 244" " 093"
## [121] " 174" " 249" " 237" " 221" " 225" " 103" " 028" " 098" " 055" " 075"
## [131] " 059" " 101" " 034" " 002" " 030" " 056" " 001" " 102" " 012" " 076"
## [141] " 079" " 104" " 081" " 096" " 058" " 099" " 105" " 040" " 035" " 094"
## [151] " 074" " 032" " 022" " 003" " 095" " 009" " 106" " 057" " 033" " 029"
## [161] " 013" " 031" " 007" " 008" " 006" " 080" " 005" " 036" " 011" " 078"
## [171] " 010" " 097" " 037" " 023" " 054" " 043" " 044" " 015" " 045" " 049"
## [181] " 050" " 024" " 072" " 069" " 048" " 052" " 073" " 053" " 020" " 042"
## [191] " 021" " 027" " 046" " 070" " 014" " 017" " 067" " 019" " 182" " 130"
## [201] " 187" " 159" " 125" " 178" " 151" " 109" " 186" " 121" " 181" " 158"
## [211] " 150" " 112" " 115" " 188" " 128" " 183" " 108" " 185" " 117" " 154"
## [221] " 120" " 162" " 118" " 149" " 119" " 113" " 133" " 127" " 156" " 131"
## [231] " 129" " 160" " 132" " 190" " 157" " 126" " 184" " 153" " 111" " 155"
## [241] " 107" " 179" " 135" " 116" " 134"
unique(all_MR5$cond)
## [1] "C" "S" NA
want <- c("S", "C")
all_MR6 <- subset(all_MR5, all_MR5$cond %in% want)
unique(all_MR6$genotype)
##   [1] " 189" " 292" " 213" " 212" " 307" " 282" " 298" " 301" " 286" " 214"
##  [11] " 194" " 294" " 285" " 293" " 284" " 278" " 300" " 201" " 279" " 280"
##  [21] " 299" " 200" " 211" " 308" " 197" " 287" " 196" " 220" " 207" " 290"
##  [31] " 198" " 195" " 289" " 288" " 291" " 199" " 277" " 283" " 306" " 235"
##  [41] " 192" " 147" " 252" " 166" " 269" " 064" " 253" " 193" " 146" " 141"
##  [51] " 251" " 139" " 169" " 258" " 144" " 138" " 061" " 065" " 170" " 142"
##  [61] " 140" " 168" " 272" " 165" " 255" " 260" " 264" " 262" " 261" " 167"
##  [71] " 060" " 066" " 136" " 256" " 143" " 171" " 082" " 083" " 191" " 259"
##  [81] " 062" " 172" " 063" " 270" " 268" " 267" " 234" " 245" " 173" " 236"
##  [91] " 084" " 229" " 241" " 231" " 227" " 176" " 087" " 091" " 090" " 085"
## [101] " 228" " 230" " 175" " 250" " 222" " 239" " 233" " 274" " 088" " 271"
## [111] " 240" " 092" " 089" " 247" " 038" " 248" " 086" " 273" " 244" " 093"
## [121] " 174" " 249" " 237" " 221" " 225" " 103" " 028" " 098" " 055" " 075"
## [131] " 059" " 101" " 034" " 002" " 030" " 056" " 001" " 102" " 012" " 076"
## [141] " 079" " 104" " 081" " 096" " 058" " 099" " 105" " 040" " 035" " 094"
## [151] " 074" " 032" " 022" " 003" " 095" " 009" " 106" " 057" " 033" " 029"
## [161] " 013" " 031" " 007" " 008" " 006" " 080" " 005" " 036" " 011" " 078"
## [171] " 010" " 097" " 037" " 023" " 054" " 043" " 044" " 015" " 045" " 049"
## [181] " 050" " 024" " 072" " 069" " 048" " 052" " 073" " 053" " 020" " 042"
## [191] " 021" " 027" " 046" " 070" " 014" " 017" " 067" " 019" " 182" " 130"
## [201] " 187" " 159" " 125" " 178" " 151" " 109" " 186" " 121" " 181" " 158"
## [211] " 150" " 112" " 115" " 188" " 128" " 183" " 108" " 185" " 117" " 154"
## [221] " 120" " 162" " 118" " 149" " 119" " 113" " 133" " 127" " 156" " 131"
## [231] " 129" " 160" " 132" " 190" " 157" " 126" " 184" " 153" " 111" " 155"
## [241] " 107" " 179" " 135" " 116" " 134"
unique(all_MR6$cond)
## [1] "C" "S"
all_MR <- all_MR6

data visualization

OK - now we have all the traits calculated - but we are still missing the DAY information - as in DAY after stress. So let’s calculate it per experiment:

head(all_MR)
unique(all_MR[,c("experiment", "date")])

based on the above - we have the following

day Big01 Big02 Big03 Big04 Big05 Big06
day 0 - 20190909 20190923 20190930 20191008 20191019 20191101 day 1 - 20190910 20190924 20191001 20191009 20191020 20191102 day 2 - 20190911 20190925 20191002 20191010 20191021 20191103 day 3 - 20190912 20190926 20191003 20191011 20191022 20191104 day 4 - 20190913 20190927 20191004 20191012 20191023 20191105

So now we have to do conditional formating for DAS (Days After Stress):

all_MR$DAS <- all_MR$date
all_MR$DAS <- gsub("20190909", "0", all_MR$DAS)
all_MR$DAS <- gsub("20190923", "0", all_MR$DAS)
all_MR$DAS <- gsub("20190930", "0", all_MR$DAS)
all_MR$DAS <- gsub("20191008", "0", all_MR$DAS)
all_MR$DAS <- gsub("20191019", "0", all_MR$DAS)
all_MR$DAS <- gsub("20191101", "0", all_MR$DAS)

all_MR$DAS <- gsub("20190910", "1", all_MR$DAS)
all_MR$DAS <- gsub("20190924", "1", all_MR$DAS)
all_MR$DAS <- gsub("20191001", "1", all_MR$DAS)
all_MR$DAS <- gsub("20191009", "1", all_MR$DAS)
all_MR$DAS <- gsub("20191020", "1", all_MR$DAS)
all_MR$DAS <- gsub("20191102", "1", all_MR$DAS)

all_MR$DAS <- gsub("20190911", "2", all_MR$DAS)
all_MR$DAS <- gsub("20190925", "2", all_MR$DAS)
all_MR$DAS <- gsub("20191002", "2", all_MR$DAS)
all_MR$DAS <- gsub("20191010", "2", all_MR$DAS)
all_MR$DAS <- gsub("20191021", "2", all_MR$DAS)
all_MR$DAS <- gsub("20191103", "2", all_MR$DAS)

all_MR$DAS <- gsub("20190912", "3", all_MR$DAS)
all_MR$DAS <- gsub("20190926", "3", all_MR$DAS)
all_MR$DAS <- gsub("20191003", "3", all_MR$DAS)
all_MR$DAS <- gsub("20191011", "3", all_MR$DAS)
all_MR$DAS <- gsub("20191022", "3", all_MR$DAS)
all_MR$DAS <- gsub("20191104", "3", all_MR$DAS)

all_MR$DAS <- gsub("20190913", "4", all_MR$DAS)
all_MR$DAS <- gsub("20190927", "4", all_MR$DAS)
all_MR$DAS <- gsub("20191004", "4", all_MR$DAS)
all_MR$DAS <- gsub("20191012", "4", all_MR$DAS)
all_MR$DAS <- gsub("20191023", "4", all_MR$DAS)
all_MR$DAS <- gsub("20191105", "4", all_MR$DAS)


unique(all_MR[,c("experiment", "DAS")])

before we go any further - let’s clean up this data and add whatever else missing traits:

colnames(all_MR)
##  [1] "image"                 "root_name"             "root"                 
##  [4] "experiment"            "date"                  "genotype"             
##  [7] "rep"                   "cond"                  "MRL"                  
## [10] "insertion_angle"       "n_child"               "insertion_first_child"
## [13] "Apical"                "Branched"              "Basal"                
## [16] "aLRL.median"           "aLRL.SD"               "LRangle.median"       
## [19] "LRangle.SD"            "Apical_perc"           "Branched_perc"        
## [22] "Basal_perc"            "LR_no_10_100"          "LR_no_20_100"         
## [25] "LR_no_30_100"          "LR_no_40_100"          "LR_no_50_100"         
## [28] "LR_no_60_100"          "LR_no_70_100"          "LR_no_80_100"         
## [31] "LR_no_90_100"          "LR_no_100_100"         "LRL_10_100"           
## [34] "LRL_20_100"            "LRL_30_100"            "LRL_40_100"           
## [37] "LRL_50_100"            "LRL_60_100"            "LRL_70_100"           
## [40] "LRL_80_100"            "LRL_90_100"            "LRL_100_100"          
## [43] "CoG"                   "LRL.START"             "LRL.dec"              
## [46] "LRL.dec.R2"            "LRL"                   "LRno"                 
## [49] "aLRL"                  "TRS"                   "DAS"
dim(all_MR)
## [1] 8130   51
all_MR2 <- all_MR[,c(1:4, 51, 6:9, 13:50)]
head(all_MR2)
all_MR2$MRL.p.TRS <- all_MR2$MRL / all_MR2$TRS
all_MR2$aLRL.p.TRS <- all_MR2$aLRL / all_MR2$TRS
all_MR2$LRL_10_perc <- all_MR2$LRL_10_100 / all_MR2$LRL
all_MR2$LRL_20_perc <- all_MR2$LRL_20_100 / all_MR2$LRL
all_MR2$LRL_30_perc <- all_MR2$LRL_30_100 / all_MR2$LRL
all_MR2$LRL_40_perc <- all_MR2$LRL_40_100 / all_MR2$LRL
all_MR2$LRL_50_perc <- all_MR2$LRL_50_100 / all_MR2$LRL
all_MR2$LRL_60_perc <- all_MR2$LRL_60_100 / all_MR2$LRL
all_MR2$LRL_70_perc <- all_MR2$LRL_70_100 / all_MR2$LRL
all_MR2$LRL_80_perc <- all_MR2$LRL_80_100 / all_MR2$LRL
all_MR2$LRL_90_perc <- all_MR2$LRL_90_100 / all_MR2$LRL
all_MR2$LRL_100_perc <- all_MR2$LRL_100_100 / all_MR2$LRL

all_MR2$LRno_10_perc <- all_MR2$LR_no_10_100 / all_MR2$LRno
all_MR2$LRno_20_perc <- all_MR2$LR_no_20_100 / all_MR2$LRno
all_MR2$LRno_30_perc <- all_MR2$LR_no_30_100 / all_MR2$LRno
all_MR2$LRno_40_perc <- all_MR2$LR_no_40_100 / all_MR2$LRno
all_MR2$LRno_50_perc <- all_MR2$LR_no_50_100 / all_MR2$LRno
all_MR2$LRno_60_perc <- all_MR2$LR_no_60_100 / all_MR2$LRno
all_MR2$LRno_70_perc <- all_MR2$LR_no_70_100 / all_MR2$LRno
all_MR2$LRno_80_perc <- all_MR2$LR_no_80_100 / all_MR2$LRno
all_MR2$LRno_90_perc <- all_MR2$LR_no_90_100 / all_MR2$LRno
all_MR2$LRno_100_perc <- all_MR2$LR_no_100_100 / all_MR2$LRno

head(all_MR2)

Just before we start plotting the data - let’s also check the genotype information whether this all makes sense and if we are not missing any info:

unique(all_MR2$genotype)
##   [1] " 189" " 292" " 213" " 212" " 307" " 282" " 298" " 301" " 286" " 214"
##  [11] " 194" " 294" " 285" " 293" " 284" " 278" " 300" " 201" " 279" " 280"
##  [21] " 299" " 200" " 211" " 308" " 197" " 287" " 196" " 220" " 207" " 290"
##  [31] " 198" " 195" " 289" " 288" " 291" " 199" " 277" " 283" " 306" " 235"
##  [41] " 192" " 147" " 252" " 166" " 269" " 064" " 253" " 193" " 146" " 141"
##  [51] " 251" " 139" " 169" " 258" " 144" " 138" " 061" " 065" " 170" " 142"
##  [61] " 140" " 168" " 272" " 165" " 255" " 260" " 264" " 262" " 261" " 167"
##  [71] " 060" " 066" " 136" " 256" " 143" " 171" " 082" " 083" " 191" " 259"
##  [81] " 062" " 172" " 063" " 270" " 268" " 267" " 234" " 245" " 173" " 236"
##  [91] " 084" " 229" " 241" " 231" " 227" " 176" " 087" " 091" " 090" " 085"
## [101] " 228" " 230" " 175" " 250" " 222" " 239" " 233" " 274" " 088" " 271"
## [111] " 240" " 092" " 089" " 247" " 038" " 248" " 086" " 273" " 244" " 093"
## [121] " 174" " 249" " 237" " 221" " 225" " 103" " 028" " 098" " 055" " 075"
## [131] " 059" " 101" " 034" " 002" " 030" " 056" " 001" " 102" " 012" " 076"
## [141] " 079" " 104" " 081" " 096" " 058" " 099" " 105" " 040" " 035" " 094"
## [151] " 074" " 032" " 022" " 003" " 095" " 009" " 106" " 057" " 033" " 029"
## [161] " 013" " 031" " 007" " 008" " 006" " 080" " 005" " 036" " 011" " 078"
## [171] " 010" " 097" " 037" " 023" " 054" " 043" " 044" " 015" " 045" " 049"
## [181] " 050" " 024" " 072" " 069" " 048" " 052" " 073" " 053" " 020" " 042"
## [191] " 021" " 027" " 046" " 070" " 014" " 017" " 067" " 019" " 182" " 130"
## [201] " 187" " 159" " 125" " 178" " 151" " 109" " 186" " 121" " 181" " 158"
## [211] " 150" " 112" " 115" " 188" " 128" " 183" " 108" " 185" " 117" " 154"
## [221] " 120" " 162" " 118" " 149" " 119" " 113" " 133" " 127" " 156" " 131"
## [231] " 129" " 160" " 132" " 190" " 157" " 126" " 184" " 153" " 111" " 155"
## [241] " 107" " 179" " 135" " 116" " 134"
unique(all_MR2$root_name)
##    [1] " 189_3_C"  " 292_3_S"  " 213_3_S"  " 212_1_S"  " 307_2_C"  " 282_3_C" 
##    [7] " 298_3_S"  " 301_1_C"  " 286_1_S"  " 213_2_C"  " 214_1_C"  " 286_2_C" 
##   [13] " 194_1_S"  " 212_1_C"  " 294_2_C"  " 213_1_C"  " 285_2_S"  " 293_2_C" 
##   [19] " 284_2_S"  " 285_3_S"  " 278_1_C"  " 300_1_S"  " 214_3_C"  " 292_1_C" 
##   [25] " 201_2_S"  " 279_1_S"  " 293_3_S"  " 280_1_S"  " 194_3_S"  " 294_3_S" 
##   [31] " 299_2_C"  " 298_3_C"  " 282_1_C"  " 285_3_C"  " 307_3_C"  " 200_1_S" 
##   [37] " 211_3_S"  " 308_3_C"  " 308_2_C"  " 197_3_S"  " 287_1_C"  " 301_1_S" 
##   [43] " 196_1_C"  " 299_1_C"  " 220_3_C"  " 293_2_S"  " 207_1_C"  " 280_1_C" 
##   [49] " 220_1_C"  " 213_2_S"  " 194_3_C"  " 194_1_C"  " 282_2_S"  " 290_3_C" 
##   [55] " 196_2_C"  " 300_2_C"  " 198_2_C"  " 211_1_C"  " 285_2_C"  " 197_1_C" 
##   [61] " 292_2_C"  " 195_2_S"  " 294_2_S"  " 289_2_S"  " 282_2_C"  " 299_1_S" 
##   [67] " 300_3_C"  " 197_2_C"  " 298_2_C"  " 288_3_C"  " 213_3_C"  " 201_3_C" 
##   [73] " 291_3_C"  " 2800_3_S" " 196_1_S"  " 279_1_C"  " 278_3_S"  " 213_1_S" 
##   [79] " 294_1_C"  " 294_1_S"  " 195_1_C"  " 199_3_C"  " 290_1_C"  " 197_3_C" 
##   [85] " 212_2_S"  " 211_2_S"  " 211_2_C"  " 199_1_C"  " 214_1_S"  " 277_1_S" 
##   [91] " 197_1_S"  " 292_3_C"  " 291_2_C"  " 207_2_C"  " 214_2_C"  " 285_1_S" 
##   [97] " 194_2_C"  " 278_2_C"  " 291_1_C"  " 212_3_S"  " 300_3_S"  " 284_1_C" 
##  [103] " 293_1_S"  " 283_1_C"  " 211_3_C"  " 283_3_S"  " 286_3_C"  " 277_2_C" 
##  [109] " 279_3_S"  " 283_1_S"  " 298_1_S"  " 211_1_S"  " 197_2_S"  " 288_1_S" 
##  [115] " 300_2_S"  " 294_3_C"  " 198_3_S"  " 201_1_C"  " 288_2_C"  " 207_3_S" 
##  [121] " 288_1_C"  " 280_3_C"  " 306_1_C"  " 212_2_C"  " 212_3_C"  " 207_3_C" 
##  [127] " 286_2_S"  " 201_1_S"  " 277_1_C"  " 195_3_C"  " 283_2_C"  " 288_3_S" 
##  [133] " 291_2_S"  " 290_2_C"  " 298_1_C"  " 284_1_S"  " 308_3_S"  " 284_2_C" 
##  [139] " 290_1_S"  " 195_3_S"  " 214_3_S"  " 200_3_S"  " 200_2_S"  " 195_2_C" 
##  [145] " 200_1_C"  " 279_3_C"  " 301_2_C"  " 288_2_S"  " 301_3_S"  " 308_1_C" 
##  [151] " 279_2_C"  " 306_2_C"  " 286_1_C"  " 291_1_S"  " 280_2_C"  " 199_2_C" 
##  [157] " 235_1_C"  " 290_2_S"  " 195_1_S"  " 283_3_C"  " 290_3_S"  " 199_3_S" 
##  [163] " 293_3_C"  " 198_1_S"  " 198_2_S"  " 292_2_S"  " 198_1_C"  " 200_2_C" 
##  [169] " 286_3_S"  " 200_3_C"  " 201_2_C"  " 293_4_C"  " 308_2_S"  " 291_3_S" 
##  [175] " 282_3_S"  " 201_3_S"  " 278_3_C"  " 283_2_S"  " 287_3_C"  " 278_2_S" 
##  [181] " 282_1_S"  " 199_2_S"  " 278_1_S"  " 307_2_S"  " 307_1_S"  " 299_3_C" 
##  [187] " 199_1_S"  " 307_3_S"  " 220_2_C"  " 287_2_S"  " 287_2_C"  " 307_1_C" 
##  [193] " 220_1_S"  " 306_3_C"  " 299_2_S"  " 308_1_S"  " 277_2_S"  " 192_3_C" 
##  [199] " 207_1_S"  " 301_2_S"  " 194_2_S"  " 214_2_S"  " 306_1_S"  " 207_2_S" 
##  [205] " 306_3_S"  " 287_3_S"  " 147_3_C"  " 252_1_S"  " 166_1_C"  " 269_3_C" 
##  [211] " 064_1_C"  " 253_2_S"  " 193_1_S"  " 146_3_C"  " 141_2_C"  " 251_3_S" 
##  [217] " 139_3_S"  " 169_1_S"  " 258_3_S"  " 192_1_C"  " 144_2_C"  " 147_2_C" 
##  [223] " 253_3_S"  " 138_3_S"  " 146_2_C"  " 193_1_C"  " 061_2_C"  " 065_3_S" 
##  [229] " 170_3_C"  " 141_1_C"  " 144_1_C"  " 142_4_S"  " 139_1_S"  " 140_3_C" 
##  [235] " 168_3_S"  " 272_2_C"  " 138_4_C"  " 147_1_S"  " 269_3_S"  " 165_1_S" 
##  [241] " 144_2_S"  " 255_1_S"  " 138_1_C"  " 272_3_S"  " 138_4_S"  " 251_2_C" 
##  [247] " 269_1_C"  " 260_2_C"  " 264_2_S"  " 262_3_C"  " 261_1_S"  " 192_3_S" 
##  [253] " 065_2_S"  " 168_3_C"  " 260_1_C"  " 167_1_S"  " 166_3_C"  " 253_2_C" 
##  [259] " 142_3_C"  " 060_3_S"  " 165_2_C"  " 262_2_C"  " 066_2_C"  " 136_3_C" 
##  [265] " 142_3_S"  " 140_2_S"  " 256_2_S"  " 139_2_C"  " 143_2_C"  " 262_1_C" 
##  [271] " 251_3_C"  " 138_2_C"  " 165_1_C"  " 139_2_S"  " 166_1_S"  " 171_3_S" 
##  [277] " 256_1_C"  " 146_1_C"  " 264_1_C"  " 136_2_C"  " 065_3_C"  " 170_2_C" 
##  [283] " 146_2_S"  " 192_2_C"  " 255_2_C"  " 147_1_C"  " 140_2_C"  " 169_2_C" 
##  [289] " 146_3_S"  " 169_3_S"  " 061_1_C"  " 061_3_C"  " 262_4_C"  " 252_2_S" 
##  [295] " 141_3_C"  " 140_3_S"  " 166_3_S"  " 082_3_C"  " 136_1_C"  " 252_3_C" 
##  [301] " 083_3_C"  " 165_3_C"  " 272_3_C"  " 193_3_C"  " 141_2_S"  " 140_1_C" 
##  [307] " 142_2_C"  " 191_2_C"  " 171_2_C"  " 144_3_C"  " 193_2_S"  " 144_1_S" 
##  [313] " 272_1_C"  " 259_3_C"  " 138_1_S"  " 062_1_C"  " 147_2_S"  " 170_2_S" 
##  [319] " 172_1_C"  " 136_2_S"  " 170_1_C"  " 260_3_C"  " 063_1_S"  " 060_2_S" 
##  [325] " 142_4_C"  " 256_3_C"  " 256_2_C"  " 269_2_S"  " 065_1_C"  " 138_2_S" 
##  [331] " 171_2_S"  " 142_1_S"  " 193_2_C"  " 253_1_C"  " 253_1_S"  " 259_2_S" 
##  [337] " 065_2_C"  " 169_2_S"  " 168_2_C"  " 142_2_S"  " 171_1_C"  " 060_3_C" 
##  [343] " 192_1_S"  " 171_1_S"  " 261_2_C"  " 169_1_C"  " 191_1_C"  " 258_2_C" 
##  [349] " 063_1_C"  " 258_3_C"  " 261_3_C"  " 270_2_C"  " 140_1_S"  " 252_1_C" 
##  [355] " 083_2_C"  " 264_3_C"  " 082_2_C"  " 258_1_C"  " 169_3_C"  " 272_2_S" 
##  [361] " 168_1_C"  " 255_1_C"  " 256_3_S"  " 138_3_C"  " 139_3_C"  " 061_3_S" 
##  [367] " 136_3_S"  " 082_1_C"  " 262_4_S"  " 253_3_C"  " 191_3_C"  " 272_1_S" 
##  [373] " 268_2_C"  " 192_2_S"  " 144_3_S"  " 259_1_C"  " 172_2_C"  " 136_1_S" 
##  [379] " 147_3_S"  " 142_1_C"  " 060_1_C"  " 083_1_C"  " 267_2_C"  " 066_1_C" 
##  [385] " 252_3_S"  " 146_1_S"  " 264_2_C"  " 268_3_C"  " 262_1_S"  " 251_1_C" 
##  [391] " 165_3_S"  " 268_3_S"  " 269_1_S"  " 269_2_C"  " 171_3_C"  " 165_2_S" 
##  [397] " 166_2_C"  " 260_1_S"  " 060_2_C"  " 139_1_C"  " 172_3_C"  " 270_1_C" 
##  [403] " 060_1_S"  " 260_2_S"  " 261_1_C"  " 264_1_S"  " 261_2_S"  " 260_3_S" 
##  [409] " 172_1_S"  " 191_1_S"  " 251_2_S"  " 255_2_S"  " 258_1_S"  " 267_1_C" 
##  [415] " 065_1_S"  " 141_1_S"  " 143_1_C"  " 268_2_S"  " 062_2_S"  " 256_1_S" 
##  [421] " 262_3_S"  " 261_3_S"  " 259_2_C"  " 270_2_S"  " 191_3_S"  " 141_3_S" 
##  [427] " 061_2_S"  " 066_1_S"  " 252_2_C"  " 168_2_S"  " 082_3_S"  " 264_3_S" 
##  [433] " 259_3_S"  " 143_1_S"  " 193_3_S"  " 167_1_C"  " 259_1_S"  " 191_2_S" 
##  [439] " 262_2_S"  " 170_3_S"  " 267_1_S"  " 066_2_S"  " 061_1_S"  " 168_1_S" 
##  [445] " 172_3_S"  " 064_1_S"  " 082_2_S"  " 270_1_S"  " 166_2_S"  " 172_2_S" 
##  [451] " 064_2_S"  " 251_1_S"  " 143_2_S"  " 258_2_S"  " 083_2_S"  " 083_3_S" 
##  [457] " 268_1_S"  " 234_1_C"  " 245_3_S"  " 173_4_C"  " 236_3_S"  " 084_3_C" 
##  [463] " 229_4_C"  " 245_1_S"  " 236_4_C"  " 241_1_C"  " 231_2_S"  " 245_4_S" 
##  [469] " 227_1_C"  " 176_1_C"  " 229_4_S"  " 235_2_S"  " 087_1_S"  " 091_4_S" 
##  [475] " 090_3_C"  " 091_4_C"  " 085_2_S"  " 228_2_C"  " 230_3_s"  " 175_4_C" 
##  [481] " 250_1_C"  " 222_2_S"  " 229_2_S"  " 239_4_C"  " 229_3_S"  " 233_1_C" 
##  [487] " 250_4_S"  " 274_2_C"  " 088_1_C"  " 230_1_S"  " 234_2_C"  " 271_2_S" 
##  [493] " 173_1_C"  " 240_2_S"  " 092_4_C"  " 084_1_S"  " 084_1_C"  " 229_3_C" 
##  [499] " 233_3_S"  " 236_1_S"  " 239_4_S"  " 236_2_S"  " 173_3_C"  " 233_2_C" 
##  [505] " 089_3_C"  " 234_2_S"  " 241_2_C"  " 084_3_S"  " 247_1_S"  " 245_3_C" 
##  [511] " 247_3_C"  " 239_3_C"  " 038_2_S"  " 250_3_S"  " 247_2_C"  " 228_4_C" 
##  [517] " 248_4_C"  " 086_3_C"  " 231_2_C"  " 173_1_S"  " 085_3_S"  " 086_1_C" 
##  [523] " 085_2_C"  " 228_2_S"  " 084_2_S"  " 231_3_C"  " 273_3_C"  " 175_3_C" 
##  [529] " 176_2_S"  " 091_2_S"  " 271_1_C"  " 084_4_C"  " 173_4_S"  " 274_4_C" 
##  [535] " 239_1_S"  " 236_2_C"  " 173_2_C"  " 230_2_S"  " 092_1_C"  " 250_4_C" 
##  [541] " 240_3_C"  " 176_4_C"  " 092_3_C"  " 244_3_C"  " 176_2_C"  " 240_2_C" 
##  [547] " 274_1_S"  " 088_1_S"  " 240_1_S"  " 088_3_C"  " 092_2_C"  " 086_1_S" 
##  [553] " 089_2_C"  " 092_3_S"  " 091_3_S"  " 093_3_C"  " 229_1_S"  " 236_3_C" 
##  [559] " 087_3_C"  " 092_2_S"  " 239_2_S"  " 248_2_C"  " 229_1_C"  " 250_3_C" 
##  [565] " 038_3_C"  " 233_3_C"  " 230_1_C"  " 236_4_S"  " 175_2_C"  " 271_4_S" 
##  [571] " 228_3_C"  " 093_1_S"  " 173_2_S"  " 087_4_C"  " 090_2_C"  " 273_1_C" 
##  [577] " 084_4_S"  " 239_2_C"  " 233_4_S"  " 271_2_C"  " 175_3_S"  " 092_1_S" 
##  [583] " 233_1_S"  " 174_4_C"  " 038_1_C"  " 087_1_C"  " 092_4_S"  " 231_3_S" 
##  [589] " 176_3_C"  " 247_4_C"  " 248_4_S"  " 245_2_S"  " 240_3_S"  " 241_3_C" 
##  [595] " 245_1_C"  " 085_1_C"  " 174_2_S"  " 089_4_C"  " 087_2_C"  " 273_3_S" 
##  [601] " 250_2_C"  " 271_3_C"  " 273_4_C"  " 228_3_S"  " 248_2_S"  " 249_1_S" 
##  [607] " 228_1_C"  " 271_3_S"  " 236_1_C"  " 089_3_S"  " 229_2_C"  " 273_4_S" 
##  [613] " 085_3_C"  " 175_4_S"  " 244_2_C"  " 089_4_S"  " 271_4_C"  " 087_3_S" 
##  [619] " 250_2_S"  " 274_2_S"  " 174_2_C"  " 274_3_S"  " 241_3_S"  " 233_4_C" 
##  [625] " 245_2_C"  " 173_3_S"  " 086_2_C"  " 088_3_S"  " 093_3_S"  " 240_1_C" 
##  [631] " 091_1_C"  " 093_1_C"  " 227_3_C"  " 176_3_S"  " 064_3_S"  " 237_1_C" 
##  [637] " 244_1_S"  " 174_3_C"  " 274_1_C"  " 247_2_S"  " 227_2_C"  " 230_3_S" 
##  [643] " 239_1_C"  " 093_2_C"  " 273_2_C"  " 084_2_C"  " 093_4_C"  " 038_1_S" 
##  [649] " 174_1_C"  " 241_2_S"  " 038_3_S"  " 298_2_S"  " 248_1_C"  " 274_3_C" 
##  [655] " 089_2_S"  " 222_1_S"  " 274_4_S"  " 090_1_C"  " 064_3_C"  " 175_1_C" 
##  [661] " 230_3_C"  " 247_1_C"  " 237_2_C"  " 237_4_C"  " 250_1_S"  " 239_3_S" 
##  [667] " 271_1_S"  " 087_4_S"  " 227_2_S"  " 221_2_C"  " 087_2_S"  " 086_3_S" 
##  [673] " 174_3_S"  " 176_4_S"  " 228_1_S"  " 175_2_S"  " 222_2_C"  " 088_2_C" 
##  [679] " 086_2_S"  " 237_4_S"  " 089_1_S"  " 091_3_C"  " 234_3_C"  " 038_2_C" 
##  [685] " 227_1_S"  " 174_4_S"  " 233_2_S"  " 241_1_S"  " 248_3_C"  " 222_1_C" 
##  [691] " 093_4_S"  " 230_2_C"  " 240_4_C"  " 237_3_C"  " 221_1_C"  " 234_1_S" 
##  [697] " 244_3_S"  " 176_1_S"  " 235_1_S"  " 225_2_C"  " 248_1_S"  " 273_2_S" 
##  [703] " 091_1_S"  " 244_1_C"  " 091_2_C"  " 248_3_S"  " 249_1_C"  " 247_3_S" 
##  [709] " 175_1_S"  " 244_2_S"  " 090_1_S"  " 093_2_S"  " 225_1_C"  " 085_1_S" 
##  [715] " 249_2_C"  " 249_3_C"  " 064_2_C"  " 231_1_C"  " 090_3_S"  " 249_2_S" 
##  [721] " 249_3_S"  " 240_4_S"  " 237_2_S"  " 273_1_S"  " 237_1_s"  " 174_1_S" 
##  [727] " 090_2_S"  " 088_2_S"  " 221_1_S"  " 247_4_S"  " 228_4_S"  " 234_3_S" 
##  [733] " 227_3_S"  " 237_3_S"  " 231_1_S"  " 103_4_S"  " 028_3_S"  " 098_1_S" 
##  [739] " 055_2_S"  " 075_3_C"  " 059_4_C"  " 101_1_S"  " 034_1_C"  " 002_1_C" 
##  [745] " 030_2_S"  " 056_3_S"  " 001_3_C"  " 102_4_C"  " 012_3_C"  " 076_1_C" 
##  [751] " 098_1_C"  " 079_1_C"  " 104_3_S"  " 081_1_C"  " 101_2_C"  " 096_1_C" 
##  [757] " 101_2_S"  " 058_4_C"  " 028_4_C"  " 099_2_S"  " 103_3_C"  " 079_4_C" 
##  [763] " 030_1_S"  " 105_4_S"  " 040_1_C"  " 035_4_C"  " 094_3_C"  " 074_4_C" 
##  [769] " 032_4_S"  " 056_2_C"  " 103_1_S"  " 103_1_C"  " 022_4_C"  " 102_2_S" 
##  [775] " 105_3_C"  " 081_2_S"  " 003_3_S"  " 056_2_S"  " 095_1_S"  " 009_3_S" 
##  [781] " 002_2_S"  " 106_1_S"  " 098_3_C"  " 040_3_S"  " 103_2_S"  " 075_2_C" 
##  [787] " 001_4_S"  " 009_2_S"  " 057_1_C"  " 028_3_C"  " 033_2_C"  " 012_1_S" 
##  [793] " 098_3_S"  " 094_2_C"  " 029_3_S"  " 074_3_C"  " 028_1_S"  " 013_3_C" 
##  [799] " 031_1_S"  " 105_1_S"  " 094_2_S"  " 007_2_C"  " 075_3_S"  " 013_2_S" 
##  [805] " 007_1_C"  " 008_1_S"  " 057_1_S"  " 007_3_C"  " 059_3_C"  " 076_3_C" 
##  [811] " 012_3_S"  " 008_3_C"  " 007_1_S"  " 094_3_S"  " 099_4_C"  " 057_3_C" 
##  [817] " 099_1_C"  " 035_2_S"  " 029_4_S"  " 030_2_C"  " 012_2_S"  " 103_4_C" 
##  [823] " 105_3_S"  " 007_2_S"  " 012_4_S"  " 013_1_C"  " 032_1_C"  " 009_2_C" 
##  [829] " 001_1_C"  " 057_2_S"  " 098_4_S"  " 006_3_C"  " 080_1_C"  " 079_2_S" 
##  [835] " 056_3_C"  " 095_4_S"  " 040_2_C"  " 001_2_S"  " 003_3_C"  " 031_2_C" 
##  [841] " 074_4_S"  " 035_2_C"  " 106_2_C"  " 001_2_C"  " 104_2_S"  " 040_4_C" 
##  [847] " 005_3_C"  " 059_1_C"  " 079_3_S"  " 096_2_S"  " 009_1_C"  " 032_2_C" 
##  [853] " 057_4_S"  " 055_2_C"  " 030_3_C"  " 095_4_C"  " 081_3_C"  " 081_4_S" 
##  [859] " 103_3_S"  " 059_2_C"  " 099_3_C"  " 031_4_C"  " 038_4_C"  " 006_2_C" 
##  [865] " 102_3_C"  " 057_2_C"  " 104_3_C"  " 057_4_C"  " 029_3_C"  " 036_2_C" 
##  [871] " 058_1_C"  " 057_3_S"  " 030_1_C"  " 032_3_S"  " 011_1_C"  " 078_1_C" 
##  [877] " 035_1_S"  " 029_1_C"  " 101_3_S"  " 055_1_S"  " 008_1_C"  " 011_3_C" 
##  [883] " 001_1_S"  " 055_3_C"  " 003_2_S"  " 105_4_C"  " 104_4_S"  " 031_4_S" 
##  [889] " 102_4_S"  " 013_2_C"  " 074_2_S"  " 075_1_S"  " 008_3_S"  " 104_1_S" 
##  [895] " 011_4_C"  " 058_2_C"  " 099_4_S"  " 106_2_S"  " 075_1_C"  " 009_1_S" 
##  [901] " 080_2_C"  " 099_2_C"  " 074_1_S"  " 002_1_S"  " 011_3_S"  " 105_2_C" 
##  [907] " 080_3_S"  " 055_3_S"  " 028_1_C"  " 008_2_S"  " 035_3_C"  " 011_2_C" 
##  [913] " 094_1_C"  " 013_3_S"  " 055_1_C"  " 005_2_C"  " 005_4_C"  " 104_2_C" 
##  [919] " 056_1_C"  " 101_4_S"  " 079_4_S"  " 012_2_C"  " 101_4_C"  " 031_1_C" 
##  [925] " 059_1_S"  " 105_1_C"  " 008_2_C"  " 029_4_C"  " 094_1_S"  " 034_3_C" 
##  [931] " 081_3_S"  " 002_2_C"  " 081_4_C"  " 033_1_C"  " 074_2_C"  " 106_1_C" 
##  [937] " 035_4_S"  " 035_1_C"  " 011_2_S"  " 007_3_S"  " 005_1_S"  " 001_4_C" 
##  [943] " 101_3_C"  " 028_2_C"  " 101_1_C"  " 013_1_S"  " 096_2_C"  " 002_3_C" 
##  [949] " 038_4_S"  " 076_4_C"  " 098_2_C"  " 040_2_S"  " 012_1_C"  " 102_2_C" 
##  [955] " 001_3_S"  " 002_3_S"  " 012_4_C"  " 076_2_S"  " 096_3_S"  " 032_2_S" 
##  [961] " 002_4_S"  " 079_2_C"  " 098_4_C"  " 095_2_C"  " 080_4_C"  " 030_3_S" 
##  [967] " 040_3_C"  " 040_4_S"  " 076_1_S"  " 029_2_C"  " 032_3_C"  " 105_2_S" 
##  [973] " 003_1_C"  " 096_3_C"  " 102_1_C"  " 102_1_S"  " 032_4_C"  " 076_3_S" 
##  [979] " 104_1_C"  " 098_2_S"  " 102_3_S"  " 075_2_S"  " 099_3_S"  " 009_4_S" 
##  [985] " 081_2_C"  " 031_3_C"  " 009_3_C"  " 006_1_C"  " 009_4_C"  " 058_3_C" 
##  [991] " 008_4_C"  " 078_1_S"  " 103_2_C"  " 076_2_C"  " 008_4_S"  " 095_3_C" 
##  [997] " 104_4_C"  " 096_1_S"  " 059_4_S"  " 074_1_C"  " 074_3_S"  " 034_2_C" 
## [1003] " 095_1_C"  " 028_2_S"  " 005_4_S"  " 010_3_S"  " 059_2_S"  " 036_1_S" 
## [1009] " 036_1_C"  " 011_1_S"  " 031_2_S"  " 078_2_C"  " 095_2_S"  " 028_4_S" 
## [1015] " 029_1_S"  " 003_1_S"  " 033_3_C"  " 079_3_C"  " 035_3_S"  " 095_3_S" 
## [1021] " 097_1_C"  " 079_1_S"  " 006_1_S"  " 099_1_S"  " 078_3_S"  " 037_1_C" 
## [1027] " 031_3_S"  " 080_1_S"  " 080_2_S"  " 080_4_S"  " 010_2_C"  " 040_1_S" 
## [1033] " 006_3_S"  " 005_3_S"  " 056_1_S"  " 005_2_S"  " 034_1_S"  " 011_4_S" 
## [1039] " 006_2_S"  " 097_1_S"  " 032_1_S"  " 033_3_S"  " 033_1_S"  " 029_2_S" 
## [1045] " 037_1_S"  " 036_2_S"  " 059_3_S"  " 076_4_S"  " 010_1_C"  " 010_3_C" 
## [1051] " 033_2_S"  " 034_3_S"  " 034_2_S"  " M023_4_S" " M054_2_S" " M022_1_C"
## [1057] " M043_3_S" " 044_1_C"  " 015_3_C"  " 054_5_C"  " 044_2_C"  " 045_3_C" 
## [1063] " 044_3_C"  " 049_5_C"  " 045_5_S"  " 045_2_S"  " 049_2_S"  " 050_3_S" 
## [1069] " 050_4_C"  " 024_2_C"  " 049_4_C"  " 072_3_C"  " 072_3_S"  " 023_5_S" 
## [1075] " 054_4_C"  " 024_3_C"  " 072_2_C"  " 069_3_S"  " 043_3_C"  " 072_2_S" 
## [1081] " 045_4_C"  " 022_5_C"  " 045_5_C"  " 048_1_C"  " 015_5_S"  " 052_3_S" 
## [1087] " 048_4_C"  " 054_1_C"  " 052_1_S"  " 023_4_C"  " 049_1_C"  " 043_2_S" 
## [1093] " 022_1_S"  " 023_5_C"  " 054_2_C"  " 052_3_C"  " 023_3_C"  " 052_1_C" 
## [1099] " 045_1_C"  " 073_1_C"  " 022_2_S"  " 053_5_C"  " 044_5_C"  " 020_2_C" 
## [1105] " 020_3_S"  " 043_1_C"  " 048_2_C"  " 053_4_S"  " 053_4_C"  " 048_2_S" 
## [1111] " 015_5_C"  " 072_5_S"  " 052_2_S"  " 072_4_C"  " 053_2_C"  " 023_1_S" 
## [1117] " 072_5_C"  " 053_5_S"  " 023_2_C"  " 042_4_C"  " 053_3_S"  " 053_3_C" 
## [1123] " 023_1_C"  " 049_5_S"  " 052_2_C"  " 072_4_S"  " 021_1_S"  " 048_3_C" 
## [1129] " 054_4_S"  " 022_3_C"  " 054_5_S"  " 045_4_S"  " 043_5_C"  " 054_3_C" 
## [1135] " 024_3_S"  " 053_1_C"  " 045_2_C"  " 045_3_S"  " 053_2_S"  " 027_5_S" 
## [1141] " 073_1_S"  " 069_1_C"  " 049_2_C"  " M048_5_S" " M045_1_S" " M046_5_S"
## [1147] " 022_3_S"  " 073_2_S"  " 024_4_S"  " 043_4_C"  " 050_5_C"  " 072_1_C" 
## [1153] " 049_3_S"  " 022_4_S"  " 050_5_S"  " 070_2_C"  " 073_5_S"  " 022_5_S" 
## [1159] " 024_5_C"  " 050_2_S"  " 069_2_C"  " 072_1_S"  " 043_4_S"  " 073_3_S" 
## [1165] " 050_4_S"  " 015_2_C"  " 014_2_C"  " 073_4_S"  " 049_4_S"  " 015_4_C" 
## [1171] " 017_3_C"  " 070_2_S"  " 044_3_S"  " 022_2_C"  " 050_3_C"  " 015_2_S" 
## [1177] " 053_1_S"  " 044_2_S"  " 069_3_C"  " 049_3_C"  " 015_3_S"  " 027_2_C" 
## [1183] " 024_5_S"  " 017_4_S"  " 067_4_C"  " 042_5_C"  " 023_3_S"  " 050_1_C" 
## [1189] " 046_4_C"  " 042_2_S"  " 021_3_C"  " 046_3_C"  " 067_4_S"  " 048_4_S" 
## [1195] " 043_1_S"  " 020_3_C"  " 020_1_S"  " 048_3_S"  " 042_2_C"  " 048_5_C" 
## [1201] " 050_2_C"  " 023_2_S"  " 042_1_C"  " 046_2_S"  " 042_4_S"  " 027_5_C" 
## [1207] " 020_2_S"  " 046_3_S"  " 052_4_C"  " 048_1_S"  " 049_1_S"  " 069_2_S" 
## [1213] " 017_4_C"  " 052_4_S"  " 020_4_S"  " 024_1_C"  " 046_5_C"  " 020_4_C" 
## [1219] " 054_3_S"  " 043_2_C"  " 067_3_C"  " 042_3_S"  " 027_3_S"  " 019_1_C" 
## [1225] " 021_2_C"  " 044_4_C"  " 044_4_S"  " 021_1_C"  " 052_5_S"  " 067_2_C" 
## [1231] " 046_1_C"  " 027_3_C"  " 046_1_S"  " 015_4_S"  " 073_5_C"  " 020_1_C" 
## [1237] " 042_3_C"  " 052_5_C"  " 070_1_C"  " 024_4_C"  " 017_3_S"  " 073_4_C" 
## [1243] " 073_2_c"  " 017_1_C"  " 017_2_S"  " 070_1_S"  " 073_3_C"  " M021_5_S"
## [1249] " 046_4_S"  " 054_2_S"  " 015_1_C"  " 027_1_C"  " 014_1_C"  " 044_1_S" 
## [1255] " 021_5_C"  " 050_1_S"  " 021_2_S"  " 027_4_S"  " 021_5_S"  " 023_4_S" 
## [1261] " 022_1_C"  " 048_5_S"  " 045_1_S"  " 043_3_S"  " 046_5_S"  " 027_1_S" 
## [1267] " 019_1_S"  " 042_1_S"  " 024_2_S"  " 021_3_S"  " 067_1_C"  " 067_3_S" 
## [1273] " 046_2_C"  " 044_5_S"  " 067_1_S"  " 027_4_C"  " 015_1_S"  " 014_2_S" 
## [1279] " 017_1_S"  " 073_2_C"  " 017_2_C"  " 027_2_S"  " 043_5_S"  " 054_1_S" 
## [1285] " 024_1_S"  " 067_2_S"  " 287_1_S"  " 196_2_S"  " 306_2_S"  " 299_3_S" 
## [1291] " 220_2_S"  " 220_3_S"  " 170_1_S"  " 083_1_S"  " 082_1_S"  " 225_1_S" 
## [1297] " 225_2_S"  " 237_1_S"  " 089_1_C"  " 010_2_S"  " 010_1_S"  " 058_2_S" 
## [1303] " 058_4_S"  " 058_3_S"  " 078_2_S"  " 058_1_S"  " 003_2_C"  " 042_5_S" 
## [1309] " 069_1_S"  " 014_1_S"  " 182-2_C"  " 130-3_C"  " 187-3_C"  " 159-3_S" 
## [1315] " 125-3_C"  " 178-4_S"  " 151-3_C"  " 109-2_S"  " 186-3_S"  " 121-3_S" 
## [1321] " 181-1_C"  " 158-3_C"  " 182-3_S"  " 121-2_S"  " 150-4_S"  " 178-1_C" 
## [1327] " 186-2_S"  " 112-3_C"  " 159-4_C"  " 115-1_S"  " 188-1_S"  " 125-3_S" 
## [1333] " 182-2_S"  " 181-3_C"  " 128-2_C"  " 151-2_S"  " 183-1_C"  " 108-2_S" 
## [1339] " 185-1_C"  " 125-2_C"  " 183-2_C"  " 188-1_C"  " 181-2_C"  " 128-3_C" 
## [1345] " 117-3_S"  " 159-1_C"  " 121-1_C"  " 154-1_S"  " 120-4_C"  " 108-2_C" 
## [1351] " 182-4_C"  " 162-3_S"  " 112-1_C"  " 118-1_S"  " 112-4_S"  " 149-2_C" 
## [1357] " 162-3_C"  " 119-4_C"  " 162-1_S"  " 118-3_S"  " 188-3_S"  " 186-4_S" 
## [1363] " 151-1_S"  " 154-2_C"  " 159-2_C"  " 113-3_C"  " 149-4_S"  " 133-1_S" 
## [1369] " 121-4_C"  " 178-4_C"  " 125-4_C"  " 151-2_C"  " 187-2_C"  " 109-2_C" 
## [1375] " 127-2_C"  " 150-1_S"  " 182-1_C"  " 117-1_C"  " 156-4_C"  " 183-1_S" 
## [1381] " 113-1_C"  " 189-2_C"  " 133-4_C"  " 159-1_S"  " 118-4_C"  " 156-2_S" 
## [1387] " 125-1_C"  " 131-2_C"  " 131-4_C"  " 129-1_C"  " 117-2_C"  " 160-2_C" 
## [1393] " 159-3_C"  " 132-1_S"  " 121-2_C"  " 186-1_C"  " 120-3_S"  " 151-4_S" 
## [1399] " 117-4_S"  " 133-2_C"  " 108-4_S"  " 118-4_S"  " 131-1_S"  " 190-1_S" 
## [1405] " 157-1_C"  " 178-3_S"  " 158-1_S"  " 129-4_C"  " 160-2_S"  " 156-1_S" 
## [1411] " 149-4_C"  " 109-1_C"  " 126-3_S"  " 184-1_S"  " 109-3_S"  " 117-2_S" 
## [1417] " 112-2_S"  " 178-3_C"  " 151-3_S"  " 151-4_C"  " 131-4_S"  " 108-3_S" 
## [1423] " 153-2_C"  " 182-1_S"  " 128-2_S"  " 129-2_C"  " 108-1_S"  " 118-3_C" 
## [1429] " 188-3_C"  " 187-1_C"  " 186-2_C"  " 185-3_S"  " 111-1_S"  " 119-2_S" 
## [1435] " 150-3_S"  " 119-2_C"  " 159-4_S"  " 121-3_C"  " 158-4_C"  " 130-4_S" 
## [1441] " 131-2_S"  " 181-1_S"  " 155-1_C"  " 108-1_c"  " 127-4_S"  " 127-1_C" 
## [1447] " 185-2_C"  " 155-4_C"  " 119-3_S"  " 107-2_S"  " 158-1_C"  " 185-3_C" 
## [1453] " 182-3_C"  " 149-1_C"  " 185-4_C"  " 112-1_S"  " 117-4_C"  " 111-4_C" 
## [1459] " 111-3_C"  " 133-1_C"  " 149-3_C"  " 130-1_C"  " 107-2_C"  " 130-4_C" 
## [1465] " 120-1_C"  " 115-2_C"  " 113-1_S"  " 156-4_S"  " 126-3_C"  " 150-3_C" 
## [1471] " 125-2_S"  " 132-3_C"  " 120-1_S"  " 189-1_C"  " 183-2_S"  " 109-1_S" 
## [1477] " 190-2_S"  " 187-2_S"  " 130-2_C"  " 155-2_C"  " 184-2_C"  " 131-3_C" 
## [1483] " 155-1_S"  " 107-4_C"  " 154-2_S"  " 179_C"    " 107-1_S"  " 162-1_C" 
## [1489] " 182-4_S"  " 111-2_S"  " 127-1_S"  " 128-3_S"  " 129-3_S"  " 184-2_S" 
## [1495] " 112-3_S"  " 113-4_C"  " 185-1_S"  " 126-1_C"  " 129-2_S"  " 120-2_C" 
## [1501] " 115-2_S"  " 108-3_C"  " 130-2_S"  " 190-3_S"  " 135-1_C"  " 112-4_C" 
## [1507] " 162-2_S"  " 111-4_S"  " 129-1_S"  " 107-3_S"  " 160-3_S"  " 132-1_C" 
## [1513] " 153-4_C"  " 160-3_C"  " 184-1_C"  " 185-4_S"  " 156-1_C"  " 130-1_S" 
## [1519] " 107-4_S"  " 119-1_S"  " 190-3_C"  " 118-2_S"  " 112-2_C"  " 121-4_S" 
## [1525] " 149-3_S"  " 159-2_S"  " 129-3_C"  " 121-1_S"  " 186-3_C"  " 120-3_C" 
## [1531] " 132-2_C"  " 125-1_S"  " 157-2_C"  " 113-3_S"  " 158-3_S"  " 150-2_C" 
## [1537] " 118-1_C"  " 133-2_S"  " 156-3_S"  " 155-3_S"  " 127-4_C"  " 128-4_C" 
## [1543] " 117-1_S"  " 155-2_S"  " 150-4_C"  " 151-1_C"  " 127-3_S"  " 126-2_S" 
## [1549] " 126-1_S"  " 107-1_C"  " 132-3_S"  " 150-2_S"  " 155-3_C"  " 156-3_C" 
## [1555] " 135-2_C"  " 133-3_C"  " 153-3_C"  " 156-2_C"  " 178-2_C"  " 128-1_S" 
## [1561] " 149-2_S"  " 113-2_S"  " 108-1_C"  " 158-2_C"  " 187-3_S"  " 190-4_C" 
## [1567] " 111-1_C"  " 162-2_C"  " 113-4_S"  " 186-4_C"  " 160-1_S"  " 107-3_C" 
## [1573] " 160-1_C"  " 190-4_S"  " 135-1_S"  " 108-4_C"  " 150-1_C"  " 129-4_S" 
## [1579] " 133-3_S"  " 125-4_s"  " 186-1_S"  " 157-1_S"  " 153-3_S"  " 119-4_S" 
## [1585] " 131-3_S"  " 120-4_S"  " 158-4_S"  " 128-1_C"  " 131-1_C"  " 153-1_C" 
## [1591] " 157-2_S"  " 190-2_C"  " 154-1_C"  " 130-3_S"  " 153-1_S"  " 117-3_C" 
## [1597] " 118-2_C"  " 178-2_S"  " 189-2_S"  " 125-4_S"  " 126-2_C"  " 109-3_C" 
## [1603] " 119-3_C"  " 111-2_C"  " 127-3_C"  " 132-2_S"  " 188-2_C"  " 190-1_C" 
## [1609] " 185-2_S"  " 153-2_S"  " 119-1_C"  " 149-1_S"  " 133-4_S"  " 120-2_S" 
## [1615] " 128-4_S"  " 113-2_C"  " 153-4_S"  " 158-2_S"  " 115-1_C"  " 116-1_C" 
## [1621] " 155-2_c"  " 111-3_S"  " 155-1_c"  " 181-2_S"  " 127-2_S"  " 188-2_S" 
## [1627] " 155-4_S"  " 84-2_C"   " 178-1_S"  " 189-1_S"  " 134-1_S"  " 135-2_S" 
## [1633] " 181-3_S"  " 155_1_C"
all_MR2$root_name <- gsub(" 089_1_", " 089_1_C", all_MR2$root_name)
all_MR2$root_name <- gsub(" 089_1_C_C", " 089_1_C", all_MR2$root_name)
all_MR2$root_name <- gsub(" 089_1_C_S", " 089_1_S", all_MR2$root_name)

all_MR2$root_name <- gsub("301_3", "301_3_C", all_MR2$root_name)
all_MR2$root_name <- gsub("301_3_CC", "301_3_C", all_MR2$root_name)
all_MR2$root_name <- gsub("301_3_CS", "301_3_S", all_MR2$root_name)

And some data curation - that became apparent on itterative runs of this script - but it is better to include it here:

#all_MR2 <- subset(all_MR2, all_MR2$LRL.dec > -5)
#all_MR2 <- subset(all_MR2, all_MR2$LRL.dec < 5)

Histograms

Library loading

OK - now we can start plotting - finally! loading the libraries

library(ggplot2)
library(ggpubr)
## Warning: package 'ggpubr' was built under R version 4.0.2
library(doBy)
## 
## Attaching package: 'doBy'
## The following object is masked from 'package:dplyr':
## 
##     order_by
library(cowplot)
## 
## ********************************************************
## Note: As of version 1.0.0, cowplot does not change the
##   default ggplot2 theme anymore. To recover the previous
##   behavior, execute:
##   theme_set(theme_cowplot())
## ********************************************************
## 
## Attaching package: 'cowplot'
## The following object is masked from 'package:ggpubr':
## 
##     get_legend
library(RColorBrewer)
library(corrplot)
## corrplot 0.84 loaded
library(ggbeeswarm)
library(RColorBrewer)
library(ggridges)
library(gapminder)
library("gplots")
## Warning: package 'gplots' was built under R version 4.0.2
## 
## Attaching package: 'gplots'
## The following object is masked from 'package:stats':
## 
##     lowess
library("colorRamps")

Let’s start from a simple histogram - so we can see the treatment dependent change in TRS

colnames(all_MR2)
##  [1] "image"          "root_name"      "root"           "experiment"    
##  [5] "DAS"            "genotype"       "rep"            "cond"          
##  [9] "MRL"            "Apical"         "Branched"       "Basal"         
## [13] "aLRL.median"    "aLRL.SD"        "LRangle.median" "LRangle.SD"    
## [17] "Apical_perc"    "Branched_perc"  "Basal_perc"     "LR_no_10_100"  
## [21] "LR_no_20_100"   "LR_no_30_100"   "LR_no_40_100"   "LR_no_50_100"  
## [25] "LR_no_60_100"   "LR_no_70_100"   "LR_no_80_100"   "LR_no_90_100"  
## [29] "LR_no_100_100"  "LRL_10_100"     "LRL_20_100"     "LRL_30_100"    
## [33] "LRL_40_100"     "LRL_50_100"     "LRL_60_100"     "LRL_70_100"    
## [37] "LRL_80_100"     "LRL_90_100"     "LRL_100_100"    "CoG"           
## [41] "LRL.START"      "LRL.dec"        "LRL.dec.R2"     "LRL"           
## [45] "LRno"           "aLRL"           "TRS"            "MRL.p.TRS"     
## [49] "aLRL.p.TRS"     "LRL_10_perc"    "LRL_20_perc"    "LRL_30_perc"   
## [53] "LRL_40_perc"    "LRL_50_perc"    "LRL_60_perc"    "LRL_70_perc"   
## [57] "LRL_80_perc"    "LRL_90_perc"    "LRL_100_perc"   "LRno_10_perc"  
## [61] "LRno_20_perc"   "LRno_30_perc"   "LRno_40_perc"   "LRno_50_perc"  
## [65] "LRno_60_perc"   "LRno_70_perc"   "LRno_80_perc"   "LRno_90_perc"  
## [69] "LRno_100_perc"
TRS_histo <- gghistogram(all_MR2, x = "TRS",
            add = "mean", rug = TRUE,
            color = "cond", fill = "cond", facet.by = "DAS", 
            palette = c("#00AFBB", "#E7B800")) + xlab("Total root length (cm)")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
TRS_histo

OK - looks as we expect it to. Let’s have a look at other things - like LR number:

LRno_histo <- gghistogram(all_MR2, x = "LRno",
            add = "mean", rug = TRUE,
            color = "cond", fill = "cond", facet.by = "DAS",
            palette = c("#00AFBB", "#E7B800")) + xlab("number of LR / Main Root")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
LRno_histo

LRL_histo <- gghistogram(all_MR2, x = "LRL",
            add = "mean", rug = TRUE,
            color = "cond", fill = "cond", facet.by = "DAS",
            palette = c("#00AFBB", "#E7B800")) + xlab("Lateral Root Length (cm)")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
LRL_histo

all_MR2$LRangle.median <- as.numeric(as.character(all_MR2$LRangle.median))
## Warning: NAs introduced by coercion
LRangle_histo <- gghistogram(all_MR2, x = "LRangle.median",
            add = "mean", rug = TRUE,
            color = "cond", fill = "cond", facet.by = "DAS",
            palette = c("#00AFBB", "#E7B800")) + xlab(expression("median Lateral Root Angle (" * degree * ")"))
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
LRangle_histo
## Warning: Removed 1475 rows containing non-finite values (stat_bin).

MRL_histo <- gghistogram(all_MR2, x = "MRL",
            add = "mean", rug = TRUE,
            color = "cond", fill = "cond", facet.by = "DAS",
            palette = c("#00AFBB", "#E7B800")) + xlab("Main root length (cm)")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
MRL_histo

CoG_histo <- gghistogram(all_MR2, x = "CoG",
            add = "mean", rug = TRUE,
            color = "cond", fill = "cond", facet.by = "DAS",
            palette = c("#00AFBB", "#E7B800")) + xlab("Center of Gravity (cm of MR)")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
CoG_histo

all_MR2$LRL.dec <- as.numeric(all_MR2$LRL.dec)
## Warning: NAs introduced by coercion
LRL.dec_histo <- gghistogram(all_MR2, x = "LRL.dec",
            add = "mean", rug = TRUE,
            color = "cond", fill = "cond", facet.by = "DAS",
            palette = c("#00AFBB", "#E7B800")) + xlab("Lateral Root Length decrease over MR (cm / cm of MR)")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
LRL.dec_histo
## Warning: Removed 2753 rows containing non-finite values (stat_bin).

the above doesnt really make sense - let’s replace all these extreme values (< -2, > 2) with “n.a.”)

temp <- subset(all_MR2, all_MR2$LRL.dec < 2)
temp <- subset(temp, temp$LRL.dec > -2)

LRL.dec_histo <- gghistogram(temp, x = "LRL.dec",
            add = "mean", rug = TRUE,
            color = "cond", fill = "cond", facet.by = "DAS",
            palette = c("#00AFBB", "#E7B800")) + xlab("Lateral Root Length decrease over MR (cm / cm of MR)")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
LRL.dec_histo

all_MR2$LRL.dec.R2 <- as.numeric(all_MR2$LRL.dec.R2)
## Warning: NAs introduced by coercion
LRL.dec.R2_histo <- gghistogram(all_MR2, x = "LRL.dec.R2",
                                add = "mean", rug = TRUE,
                                color = "cond", fill = "cond", facet.by = "DAS",
                                palette = c("#00AFBB", "#E7B800")) + xlab("R2 of Lateral Root Length decrease over MR")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
LRL.dec.R2_histo
## Warning: Removed 2740 rows containing non-finite values (stat_bin).

all_MR2$aLRL.median <- as.numeric(all_MR2$aLRL.median)
## Warning: NAs introduced by coercion
aLRL.median_histo <- gghistogram(all_MR2, x = "aLRL.median",
                                add = "mean", rug = TRUE,
                                color = "cond", fill = "cond", facet.by = "DAS",
                                palette = c("#00AFBB", "#E7B800")) + xlab("average Lateral Root Length median")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
aLRL.median_histo
## Warning: Removed 1473 rows containing non-finite values (stat_bin).

aLRL_histo <- gghistogram(all_MR2, x = "aLRL",
                                add = "mean", rug = TRUE,
                                color = "cond", fill = "cond", facet.by = "DAS",
                                palette = c("#00AFBB", "#E7B800")) + xlab("average Lateral Root Length")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
aLRL_histo
## Warning: Removed 1473 rows containing non-finite values (stat_bin).

visualization of changes in RSA across time:

Let’s try to visualize changes across the accessions throughout the time using the line graph - similar to ones in Awlia et al., 2020

First - what we need to do is to calculate the average per line and per condition:

colnames(all_MR2)
##  [1] "image"          "root_name"      "root"           "experiment"    
##  [5] "DAS"            "genotype"       "rep"            "cond"          
##  [9] "MRL"            "Apical"         "Branched"       "Basal"         
## [13] "aLRL.median"    "aLRL.SD"        "LRangle.median" "LRangle.SD"    
## [17] "Apical_perc"    "Branched_perc"  "Basal_perc"     "LR_no_10_100"  
## [21] "LR_no_20_100"   "LR_no_30_100"   "LR_no_40_100"   "LR_no_50_100"  
## [25] "LR_no_60_100"   "LR_no_70_100"   "LR_no_80_100"   "LR_no_90_100"  
## [29] "LR_no_100_100"  "LRL_10_100"     "LRL_20_100"     "LRL_30_100"    
## [33] "LRL_40_100"     "LRL_50_100"     "LRL_60_100"     "LRL_70_100"    
## [37] "LRL_80_100"     "LRL_90_100"     "LRL_100_100"    "CoG"           
## [41] "LRL.START"      "LRL.dec"        "LRL.dec.R2"     "LRL"           
## [45] "LRno"           "aLRL"           "TRS"            "MRL.p.TRS"     
## [49] "aLRL.p.TRS"     "LRL_10_perc"    "LRL_20_perc"    "LRL_30_perc"   
## [53] "LRL_40_perc"    "LRL_50_perc"    "LRL_60_perc"    "LRL_70_perc"   
## [57] "LRL_80_perc"    "LRL_90_perc"    "LRL_100_perc"   "LRno_10_perc"  
## [61] "LRno_20_perc"   "LRno_30_perc"   "LRno_40_perc"   "LRno_50_perc"  
## [65] "LRno_60_perc"   "LRno_70_perc"   "LRno_80_perc"   "LRno_90_perc"  
## [69] "LRno_100_perc"
library(doBy)

MR_sum <- summaryBy(data = all_MR2, MRL + LRL + LRno + aLRL + TRS + MRL.p.TRS + aLRL.p.TRS + CoG + LRL.dec  ~ genotype + cond + DAS)
head(MR_sum)
MR_sum$geno_cond <- paste(MR_sum$genotype, "_", MR_sum$cond, sep="")
MR_sum$cond <- gsub("C", "Control", MR_sum$cond)
MR_sum$cond <- gsub("S", "Salt Stress", MR_sum$cond)
colnames(MR_sum)[2] <- "Condition"
MR_sum$DAS < as.factor(MR_sum$DAS)
## Warning in Ops.factor(MR_sum$DAS, as.factor(MR_sum$DAS)): '<' not meaningful for
## factors
##    [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##   [25] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##   [49] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##   [73] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##   [97] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [121] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [145] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [169] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [193] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [217] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [241] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [265] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [289] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [313] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [337] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [361] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [385] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [409] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [433] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [457] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [481] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [505] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [529] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [553] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [577] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [601] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [625] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [649] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [673] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [697] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [721] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [745] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [769] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [793] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [817] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [841] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [865] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [889] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [913] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [937] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [961] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
##  [985] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1009] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1033] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1057] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1081] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1105] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1129] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1153] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1177] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1201] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1225] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1249] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1273] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1297] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1321] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1345] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1369] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1393] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1417] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1441] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1465] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1489] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1513] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1537] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1561] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1585] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1609] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1633] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1657] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1681] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1705] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1729] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1753] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1777] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1801] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1825] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1849] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1873] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1897] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1921] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1945] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1969] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [1993] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2017] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2041] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2065] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2089] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2113] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2137] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2161] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2185] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2209] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2233] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2257] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2281] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2305] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2329] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2353] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2377] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
## [2401] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
TRS_lgraph <- ggplot(data=MR_sum, aes(x= DAS, y=TRS.mean, group = geno_cond, color = Condition)) 
TRS_lgraph <- TRS_lgraph +geom_line(alpha = 0.1) 
TRS_lgraph <- TRS_lgraph + stat_summary(fun.data = mean_se, geom="ribbon", linetype=0, aes(group=Condition), alpha=0.3)+ stat_summary(fun.y=mean, aes(group= Condition),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
TRS_lgraph <- TRS_lgraph + stat_compare_means(aes(group = Condition), label = "p.signif", method = "t.test", hide.ns = T)
TRS_lgraph <- TRS_lgraph + scale_colour_manual(values = c("steelblue", "firebrick3"))
TRS_lgraph <- TRS_lgraph + ylab("Total Root Size (cm)") + xlab("Days After Treatment") + theme(legend.position=c(0.2, 0.8))
TRS_lgraph

MRL_lgraph <- ggplot(data=MR_sum, aes(x= DAS, y=MRL.mean, group = geno_cond, color = Condition)) 
MRL_lgraph <- MRL_lgraph +geom_line(alpha = 0.1) 
MRL_lgraph <- MRL_lgraph + stat_summary(fun.data = mean_se, geom="ribbon", linetype=0, aes(group=Condition), alpha=0.3) + stat_summary(fun.y=mean, aes(group= Condition),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
MRL_lgraph <- MRL_lgraph + stat_compare_means(aes(group = Condition), label = "p.signif", method = "t.test", hide.ns = T)
MRL_lgraph <- MRL_lgraph + scale_colour_manual(values = c("steelblue", "firebrick3"))
MRL_lgraph <- MRL_lgraph + ylab("Main Root Length (cm)") + xlab("Days After Stress") + theme(legend.position='none')
MRL_lgraph

LRL_lgraph <- ggplot(data=MR_sum, aes(x= DAS, y=LRL.mean, group = geno_cond, color = Condition)) 
LRL_lgraph <- LRL_lgraph +geom_line(alpha = 0.1) 
LRL_lgraph <- LRL_lgraph + stat_summary(fun.data = mean_se, geom="ribbon", linetype=0, aes(group=Condition), alpha=0.3)+ stat_summary(fun.y=mean, aes(group= Condition),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRL_lgraph <- LRL_lgraph + stat_compare_means(aes(group = Condition), label = "p.signif", method = "t.test", hide.ns = T)
LRL_lgraph <- LRL_lgraph + scale_colour_manual(values = c("steelblue", "firebrick3"))
LRL_lgraph <- LRL_lgraph + ylab("Lateral Root Length (cm)") + xlab("Days After Stress") + theme(legend.position='none')
LRL_lgraph

LRno_lgraph <- ggplot(data=MR_sum, aes(x= DAS, y=LRno.mean, group = geno_cond, color = Condition)) 
LRno_lgraph <- LRno_lgraph +geom_line(alpha = 0.1) 
LRno_lgraph <- LRno_lgraph + stat_summary(fun.data = mean_se, geom="ribbon", linetype=0, aes(group=Condition), alpha=0.3) + stat_summary(fun.y=mean, aes(group= Condition),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRno_lgraph <- LRno_lgraph + stat_compare_means(aes(group = Condition), label = "p.signif", method = "t.test", hide.ns = T)
LRno_lgraph <- LRno_lgraph + scale_colour_manual(values = c("steelblue", "firebrick3"))
LRno_lgraph <- LRno_lgraph + ylab("Lateral Root Number (per MR)") + xlab("Days After Stress") + theme(legend.position='none')
LRno_lgraph

CoG_lgraph <- ggplot(data=MR_sum, aes(x= DAS, y=CoG.mean, group = geno_cond, color = Condition)) 
CoG_lgraph <- CoG_lgraph +geom_line(alpha = 0.1) 
CoG_lgraph <- CoG_lgraph + stat_summary(fun.data = mean_se, geom="ribbon", linetype=0, aes(group=Condition), alpha=0.3) + stat_summary(fun.y=mean, aes(group= Condition),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
CoG_lgraph <- CoG_lgraph + stat_compare_means(aes(group = Condition), label = "p.signif", method = "t.test", hide.ns = T)
CoG_lgraph <- CoG_lgraph + scale_colour_manual(values = c("steelblue", "firebrick3"))
CoG_lgraph <- CoG_lgraph + ylab("Center of Gravity (cm of MR)") + xlab("Days After Stress") + theme(legend.position='none')
CoG_lgraph

LRL.dec_lgraph <- ggplot(data=MR_sum, aes(x= DAS, y=LRL.dec.mean, group = geno_cond, color = Condition)) 
LRL.dec_lgraph <- LRL.dec_lgraph +geom_line(alpha = 0.1) 
LRL.dec_lgraph <- LRL.dec_lgraph + stat_summary(fun.data = mean_se, geom="ribbon", linetype=0, aes(group=Condition), alpha=0.3) + stat_summary(fun.y=mean, aes(group= Condition),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRL.dec_lgraph <- LRL.dec_lgraph + stat_compare_means(aes(group = Condition), label = "p.signif", method = "t.test", hide.ns = T)
LRL.dec_lgraph <- LRL.dec_lgraph + scale_colour_manual(values = c("steelblue", "firebrick3"))
LRL.dec_lgraph <- LRL.dec_lgraph + ylab("decrease of LRL over MRL (cm / cm of MR)") + xlab("Days After Stress") + theme(legend.position='none')
LRL.dec_lgraph
## Warning: Removed 1184 rows containing non-finite values (stat_summary).
## Warning: Removed 1184 rows containing non-finite values (stat_summary).
## Warning: Removed 1184 rows containing non-finite values (stat_compare_means).
## Warning: Removed 1182 row(s) containing missing values (geom_path).

MRL.p.TRS_lgraph <- ggplot(data=MR_sum, aes(x= DAS, y=MRL.p.TRS.mean, group = geno_cond, color = Condition)) 
MRL.p.TRS_lgraph <- MRL.p.TRS_lgraph +geom_line(alpha = 0.1) 
MRL.p.TRS_lgraph <- MRL.p.TRS_lgraph + stat_summary(fun.data = mean_se, geom="ribbon", linetype=0, aes(group=Condition), alpha=0.3) + stat_summary(fun.y=mean, aes(group= Condition),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
MRL.p.TRS_lgraph <- MRL.p.TRS_lgraph + stat_compare_means(aes(group = Condition), label = "p.signif", method = "t.test", hide.ns = T)
MRL.p.TRS_lgraph <- MRL.p.TRS_lgraph + scale_colour_manual(values = c("steelblue", "firebrick3"))
MRL.p.TRS_lgraph <- MRL.p.TRS_lgraph + ylab("ratio (MRL / TRS)") + xlab("Days After Stress") + theme(legend.position='none')
MRL.p.TRS_lgraph

aLRL.p.TRS_lgraph <- ggplot(data=MR_sum, aes(x= DAS, y=aLRL.p.TRS.mean, group = geno_cond, color = Condition)) 
aLRL.p.TRS_lgraph <- aLRL.p.TRS_lgraph +geom_line(alpha = 0.1) 
aLRL.p.TRS_lgraph <- aLRL.p.TRS_lgraph + stat_summary(fun.data = mean_se, geom="ribbon", linetype=0, aes(group=Condition), alpha=0.3)
aLRL.p.TRS_lgraph <- aLRL.p.TRS_lgraph + stat_summary(fun.y=mean, aes(group= Condition),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
aLRL.p.TRS_lgraph <- aLRL.p.TRS_lgraph + stat_compare_means(aes(group = Condition), label = "p.signif", method = "t.test", hide.ns = T)
aLRL.p.TRS_lgraph <- aLRL.p.TRS_lgraph + scale_colour_manual(values = c("steelblue", "firebrick3")) 
aLRL.p.TRS_lgraph <- aLRL.p.TRS_lgraph + ylab("ratio (aLRL / TRS)") + xlab("Days After Stress") + theme(legend.position='none')
aLRL.p.TRS_lgraph
## Warning: Removed 738 rows containing non-finite values (stat_summary).
## Warning: Removed 738 rows containing non-finite values (stat_summary).
## Warning: Removed 738 rows containing non-finite values (stat_compare_means).
## Warning: Removed 727 row(s) containing missing values (geom_path).

Lets combine these into one figure:

pdf("Fig.TRS_MRL_LRL_LRno_CoG_MRLpTRS_Big01_to_Big06.pdf", height = 20, width = 15)
plot_grid(TRS_lgraph, MRL_lgraph,
          LRL_lgraph, LRno_lgraph,
          CoG_lgraph, MRL.p.TRS_lgraph, ncol=2, labels = "AUTO")
dev.off()
## quartz_off_screen 
##                 2

OK - let’s keep going with exploring other cool traits…

Vizualization of LRL/LRno distribution across the root:

In order to examine how the LR is distributed across MR - lets extract all the LR distribution traits

colnames(all_MR2)
##  [1] "image"          "root_name"      "root"           "experiment"    
##  [5] "DAS"            "genotype"       "rep"            "cond"          
##  [9] "MRL"            "Apical"         "Branched"       "Basal"         
## [13] "aLRL.median"    "aLRL.SD"        "LRangle.median" "LRangle.SD"    
## [17] "Apical_perc"    "Branched_perc"  "Basal_perc"     "LR_no_10_100"  
## [21] "LR_no_20_100"   "LR_no_30_100"   "LR_no_40_100"   "LR_no_50_100"  
## [25] "LR_no_60_100"   "LR_no_70_100"   "LR_no_80_100"   "LR_no_90_100"  
## [29] "LR_no_100_100"  "LRL_10_100"     "LRL_20_100"     "LRL_30_100"    
## [33] "LRL_40_100"     "LRL_50_100"     "LRL_60_100"     "LRL_70_100"    
## [37] "LRL_80_100"     "LRL_90_100"     "LRL_100_100"    "CoG"           
## [41] "LRL.START"      "LRL.dec"        "LRL.dec.R2"     "LRL"           
## [45] "LRno"           "aLRL"           "TRS"            "MRL.p.TRS"     
## [49] "aLRL.p.TRS"     "LRL_10_perc"    "LRL_20_perc"    "LRL_30_perc"   
## [53] "LRL_40_perc"    "LRL_50_perc"    "LRL_60_perc"    "LRL_70_perc"   
## [57] "LRL_80_perc"    "LRL_90_perc"    "LRL_100_perc"   "LRno_10_perc"  
## [61] "LRno_20_perc"   "LRno_30_perc"   "LRno_40_perc"   "LRno_50_perc"  
## [65] "LRno_60_perc"   "LRno_70_perc"   "LRno_80_perc"   "LRno_90_perc"  
## [69] "LRno_100_perc"
dim(all_MR2)
## [1] 8130   69
LR_distribution <- all_MR2[,c(1:8, 20:69)]
colnames(LR_distribution)
##  [1] "image"         "root_name"     "root"          "experiment"   
##  [5] "DAS"           "genotype"      "rep"           "cond"         
##  [9] "LR_no_10_100"  "LR_no_20_100"  "LR_no_30_100"  "LR_no_40_100" 
## [13] "LR_no_50_100"  "LR_no_60_100"  "LR_no_70_100"  "LR_no_80_100" 
## [17] "LR_no_90_100"  "LR_no_100_100" "LRL_10_100"    "LRL_20_100"   
## [21] "LRL_30_100"    "LRL_40_100"    "LRL_50_100"    "LRL_60_100"   
## [25] "LRL_70_100"    "LRL_80_100"    "LRL_90_100"    "LRL_100_100"  
## [29] "CoG"           "LRL.START"     "LRL.dec"       "LRL.dec.R2"   
## [33] "LRL"           "LRno"          "aLRL"          "TRS"          
## [37] "MRL.p.TRS"     "aLRL.p.TRS"    "LRL_10_perc"   "LRL_20_perc"  
## [41] "LRL_30_perc"   "LRL_40_perc"   "LRL_50_perc"   "LRL_60_perc"  
## [45] "LRL_70_perc"   "LRL_80_perc"   "LRL_90_perc"   "LRL_100_perc" 
## [49] "LRno_10_perc"  "LRno_20_perc"  "LRno_30_perc"  "LRno_40_perc" 
## [53] "LRno_50_perc"  "LRno_60_perc"  "LRno_70_perc"  "LRno_80_perc" 
## [57] "LRno_90_perc"  "LRno_100_perc"

Cool - then let’s extract only the last day, reshape the data and plot the absolute LRno and LRL across the MR portions:

4 days after stress

day4 <- subset(LR_distribution, LR_distribution$DAS == 4)
head(day4)
colnames(day4)
##  [1] "image"         "root_name"     "root"          "experiment"   
##  [5] "DAS"           "genotype"      "rep"           "cond"         
##  [9] "LR_no_10_100"  "LR_no_20_100"  "LR_no_30_100"  "LR_no_40_100" 
## [13] "LR_no_50_100"  "LR_no_60_100"  "LR_no_70_100"  "LR_no_80_100" 
## [17] "LR_no_90_100"  "LR_no_100_100" "LRL_10_100"    "LRL_20_100"   
## [21] "LRL_30_100"    "LRL_40_100"    "LRL_50_100"    "LRL_60_100"   
## [25] "LRL_70_100"    "LRL_80_100"    "LRL_90_100"    "LRL_100_100"  
## [29] "CoG"           "LRL.START"     "LRL.dec"       "LRL.dec.R2"   
## [33] "LRL"           "LRno"          "aLRL"          "TRS"          
## [37] "MRL.p.TRS"     "aLRL.p.TRS"    "LRL_10_perc"   "LRL_20_perc"  
## [41] "LRL_30_perc"   "LRL_40_perc"   "LRL_50_perc"   "LRL_60_perc"  
## [45] "LRL_70_perc"   "LRL_80_perc"   "LRL_90_perc"   "LRL_100_perc" 
## [49] "LRno_10_perc"  "LRno_20_perc"  "LRno_30_perc"  "LRno_40_perc" 
## [53] "LRno_50_perc"  "LRno_60_perc"  "LRno_70_perc"  "LRno_80_perc" 
## [57] "LRno_90_perc"  "LRno_100_perc"
LRno <- day4[,c(1:18)]
head(LRno)
LRL <- day4[,c(1:8,19:28)]
library(reshape2)
## 
## Attaching package: 'reshape2'
## The following object is masked from 'package:tidyr':
## 
##     smiths
mLRno <- melt(LRno, value.name = "LRno")
## Using image, root_name, root, experiment, DAS, genotype, rep, cond as id variables
mLRL <- melt(LRL, value.name = "LRL")
## Using image, root_name, root, experiment, DAS, genotype, rep, cond as id variables
head(mLRno)
head(mLRL)

cool - now let’s adjust the portion of the MR that is being used to calculate the LR distribution in “variable” columns:

mLRno$variable <- gsub("LR_no_", "", mLRno$variable)
mLRno$variable <- gsub("_100", "", mLRno$variable)

mLRL$variable <- gsub("LRL_", "", mLRL$variable)
mLRL$variable <- gsub("_100", "", mLRL$variable)

mLRL$variable <- as.numeric(mLRL$variable)
mLRno$variable <- as.numeric(mLRno$variable)
colnames(mLRL)[9] <- "perc.of.MRL"
colnames(mLRno)[9] <- "perc.of.MRL"
head(mLRL)
head(mLRno)
LRL_distribution_graph_d4 <- ggplot(data=mLRL, aes(x= perc.of.MRL, y=LRL, group = root_name, color = cond)) 
LRL_distribution_graph_d4 <- LRL_distribution_graph_d4 + geom_line(alpha = 0.1) + scale_colour_manual(values = c("dodgerblue3", "tomato1")) 
LRL_distribution_graph_d4 <- LRL_distribution_graph_d4 + stat_summary(fun.y=mean, aes(group= cond),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRL_distribution_graph_d4 <- LRL_distribution_graph_d4 + stat_summary(geom = "ribbon", linetype=0, fun.data = mean_cl_normal, aes(group= cond), alpha = 0.2)  + ggtitle("4 Days After Stress")
LRL_distribution_graph_d4 <- LRL_distribution_graph_d4 + theme(legend.position="none")+ labs(color = "Treatment")
LRL_distribution_graph_d4 <- LRL_distribution_graph_d4 + ylab("Lateral Root Length (cm)") + xlab("Portion of Main Root Length (%)") 
LRL_distribution_graph_d4 <- LRL_distribution_graph_d4 + stat_compare_means(aes(group = cond), label = "p.signif", method = "t.test", hide.ns = T)
LRL_distribution_graph_d4

LRno_distribution_graph_d4 <- ggplot(data=mLRno, aes(x= perc.of.MRL, y=LRno, group = root_name, color = cond)) 
LRno_distribution_graph_d4 <- LRno_distribution_graph_d4 + geom_line(alpha = 0.1) + scale_colour_manual(values = c("dodgerblue3", "tomato1")) 
LRno_distribution_graph_d4 <- LRno_distribution_graph_d4 + stat_summary(fun.y=mean, aes(group= cond),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRno_distribution_graph_d4 <- LRno_distribution_graph_d4 + stat_summary(geom = "ribbon", linetype=0, fun.data = mean_cl_normal, aes(group= cond), alpha = 0.2) + ggtitle("4 Days After Stress")
LRno_distribution_graph_d4 <- LRno_distribution_graph_d4 + theme(legend.position="none")+ labs(color = "Treatment")
LRno_distribution_graph_d4 <- LRno_distribution_graph_d4 + ylab("Lateral Root number") + xlab("Portion of Main Root Length (%)") 
LRno_distribution_graph_d4 <- LRno_distribution_graph_d4 + stat_compare_means(aes(group = cond), label = "p.signif", method = "t.test", hide.ns = T)
LRno_distribution_graph_d4

all good - but I think it would be better to calculate the above as %of LRL or %LRno per plant - then we can get better idea for clustering:

colnames(day4)
##  [1] "image"         "root_name"     "root"          "experiment"   
##  [5] "DAS"           "genotype"      "rep"           "cond"         
##  [9] "LR_no_10_100"  "LR_no_20_100"  "LR_no_30_100"  "LR_no_40_100" 
## [13] "LR_no_50_100"  "LR_no_60_100"  "LR_no_70_100"  "LR_no_80_100" 
## [17] "LR_no_90_100"  "LR_no_100_100" "LRL_10_100"    "LRL_20_100"   
## [21] "LRL_30_100"    "LRL_40_100"    "LRL_50_100"    "LRL_60_100"   
## [25] "LRL_70_100"    "LRL_80_100"    "LRL_90_100"    "LRL_100_100"  
## [29] "CoG"           "LRL.START"     "LRL.dec"       "LRL.dec.R2"   
## [33] "LRL"           "LRno"          "aLRL"          "TRS"          
## [37] "MRL.p.TRS"     "aLRL.p.TRS"    "LRL_10_perc"   "LRL_20_perc"  
## [41] "LRL_30_perc"   "LRL_40_perc"   "LRL_50_perc"   "LRL_60_perc"  
## [45] "LRL_70_perc"   "LRL_80_perc"   "LRL_90_perc"   "LRL_100_perc" 
## [49] "LRno_10_perc"  "LRno_20_perc"  "LRno_30_perc"  "LRno_40_perc" 
## [53] "LRno_50_perc"  "LRno_60_perc"  "LRno_70_perc"  "LRno_80_perc" 
## [57] "LRno_90_perc"  "LRno_100_perc"
LRno_perc <- day4[,c(1:8,49:58)]
LRL_perc <- day4[,c(1:8,39:48)]
head(LRno_perc)
head(LRL_perc)
mLRno_perc <- melt(LRno_perc, value.name = "LRno.perc")
## Using image, root_name, root, experiment, DAS, genotype, rep, cond as id variables
mLRL_perc <- melt(LRL_perc, value.name = "LRL.perc")
## Using image, root_name, root, experiment, DAS, genotype, rep, cond as id variables
head(mLRno_perc)
head(mLRL_perc)
unique(mLRno_perc$variable)
##  [1] LRno_10_perc  LRno_20_perc  LRno_30_perc  LRno_40_perc  LRno_50_perc 
##  [6] LRno_60_perc  LRno_70_perc  LRno_80_perc  LRno_90_perc  LRno_100_perc
## 10 Levels: LRno_10_perc LRno_20_perc LRno_30_perc LRno_40_perc ... LRno_100_perc
mLRno_perc$variable <- gsub("LRno_", "", mLRno_perc$variable)
mLRL_perc$variable <- gsub("LRL_", "", mLRL_perc$variable)

mLRno_perc$variable <- gsub("_perc", "", mLRno_perc$variable)
mLRL_perc$variable <- gsub("_perc", "", mLRL_perc$variable)

mLRno_perc$variable <- as.numeric(mLRno_perc$variable)
mLRL_perc$variable <- as.numeric(mLRL_perc$variable)

colnames(mLRno_perc)[9] <- "perc.of.MRL"
colnames(mLRL_perc)[9] <- "perc.of.MRL"
head(mLRno_perc)
head(mLRL_perc)

OK - now let’s recalculate these graphs:

LRL_distribution_graph_d4_perc <- ggplot(data=mLRL_perc, aes(x= perc.of.MRL, y=LRL.perc, group = root_name, color = cond)) 
LRL_distribution_graph_d4_perc <- LRL_distribution_graph_d4_perc + geom_line(alpha = 0.1) + scale_colour_manual(values = c("dodgerblue3", "tomato1")) 
LRL_distribution_graph_d4_perc <- LRL_distribution_graph_d4_perc + stat_summary(fun.y=mean, aes(group= cond),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRL_distribution_graph_d4_perc <- LRL_distribution_graph_d4_perc + stat_summary(geom = "ribbon", linetype=0, fun.data = mean_cl_normal, aes(group= cond), alpha = 0.2) + ggtitle("4 Days After Stress")
LRL_distribution_graph_d4_perc <- LRL_distribution_graph_d4_perc + theme(legend.position="none")+ labs(color = "Treatment")
LRL_distribution_graph_d4_perc <- LRL_distribution_graph_d4_perc + ylab("Lateral Root Length (fraction of total LRL)") + xlab("Portion of Main Root Length (%)") 
LRL_distribution_graph_d4_perc <- LRL_distribution_graph_d4_perc + stat_compare_means(aes(group = cond), label = "p.signif", method = "t.test", hide.ns = T)
LRL_distribution_graph_d4_perc
## Warning: Removed 190 rows containing non-finite values (stat_summary).
## Warning: Removed 190 rows containing non-finite values (stat_summary).
## Warning: Removed 190 rows containing non-finite values (stat_compare_means).
## Warning: Removed 181 row(s) containing missing values (geom_path).

LRno_distribution_graph_d4_perc <- ggplot(data=mLRno_perc, aes(x= perc.of.MRL, y=LRno.perc, group = root_name, color = cond)) 
LRno_distribution_graph_d4_perc <- LRno_distribution_graph_d4_perc + geom_line(alpha = 0.1) + scale_colour_manual(values = c("dodgerblue3", "tomato1")) 
LRno_distribution_graph_d4_perc <- LRno_distribution_graph_d4_perc + stat_summary(fun.y=mean, aes(group= cond),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRno_distribution_graph_d4_perc <- LRno_distribution_graph_d4_perc + stat_summary(geom = "ribbon", linetype=0, fun.data = mean_cl_normal, aes(group= cond), alpha = 0.2) + ggtitle("4 Days After Stress")
LRno_distribution_graph_d4_perc <- LRno_distribution_graph_d4_perc + theme(legend.position="none")+ labs(color = "Treatment")
LRno_distribution_graph_d4_perc <- LRno_distribution_graph_d4_perc + ylab("Lateral Root number (fraction of total LR #)") + xlab("Portion of Main Root Length (%)") 
LRno_distribution_graph_d4_perc <- LRno_distribution_graph_d4_perc + stat_compare_means(aes(group = cond), label = "p.signif", method = "t.test", hide.ns = T)
LRno_distribution_graph_d4_perc
## Warning: Removed 190 rows containing non-finite values (stat_summary).
## Warning: Removed 190 rows containing non-finite values (stat_summary).
## Warning: Removed 190 rows containing non-finite values (stat_compare_means).
## Warning: Removed 181 row(s) containing missing values (geom_path).

OK - so the percentage of LRL is definitely more informative. Let’s have a look how it looks in earlier days:

3 days after stress

day3 <- subset(all_MR2, all_MR2$DAS == 3)
colnames(day3)
##  [1] "image"          "root_name"      "root"           "experiment"    
##  [5] "DAS"            "genotype"       "rep"            "cond"          
##  [9] "MRL"            "Apical"         "Branched"       "Basal"         
## [13] "aLRL.median"    "aLRL.SD"        "LRangle.median" "LRangle.SD"    
## [17] "Apical_perc"    "Branched_perc"  "Basal_perc"     "LR_no_10_100"  
## [21] "LR_no_20_100"   "LR_no_30_100"   "LR_no_40_100"   "LR_no_50_100"  
## [25] "LR_no_60_100"   "LR_no_70_100"   "LR_no_80_100"   "LR_no_90_100"  
## [29] "LR_no_100_100"  "LRL_10_100"     "LRL_20_100"     "LRL_30_100"    
## [33] "LRL_40_100"     "LRL_50_100"     "LRL_60_100"     "LRL_70_100"    
## [37] "LRL_80_100"     "LRL_90_100"     "LRL_100_100"    "CoG"           
## [41] "LRL.START"      "LRL.dec"        "LRL.dec.R2"     "LRL"           
## [45] "LRno"           "aLRL"           "TRS"            "MRL.p.TRS"     
## [49] "aLRL.p.TRS"     "LRL_10_perc"    "LRL_20_perc"    "LRL_30_perc"   
## [53] "LRL_40_perc"    "LRL_50_perc"    "LRL_60_perc"    "LRL_70_perc"   
## [57] "LRL_80_perc"    "LRL_90_perc"    "LRL_100_perc"   "LRno_10_perc"  
## [61] "LRno_20_perc"   "LRno_30_perc"   "LRno_40_perc"   "LRno_50_perc"  
## [65] "LRno_60_perc"   "LRno_70_perc"   "LRno_80_perc"   "LRno_90_perc"  
## [69] "LRno_100_perc"
LRno_perc <- day3[,c(1:8,60:69)]
LRL_perc <- day3[,c(1:8,50:59)]
mLRno_perc <- melt(LRno_perc, value.name = "LRno.perc")
## Using image, root_name, root, experiment, DAS, genotype, rep, cond as id variables
mLRL_perc <- melt(LRL_perc, value.name = "LRL.perc")
## Using image, root_name, root, experiment, DAS, genotype, rep, cond as id variables
mLRno_perc$variable <- gsub("LRno_", "", mLRno_perc$variable)
mLRL_perc$variable <- gsub("LRL_", "", mLRL_perc$variable)

mLRno_perc$variable <- gsub("_perc", "", mLRno_perc$variable)
mLRL_perc$variable <- gsub("_perc", "", mLRL_perc$variable)

mLRno_perc$variable <- as.numeric(mLRno_perc$variable)
mLRL_perc$variable <- as.numeric(mLRL_perc$variable)

colnames(mLRno_perc)[9] <- "perc.of.MRL"
colnames(mLRL_perc)[9] <- "perc.of.MRL"

LRL_distribution_graph_d3_perc <- ggplot(data=mLRL_perc, aes(x= perc.of.MRL, y=LRL.perc, group = root_name, color = cond)) 
LRL_distribution_graph_d3_perc <- LRL_distribution_graph_d3_perc + geom_line(alpha = 0.1) + scale_colour_manual(values = c("dodgerblue3", "tomato1")) + ylim(0,1)
LRL_distribution_graph_d3_perc <- LRL_distribution_graph_d3_perc + stat_summary(fun.y=mean, aes(group= cond),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRL_distribution_graph_d3_perc <- LRL_distribution_graph_d3_perc + stat_summary(geom = "ribbon", linetype=0, fun.data = mean_cl_normal, aes(group= cond), alpha = 0.2) + ggtitle("3 Days After Stress")
LRL_distribution_graph_d3_perc <- LRL_distribution_graph_d3_perc + theme(legend.position="none")+ labs(color = "Treatment")
LRL_distribution_graph_d3_perc <- LRL_distribution_graph_d3_perc + ylab("Lateral Root Length (fraction of total LRL)") + xlab("Portion of Main Root Length (%)") 
LRL_distribution_graph_d3_perc <- LRL_distribution_graph_d3_perc + stat_compare_means(aes(group = cond), label = "p.signif", method = "t.test", hide.ns = T)
LRL_distribution_graph_d3_perc
## Warning: Removed 660 rows containing non-finite values (stat_summary).
## Warning: Removed 660 rows containing non-finite values (stat_summary).
## Warning: Removed 660 rows containing non-finite values (stat_compare_means).
## Warning: Removed 633 row(s) containing missing values (geom_path).

LRno_distribution_graph_d3_perc <- ggplot(data=mLRno_perc, aes(x= perc.of.MRL, y=LRno.perc, group = root_name, color = cond)) 
LRno_distribution_graph_d3_perc <- LRno_distribution_graph_d3_perc + geom_line(alpha = 0.1) + scale_colour_manual(values = c("dodgerblue3", "tomato1")) + ylim(0,1)
LRno_distribution_graph_d3_perc <- LRno_distribution_graph_d3_perc + stat_summary(fun.y=mean, aes(group= cond),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRno_distribution_graph_d3_perc <- LRno_distribution_graph_d3_perc + stat_summary(geom = "ribbon", linetype=0, fun.data = mean_cl_normal, aes(group= cond), alpha = 0.2) + ggtitle("3 Days After Stress")
LRno_distribution_graph_d3_perc <- LRno_distribution_graph_d3_perc + theme(legend.position="none")+ labs(color = "Treatment")
LRno_distribution_graph_d3_perc <- LRno_distribution_graph_d3_perc + ylab("Lateral Root number (fraction of total LR #)") + xlab("Portion of Main Root Length (%)") 
LRno_distribution_graph_d3_perc <- LRno_distribution_graph_d3_perc + stat_compare_means(aes(group = cond), label = "p.signif", method = "t.test", hide.ns = T)
LRno_distribution_graph_d3_perc
## Warning: Removed 660 rows containing non-finite values (stat_summary).
## Warning: Removed 660 rows containing non-finite values (stat_summary).
## Warning: Removed 660 rows containing non-finite values (stat_compare_means).
## Warning: Removed 633 row(s) containing missing values (geom_path).

day2 <- subset(all_MR2, all_MR2$DAS == 2)
LRno_perc <- day2[,c(1:8,60:69)]
LRL_perc <- day2[,c(1:8,50:59)]
mLRno_perc <- melt(LRno_perc, value.name = "LRno.perc")
## Using image, root_name, root, experiment, DAS, genotype, rep, cond as id variables
mLRL_perc <- melt(LRL_perc, value.name = "LRL.perc")
## Using image, root_name, root, experiment, DAS, genotype, rep, cond as id variables
mLRno_perc$variable <- gsub("LRno_", "", mLRno_perc$variable)
mLRL_perc$variable <- gsub("LRL_", "", mLRL_perc$variable)

mLRno_perc$variable <- gsub("_perc", "", mLRno_perc$variable)
mLRL_perc$variable <- gsub("_perc", "", mLRL_perc$variable)

mLRno_perc$variable <- as.numeric(mLRno_perc$variable)
mLRL_perc$variable <- as.numeric(mLRL_perc$variable)

colnames(mLRno_perc)[9] <- "perc.of.MRL"
colnames(mLRL_perc)[9] <- "perc.of.MRL"

LRL_distribution_graph_d2_perc <- ggplot(data=mLRL_perc, aes(x= perc.of.MRL, y=LRL.perc, group = root_name, color = cond)) 
LRL_distribution_graph_d2_perc <- LRL_distribution_graph_d2_perc + geom_line(alpha = 0.1) + scale_colour_manual(values = c("dodgerblue3", "tomato1")) + ylim(0,1)
LRL_distribution_graph_d2_perc <- LRL_distribution_graph_d2_perc + stat_summary(fun.y=mean, aes(group= cond),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRL_distribution_graph_d2_perc <- LRL_distribution_graph_d2_perc + stat_summary(geom = "ribbon", linetype=0, fun.data = mean_cl_normal, aes(group= cond), alpha = 0.2) + ggtitle("2 Days After Stress")
LRL_distribution_graph_d2_perc <- LRL_distribution_graph_d2_perc + theme(legend.position="none")+ labs(color = "Treatment")
LRL_distribution_graph_d2_perc <- LRL_distribution_graph_d2_perc + ylab("Lateral Root Length (fraction of total LRL)") + xlab("Portion of Main Root Length (%)") 
LRL_distribution_graph_d2_perc <- LRL_distribution_graph_d2_perc + stat_compare_means(aes(group = cond), label = "p.signif", method = "t.test", hide.ns = T)
LRL_distribution_graph_d2_perc
## Warning: Removed 1500 rows containing non-finite values (stat_summary).
## Warning: Removed 1500 rows containing non-finite values (stat_summary).
## Warning: Removed 1500 rows containing non-finite values (stat_compare_means).
## Warning: Removed 1410 row(s) containing missing values (geom_path).

LRno_distribution_graph_d2_perc <- ggplot(data=mLRno_perc, aes(x= perc.of.MRL, y=LRno.perc, group = root_name, color = cond)) 
LRno_distribution_graph_d2_perc <- LRno_distribution_graph_d2_perc + geom_line(alpha = 0.1) + scale_colour_manual(values = c("dodgerblue3", "tomato1")) + ylim(0,1)
LRno_distribution_graph_d2_perc <- LRno_distribution_graph_d2_perc + stat_summary(fun.y=mean, aes(group= cond),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRno_distribution_graph_d2_perc <- LRno_distribution_graph_d2_perc + stat_summary(geom = "ribbon", linetype=0, fun.data = mean_cl_normal, aes(group= cond), alpha = 0.2) + ggtitle("2 Days After Stress")
LRno_distribution_graph_d2_perc <- LRno_distribution_graph_d2_perc + theme(legend.position="none")+ labs(color = "Treatment")
LRno_distribution_graph_d2_perc <- LRno_distribution_graph_d2_perc + ylab("Lateral Root number (fraction of total LR #)") + xlab("Portion of Main Root Length (%)") 
LRno_distribution_graph_d2_perc <- LRno_distribution_graph_d2_perc + stat_compare_means(aes(group = cond), label = "p.signif", method = "t.test", hide.ns = T)
LRno_distribution_graph_d2_perc
## Warning: Removed 1500 rows containing non-finite values (stat_summary).
## Warning: Removed 1500 rows containing non-finite values (stat_summary).
## Warning: Removed 1500 rows containing non-finite values (stat_compare_means).
## Warning: Removed 1410 row(s) containing missing values (geom_path).

day1 <- subset(all_MR2, all_MR2$DAS == 1)
LRno_perc <- day1[,c(1:8,60:69)]
LRL_perc <- day1[,c(1:8,50:59)]
mLRno_perc <- melt(LRno_perc, value.name = "LRno.perc")
## Using image, root_name, root, experiment, DAS, genotype, rep, cond as id variables
mLRL_perc <- melt(LRL_perc, value.name = "LRL.perc")
## Using image, root_name, root, experiment, DAS, genotype, rep, cond as id variables
mLRno_perc$variable <- gsub("LRno_", "", mLRno_perc$variable)
mLRL_perc$variable <- gsub("LRL_", "", mLRL_perc$variable)

mLRno_perc$variable <- gsub("_perc", "", mLRno_perc$variable)
mLRL_perc$variable <- gsub("_perc", "", mLRL_perc$variable)

mLRno_perc$variable <- as.numeric(mLRno_perc$variable)
mLRL_perc$variable <- as.numeric(mLRL_perc$variable)

colnames(mLRno_perc)[9] <- "perc.of.MRL"
colnames(mLRL_perc)[9] <- "perc.of.MRL"

LRL_distribution_graph_d1_perc <- ggplot(data=mLRL_perc, aes(x= perc.of.MRL, y=LRL.perc, group = root_name, color = cond)) 
LRL_distribution_graph_d1_perc <- LRL_distribution_graph_d1_perc + geom_line(alpha = 0.1) + scale_colour_manual(values = c("dodgerblue3", "tomato1")) + ylim(0,1)
LRL_distribution_graph_d1_perc <- LRL_distribution_graph_d1_perc + stat_summary(fun.y=mean, aes(group= cond),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRL_distribution_graph_d1_perc <- LRL_distribution_graph_d1_perc + stat_summary(geom = "ribbon", linetype=0, fun.data = mean_cl_normal, aes(group= cond), alpha = 0.2) + ggtitle("1 Day After Stress")
LRL_distribution_graph_d1_perc <- LRL_distribution_graph_d1_perc + theme(legend.position="none")+ labs(color = "Treatment")
LRL_distribution_graph_d1_perc <- LRL_distribution_graph_d1_perc + ylab("Lateral Root Length (fraction of total LRL)") + xlab("Portion of Main Root Length (%)") 
LRL_distribution_graph_d1_perc <- LRL_distribution_graph_d1_perc + stat_compare_means(aes(group = cond), label = "p.signif", method = "t.test", hide.ns = T)
LRL_distribution_graph_d1_perc
## Warning: Removed 2970 rows containing non-finite values (stat_summary).
## Warning: Removed 2970 rows containing non-finite values (stat_summary).
## Warning: Removed 2970 rows containing non-finite values (stat_compare_means).
## Warning: Removed 2826 row(s) containing missing values (geom_path).

LRno_distribution_graph_d1_perc <- ggplot(data=mLRno_perc, aes(x= perc.of.MRL, y=LRno.perc, group = root_name, color = cond)) 
LRno_distribution_graph_d1_perc <- LRno_distribution_graph_d1_perc + geom_line(alpha = 0.1) + scale_colour_manual(values = c("dodgerblue3", "tomato1")) + ylim(0,1)
LRno_distribution_graph_d1_perc <- LRno_distribution_graph_d1_perc + stat_summary(fun.y=mean, aes(group= cond),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
LRno_distribution_graph_d1_perc <- LRno_distribution_graph_d1_perc + stat_summary(geom = "ribbon", linetype=0, fun.data = mean_cl_normal, aes(group= cond), alpha = 0.2) + ggtitle("1 Day After Stress")
LRno_distribution_graph_d1_perc <- LRno_distribution_graph_d1_perc + theme(legend.position="none")+ labs(color = "Treatment")
LRno_distribution_graph_d1_perc <- LRno_distribution_graph_d1_perc + ylab("Lateral Root number (fraction of total LR #)") + xlab("Portion of Main Root Length (%)") 
LRno_distribution_graph_d1_perc <- LRno_distribution_graph_d1_perc + stat_compare_means(aes(group = cond), label = "p.signif", method = "t.test", hide.ns = T)
LRno_distribution_graph_d1_perc
## Warning: Removed 2970 rows containing non-finite values (stat_summary).
## Warning: Removed 2970 rows containing non-finite values (stat_summary).
## Warning: Removed 2970 rows containing non-finite values (stat_compare_means).
## Warning: Removed 2826 row(s) containing missing values (geom_path).

ok - maybe let’s combine these graphs into a figure thus far:

library(cowplot)
pdf("Fig.Lateral_root_distribution_across_MRL_DAS1_DAS4_Big01_to_Big06.pdf", height = 20, width = 15)
plot_grid(LRL_distribution_graph_d1_perc, LRno_distribution_graph_d1_perc,
          LRL_distribution_graph_d2_perc, LRno_distribution_graph_d2_perc,
          LRL_distribution_graph_d3_perc, LRno_distribution_graph_d3_perc,
          LRL_distribution_graph_d4_perc, LRno_distribution_graph_d4_perc, ncol=2, labels = "AUTO")
## Warning: Removed 2970 rows containing non-finite values (stat_summary).

## Warning: Removed 2970 rows containing non-finite values (stat_summary).
## Warning: Removed 2970 rows containing non-finite values (stat_compare_means).
## Warning: Removed 2826 row(s) containing missing values (geom_path).
## Warning: Removed 2970 rows containing non-finite values (stat_summary).

## Warning: Removed 2970 rows containing non-finite values (stat_summary).
## Warning: Removed 2970 rows containing non-finite values (stat_compare_means).
## Warning: Removed 2826 row(s) containing missing values (geom_path).
## Warning: Removed 1500 rows containing non-finite values (stat_summary).

## Warning: Removed 1500 rows containing non-finite values (stat_summary).
## Warning: Removed 1500 rows containing non-finite values (stat_compare_means).
## Warning: Removed 1410 row(s) containing missing values (geom_path).
## Warning: Removed 1500 rows containing non-finite values (stat_summary).

## Warning: Removed 1500 rows containing non-finite values (stat_summary).
## Warning: Removed 1500 rows containing non-finite values (stat_compare_means).
## Warning: Removed 1410 row(s) containing missing values (geom_path).
## Warning: Removed 660 rows containing non-finite values (stat_summary).

## Warning: Removed 660 rows containing non-finite values (stat_summary).
## Warning: Removed 660 rows containing non-finite values (stat_compare_means).
## Warning: Removed 633 row(s) containing missing values (geom_path).
## Warning: Removed 660 rows containing non-finite values (stat_summary).

## Warning: Removed 660 rows containing non-finite values (stat_summary).
## Warning: Removed 660 rows containing non-finite values (stat_compare_means).
## Warning: Removed 633 row(s) containing missing values (geom_path).
## Warning: Removed 190 rows containing non-finite values (stat_summary).

## Warning: Removed 190 rows containing non-finite values (stat_summary).
## Warning: Removed 190 rows containing non-finite values (stat_compare_means).
## Warning: Removed 181 row(s) containing missing values (geom_path).
## Warning: Removed 190 rows containing non-finite values (stat_summary).

## Warning: Removed 190 rows containing non-finite values (stat_summary).
## Warning: Removed 190 rows containing non-finite values (stat_compare_means).
## Warning: Removed 181 row(s) containing missing values (geom_path).
dev.off()
## quartz_off_screen 
##                 2

Calculating growth rates for each plant:

OK - so now we have all the data organized and everything seems to look pretty sane - let’s start calculating the growth rate of aLRL, LR# and MR. The problem is that in some cases - the MR grew into the plate - and we didnt continue tracing it - so the length is getting staled. So - in these cases - I would like to calculate the growth rate only over the period where the size of the root is actually increasing. So:

First - set the “day” ad numeric variable - because this will later come and bite us in our asses:

all_MR2$DAS <- as.numeric(as.character(all_MR2$DAS))
head(all_MR2)

Establishing calculations

Second - isolate one plant from the dataset, sort per day, and mark which of the values for MR are duplicates:

temp1 <- subset(all_MR2, all_MR2$root == unique(all_MR2$root)[100])
temp2 <- temp1[order(temp1$DAS),]
head(temp2)
temp2$MRdouble <- "no"
for(i in 2:nrow(temp2)){
 if(temp2$MRL[i] == temp2$MRL[i-1]){
  temp2$MRdouble[i] <- "yes"   
 } 
  else{
  temp2$MRdouble[i] <- "no"   
 } 
}

temp3 <- subset(temp2, temp2$MRdouble == "no")
temp3

Now that we have the dataset without duplicated values - let’s calculate MR growth rate using linear function:

plot(temp3$MRL ~ temp3$DAS)
abline(lm(temp3$MRL ~ temp3$DAS))

Let’s check if this is also true for #LR:

temp2$LRnodouble <- "no"
for(i in 2:5){
 if(temp2$LRno[i] == temp2$LRno[i-1]){
  temp2$LRnodouble[i] <- "yes"   
 } 
  else{
  temp2$LRnodouble[i] <- "no"   
 } 
}

temp3 <- subset(temp2, temp2$LRnodouble == "no")

plot(temp3$LRno ~ temp3$DAS)
abline(lm(temp3$LRno ~ temp3$DAS))

and for aLRL:

temp2$aLRLdouble <- "no"
for(i in 2:5){
 if(temp2$aLRL[i] == temp2$aLRL[i-1]){
  temp2$aLRLdouble[i] <- "yes"   
 } 
  else{
  temp2$aLRLdouble[i] <- "no"   
 } 
}
temp2
temp3 <- subset(temp2, temp2$aLRLdouble == "no")

plot(temp3$aLRL ~ temp3$DAS)
abline(lm(temp3$aLRL ~ temp3$DAS))

Looped linear modeling for all RSA components

First - let’s construct the dataframe which will hold all the data points:

names <- c(text="root_name", "genotype", "cond", "MR.intercept", "MR.delta", "LRno.intercept", "LRno.delta", "aLRL.intercept", "aLRL.delta")
growth_factors <- data.frame()

for (k in names) growth_factors[[k]] <- as.character()

just few fixes:

all_MR2$root_name<- gsub("2800_3_S", "280_3_S", all_MR2$root_name)
all_MR2 <- subset(all_MR2, all_MR2$image != "_set1_day1_20190930_093.rsml")
all_MR2 <- subset(all_MR2, all_MR2$image != "_set1_day1_20190930_090.rsml") 
all_MR2 <- subset(all_MR2, all_MR2$image != "_set1_day1_20190930_067.rsml")
all_MR2 <- subset(all_MR2, all_MR2$image != "_set1_day1_20191008_047_FU.rsml")

Then - let’s loop it in for calculating the Main Root growth factors:

length(unique(all_MR2$root_name))
## [1] 1630
for(e in 1:length(unique(all_MR2$root_name))){
  temp1 <- subset(all_MR2, all_MR2$root_name == unique(all_MR2$root_name)[e])
  temp2 <- temp1[order(temp1$DAS),]
  dim(temp2)
  temp2
  if(dim(temp2)[1] > 2){
    
  # Main root part
  temp2$MRdouble <- "no"
  for(i in 2:nrow(temp2)){
   if(temp2$MRL[i] == temp2$MRL[i-1]){
    temp2$MRdouble[i] <- "yes"   
   } 
    else{
    temp2$MRdouble[i] <- "no"   
   } 
  }
  
  temp2
  # Main Root Growth Factor calculations: 
  temp3 <- subset(temp2, temp2$MRdouble == "no")
  model <- lm(temp3$MRL ~ temp3$DAS)
  growth_factors[e,1] <- temp3$root_name[1]
  growth_factors[e,2] <- temp3$genotype[1]
  growth_factors[e,3] <- temp3$cond[1]
  growth_factors[e,4] <- as.numeric(as.character(model$coefficients[[1]]))
  growth_factors[e,5] <- as.numeric(as.character(model$coefficients[[2]]))
  
  }
}
dim(growth_factors)
## [1] 1629    9

Great - let’s calculate the LRno increase rate - with some special conditions for the lines which don’t have any LR:

for(e in 1:length(unique(all_MR2$root_name))){
  temp1 <- subset(all_MR2, all_MR2$root_name == unique(all_MR2$root_name)[e])
  temp2 <- temp1[order(temp1$DAS),]

 # Let's remove all NA for LRno and aLRL in temp2
  super_temp <- temp2[,c("DAS", "LRno", "aLRL")]
  temp2 <- na.omit(super_temp)
  
  if(dim(temp2)[1] > 1){
    model <- lm(temp2$LRno ~ temp2$DAS)
    growth_factors[e,6] <- as.numeric(as.character(model$coefficients[[1]]))
    growth_factors[e,7] <- as.numeric(as.character(model$coefficients[[2]]))  
  }
  # Lateral Root Number Increase calculations:
  else{
    growth_factors[e,6] <- 0
    growth_factors[e,7] <- 0
  }
}  

Same thing for aLRL:

for(e in 1:length(unique(all_MR2$root_name))){
  temp1 <- subset(all_MR2, all_MR2$root_name == unique(all_MR2$root_name)[e])
  temp2 <- temp1[order(temp1$DAS),]

 # Let's remove all NA for LRno and aLRL in temp2
  super_temp <- temp2[,c("DAS", "LRno", "aLRL")]
  temp2 <- na.omit(super_temp)
  temp2
  dim(temp2)[1]
  if(dim(temp2)[1] > 1){
    model <- lm(temp2$aLRL ~ temp2$DAS)
    model
    growth_factors[e,8] <- as.numeric(as.character(model$coefficients[[1]]))
    growth_factors[e,9] <- as.numeric(as.character(model$coefficients[[2]]))  
  }
  # Lateral Root Number Increase calculations:
  else{
    growth_factors[e,8] <- 0
    growth_factors[e,9] <- 0
  }
}  

Let’s have a look at the growth_factors table:

growth_factors
min(growth_factors$MR.delta)
## [1] NA
min(growth_factors$LRno.delta)
## [1] NA
min(growth_factors$aLRL.delta)
## [1] NA
max(growth_factors$MR.delta)
## [1] NA
max(growth_factors$LRno.delta)
## [1] NA
max(growth_factors$aLRL.delta)
## [1] NA
sapply(growth_factors, class)
##      root_name       genotype           cond   MR.intercept       MR.delta 
##    "character"    "character"    "character"    "character"    "character" 
## LRno.intercept     LRno.delta aLRL.intercept     aLRL.delta 
##    "character"    "character"    "character"    "character"
growth_factors$MR.delta <- as.numeric(growth_factors$MR.delta)
growth_factors$LRno.delta <- as.numeric(growth_factors$LRno.delta)
growth_factors$aLRL.delta <- as.numeric(growth_factors$aLRL.delta)

want <- c("S", "C")
growth_factors <- subset(growth_factors, growth_factors$cond %in% want)
growth_factors <- na.omit(growth_factors)

min(growth_factors$MR.delta)
## [1] -0.1994374
min(growth_factors$LRno.delta)
## [1] -0.3
min(growth_factors$aLRL.delta)
## [1] -0.6464143
max(growth_factors$MR.delta)
## [1] 3.241177
max(growth_factors$LRno.delta)
## [1] 23
max(growth_factors$aLRL.delta)
## [1] 1.394096
growth_factors <- subset(growth_factors, growth_factors$MR.delta > 0)
growth_factors <- subset(growth_factors, growth_factors$LRno.delta > 0)
growth_factors <- subset(growth_factors, growth_factors$LRno.delta < 18)
growth_factors <- subset(growth_factors, growth_factors$aLRL.delta > 0)

Histograms for growth rates

Most values seem to be in the reasonable range - but let’s have a look at the histogram

MR.delta_histo <- gghistogram(growth_factors, x = "MR.delta",
            add = "mean", rug = TRUE,
            color = "cond", fill = "cond", 
            palette = c("#00AFBB", "#E7B800")) + xlab("Main Root Growth (cm / day)")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
MR.delta_histo

LRno.delta_histo <- gghistogram(growth_factors, x = "LRno.delta",
            add = "mean", rug = TRUE,
            color = "cond", fill = "cond", 
            palette = c("#00AFBB", "#E7B800")) + xlab("Increase in Lateral Root number (# LR / day)")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
LRno.delta_histo

aLRL.delta_histo <- gghistogram(growth_factors, x = "aLRL.delta",
            add = "mean", rug = TRUE,
            color = "cond", fill = "cond", 
            palette = c("#00AFBB", "#E7B800")) + xlab("average Lateral Root Growth (cm / day)")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
aLRL.delta_histo

awesome - let’s save this into one figure as well:

pdf("Fig.Growth_rates_histograms_MR_noLR_aLRL.pdf", width = 7.5, height = 10)
plot_grid(MR.delta_histo, LRno.delta_histo, aLRL.delta_histo, ncol=1, labels = "AUTO")
dev.off()
## quartz_off_screen 
##                 2

reproducibility within accessions for growth rates:

let’s have a look what is the diversity of growth rates within accessions:

grand.means <- aggregate(MR.delta ~ cond, data = growth_factors, FUN = mean)
grand.means
unique(growth_factors$genotype)
##   [1] " 189" " 292" " 213" " 307" " 282" " 298" " 301" " 286" " 214" " 194"
##  [11] " 212" " 294" " 293" " 284" " 285" " 278" " 300" " 201" " 279" " 280"
##  [21] " 299" " 200" " 211" " 308" " 287" " 196" " 220" " 207" " 290" " 198"
##  [31] " 197" " 195" " 289" " 288" " 291" " 199" " 277" " 283" " 306" " 235"
##  [41] " 192" " 147" " 252" " 166" " 269" " 064" " 253" " 193" " 146" " 141"
##  [51] " 251" " 139" " 169" " 144" " 138" " 061" " 065" " 170" " 142" " 140"
##  [61] " 168" " 272" " 165" " 255" " 260" " 264" " 262" " 261" " 167" " 060"
##  [71] " 066" " 136" " 256" " 143" " 171" " 082" " 083" " 191" " 259" " 062"
##  [81] " 172" " 063" " 258" " 270" " 268" " 267" " 234" " 245" " 173" " 236"
##  [91] " 084" " 229" " 241" " 231" " 227" " 176" " 087" " 091" " 090" " 085"
## [101] " 228" " 230" " 175" " 250" " 222" " 239" " 233" " 274" " 088" " 271"
## [111] " 240" " 092" " 089" " 247" " 038" " 248" " 086" " 273" " 244" " 093"
## [121] " 174" " 249" " 237" " 221" " 225" " 103" " 028" " 075" " 059" " 101"
## [131] " 034" " 002" " 030" " 056" " 001" " 102" " 012" " 076" " 098" " 079"
## [141] " 104" " 081" " 096" " 058" " 099" " 105" " 040" " 035" " 094" " 074"
## [151] " 032" " 022" " 003" " 095" " 009" " 106" " 057" " 033" " 029" " 013"
## [161] " 031" " 007" " 008" " 006" " 080" " 005" " 055" " 036" " 011" " 078"
## [171] " 097" " 037" " 010" " 023" " 043" " 044" " 015" " 054" " 045" " 049"
## [181] " 050" " 024" " 072" " 069" " 048" " 052" " 073" " 053" " 020" " 042"
## [191] " 021" " 027" " 046" " 070" " 014" " 017" " 067" " 019" " 182" " 130"
## [201] " 159" " 125" " 178" " 151" " 109" " 186" " 121" " 181" " 158" " 150"
## [211] " 112" " 115" " 188" " 128" " 183" " 185" " 154" " 120" " 108" " 162"
## [221] " 118" " 149" " 119" " 113" " 187" " 127" " 156" " 133" " 131" " 129"
## [231] " 117" " 160" " 132" " 190" " 157" " 126" " 153" " 111" " 155" " 107"
## [241] " 184" " 179" " 135" " 116"
MR.delta_p_geno <- ggerrorplot(growth_factors, y = "MR.delta", x = "genotype", fill="genotype", color="genotype", 
                        facet.by = c("cond"), ncol=1,
                        desc_stat = "mean_sd", add = "jitter", 
                        add.params = list(color = "darkgray"),
                        xlab="Genotype", ylab="Main Root Growth (cm / day)") 
MR.delta_p_geno <- MR.delta_p_geno + geom_hline(
                          data = grand.means, aes(yintercept = MR.delta),
                          linetype = 2,
                          group = "cond")
MR.delta_p_geno <- MR.delta_p_geno + rremove("legend") + stat_compare_means(method="t.test", ref.group = ".all.", 
                                                              label = "p.signif", hide.ns = T) #+ theme(axis.text.x=element_blank())
MR.delta_p_geno
## Warning: Computation failed in `stat_compare_means()`:
## not enough 'x' observations

## Warning: Computation failed in `stat_compare_means()`:
## not enough 'x' observations
## Warning: Removed 10 rows containing missing values (geom_segment).
## Warning: Removed 33 rows containing missing values (geom_segment).

grand.means <- aggregate(LRno.delta ~ cond, data = growth_factors, FUN = mean)
grand.means
LRno.delta_p_geno <- ggerrorplot(growth_factors, y = "LRno.delta", x = "genotype", fill="genotype", color="genotype", 
                        facet.by = c("cond"), ncol=1,
                        desc_stat = "mean_sd", add = "jitter", 
                        add.params = list(color = "darkgray"),
                        xlab="Genotype", ylab="Increase in LR number (# LR / day)") 
LRno.delta_p_geno <- LRno.delta_p_geno + geom_hline(
                          data = grand.means, aes(yintercept = LRno.delta),
                          linetype = 2,
                          group = "cond")
LRno.delta_p_geno <- LRno.delta_p_geno + rremove("legend") + stat_compare_means(method="t.test", ref.group = ".all.", 
                                                              label = "p.signif", hide.ns = T) + theme(axis.text.x=element_blank())
LRno.delta_p_geno
## Warning: Computation failed in `stat_compare_means()`:
## not enough 'x' observations

## Warning: Computation failed in `stat_compare_means()`:
## not enough 'x' observations
## Warning: Removed 10 rows containing missing values (geom_segment).
## Warning: Removed 33 rows containing missing values (geom_segment).

grand.means <- aggregate(aLRL.delta ~ cond, data = growth_factors, FUN = mean)
grand.means
aLRL.delta_p_geno <- ggerrorplot(growth_factors, y = "aLRL.delta", x = "genotype", fill="genotype", color="genotype", 
                        facet.by = c("cond"), ncol=1,
                        desc_stat = "mean_sd", add = "jitter", 
                        add.params = list(color = "darkgray"),
                        xlab="Genotype", ylab="average Lateral Root Growth (cm / day)") 
aLRL.delta_p_geno <- aLRL.delta_p_geno + geom_hline(
                          data = grand.means, aes(yintercept = aLRL.delta),
                          linetype = 2,
                          group = "cond")
aLRL.delta_p_geno <- aLRL.delta_p_geno + rremove("legend") + stat_compare_means(method="t.test", ref.group = ".all.", 
                                                              label = "p.signif", hide.ns = T) + theme(axis.text.x=element_blank())
aLRL.delta_p_geno
## Warning: Computation failed in `stat_compare_means()`:
## not enough 'x' observations

## Warning: Computation failed in `stat_compare_means()`:
## not enough 'x' observations
## Warning: Removed 10 rows containing missing values (geom_segment).
## Warning: Removed 33 rows containing missing values (geom_segment).

pdf("Fig.GR_reproducibility.pdf", height = 30, width = 10)
plot_grid(MR.delta_p_geno,
          LRno.delta_p_geno,
          aLRL.delta_p_geno, ncol=1, labels = "AUTO")
## Warning: Computation failed in `stat_compare_means()`:
## not enough 'x' observations

## Warning: Computation failed in `stat_compare_means()`:
## not enough 'x' observations
## Warning: Removed 10 rows containing missing values (geom_segment).
## Warning: Removed 33 rows containing missing values (geom_segment).
## Warning: Computation failed in `stat_compare_means()`:
## not enough 'x' observations

## Warning: Computation failed in `stat_compare_means()`:
## not enough 'x' observations
## Warning: Removed 10 rows containing missing values (geom_segment).
## Warning: Removed 33 rows containing missing values (geom_segment).
## Warning: Computation failed in `stat_compare_means()`:
## not enough 'x' observations

## Warning: Computation failed in `stat_compare_means()`:
## not enough 'x' observations
## Warning: Removed 10 rows containing missing values (geom_segment).
## Warning: Removed 33 rows containing missing values (geom_segment).
dev.off()
## quartz_off_screen 
##                 2

ok - but these trends are very general - let’s have a look what is the diversity between accessions in their salt responses.

stress-induced changes in growth rates:

Also - maybe lets calculate the average growth rate per accession and look how this looks on a graph with some stats - as in - do we see sig. differences between C and S:

head(growth_factors)
growth_nona <- na.omit(growth_factors)
sum_growth <- summaryBy(data = growth_factors, MR.delta + LRno.delta + aLRL.delta ~ cond + genotype)
sum_growth
MR.delta_dotplot <- ggerrorplot(sum_growth, y = "MR.delta.mean", x = "cond", fill="cond", color="cond", 
                        desc_stat = "mean_sd", add = "jitter", 
                        add.params = list(color = "darkgray"),
                        xlab="Condition", ylab="Main Root Growth (cm / day)") 
MR.delta_dotplot <- MR.delta_dotplot + rremove("legend") + stat_compare_means(method="t.test", ref.group = "C", 
                                                              label = "p.signif", hide.ns = T)
MR.delta_dotplot

aLRL.delta_dotplot <- ggerrorplot(sum_growth, y = "aLRL.delta.mean", x = "cond", fill="cond", color="cond", 
                        desc_stat = "mean_sd", add = "jitter", 
                        add.params = list(color = "darkgray"),
                        xlab="Condition", ylab="average Lateral Root Growth (cm / day)") 
aLRL.delta_dotplot <- aLRL.delta_dotplot + rremove("legend") + stat_compare_means(method="t.test", ref.group = "C", 
                                                              label = "p.signif", hide.ns = T)
aLRL.delta_dotplot

LRno.delta_dotplot <- ggerrorplot(sum_growth, y = "LRno.delta.mean", x = "cond", fill="cond", color="cond", 
                        desc_stat = "mean_sd", add = "jitter", 
                        add.params = list(color = "darkgray"),
                        xlab="Condition", ylab="average Lateral Root Growth (cm / day)") 
LRno.delta_dotplot <- LRno.delta_dotplot + rremove("legend") + stat_compare_means(method="t.test", ref.group = "C", 
                                                              label = "p.signif", hide.ns = T)
LRno.delta_dotplot

ok - now we have all the accession values averaged - let’s compare the growth rate under control and salt stress

First - we need to split the data into control and salt and then match them based on genotype:

growth_C <- subset(sum_growth, sum_growth$cond == "C")
growth_S <- subset(sum_growth, sum_growth$cond == "S")
colnames(growth_C) <- gsub(".mean", ".Control", colnames(growth_C))
colnames(growth_S) <- gsub(".mean", ".Salt", colnames(growth_S))

growth_C2 <- growth_C[,c(2:5)]
growth_S2 <- growth_S[,c(2:5)]

sum_growth2 <- merge(growth_C2, growth_S2, by="genotype")
sum_growth2
corrplot_MR_gr <- ggscatter(sum_growth2, x = "MR.delta.Control", y = "MR.delta.Salt", size = 0.3, 
                            rug = TRUE, add = "reg.line", color = "LRno.delta.Control") + stat_cor(method = "pearson")
corrplot_MR_gr <- corrplot_MR_gr + gradient_color(c("blue", "grey", "red"))
corrplot_MR_gr
## `geom_smooth()` using formula 'y ~ x'

corrplot_aLRL_gr <- ggscatter(sum_growth2, x = "aLRL.delta.Control", y = "aLRL.delta.Salt", size = 0.3, 
                            rug = TRUE, add = "reg.line", color = "aLRL.delta.Control") + stat_cor(method = "pearson")
corrplot_aLRL_gr <- corrplot_aLRL_gr + gradient_color(c("blue", "grey", "red"))
corrplot_aLRL_gr
## `geom_smooth()` using formula 'y ~ x'

corrplot_LRno_gr <- ggscatter(sum_growth2, x = "LRno.delta.Control", y = "LRno.delta.Salt", color = "LRno.delta.Control",
                              size = 0.3, rug = TRUE, add = "reg.line") + stat_cor(method = "pearson")
corrplot_LRno_gr <- corrplot_LRno_gr + gradient_color(c("blue", "grey", "red"))
corrplot_LRno_gr
## `geom_smooth()` using formula 'y ~ x'

hmmm… thinking about the dotplots from earlier and they should actually be a paired graph, because we want to see how individual accessions are behaving, and whether that behaviour is conserved across accessions:

MR_sum_growth <- sum_growth2[,c(1,2,5)]
MR_sum_melt <- melt(MR_sum_growth)
## Using genotype as id variables
MR_sum_melt
MR_sum_melt$variable <- gsub("MR.delta.", "", MR_sum_melt$variable)
colnames(MR_sum_melt)[2] <- "condition"
colnames(MR_sum_melt)[3] <- "MR.delta"


MR_growth_paired <- ggpaired(MR_sum_melt, x = "condition", y = "MR.delta",
                               color = "condition", line.color = "gray", line.size = 0.1,
                               palette = "jco", xlab ="", ylab ="Main Root Growth (cm / day)")
MR_growth_paired <- MR_growth_paired + stat_compare_means(paired = TRUE, label.x = 1.5) + rremove("legend")
MR_growth_paired

Cool - that looks much more informative - let’s do this for other traits:

LRno_sum_growth <- sum_growth2[,c(1,3,6)]
LRno_sum_growth <- na.omit(LRno_sum_growth)
LRno_sum_melt <- melt(LRno_sum_growth)
## Using genotype as id variables
LRno_sum_melt
LRno_sum_melt$variable <- gsub("LRno.delta.", "", LRno_sum_melt$variable)
colnames(LRno_sum_melt)[2] <- "condition"
colnames(LRno_sum_melt)[3] <- "LRno.delta"


LRno_growth_paired <- ggpaired(LRno_sum_melt, x = "condition", y = "LRno.delta",
                               color = "condition", line.color = "gray", line.size = 0.1,
                               palette = "jco", xlab ="", ylab ="Increase in Lateral Root # (# LR / day)")
LRno_growth_paired <- LRno_growth_paired + stat_compare_means(paired = TRUE, label.x = 1.5) + rremove("legend")
LRno_growth_paired

aLRL_sum_growth <- sum_growth2[,c(1,4,7)]
aLRL_sum_growth <- na.omit(aLRL_sum_growth)
aLRL_sum_melt <- melt(aLRL_sum_growth)
## Using genotype as id variables
aLRL_sum_melt
aLRL_sum_melt$variable <- gsub("aLRL.delta.", "", aLRL_sum_melt$variable)
colnames(aLRL_sum_melt)[2] <- "condition"
colnames(aLRL_sum_melt)[3] <- "aLRL.delta"


aLRL_growth_paired <- ggpaired(aLRL_sum_melt, x = "condition", y = "aLRL.delta",
                               color = "condition", line.color = "gray", line.size = 0.1,
                               palette = "jco", xlab ="", ylab ="average Lateral Root Growth (cm / day)")
aLRL_growth_paired <- aLRL_growth_paired + stat_compare_means(paired = TRUE, label.x = 1.5) + rremove("legend")
aLRL_growth_paired

Cool beans - let’s save these figures

pdf("Fig.Growth_rates_comparison_paired_MR_noLR_aLRL.pdf", width = 10, height = 5)
plot_grid(MR_growth_paired, LRno_growth_paired, aLRL_growth_paired, ncol=3, labels = "AUTO")
dev.off()
## quartz_off_screen 
##                 2

ok - now let’s start comparing how individual accessions are doing when it comes to salt indices of individual organs:

Salt Tolerance Indexes

In order to look at salt responses - we need to calculate the average plant responses per accession and calculate the relative change in growth rate in response to salt (relative to control):

head(sum_growth2)
sum_growth2$MR.STI <- sum_growth2$MR.delta.Salt/sum_growth2$MR.delta.Control
sum_growth2$LRno.STI <- sum_growth2$LRno.delta.Salt/sum_growth2$LRno.delta.Control
sum_growth2$aLRL.STI <- sum_growth2$aLRL.delta.Salt/sum_growth2$aLRL.delta.Control
head(sum_growth2)
write.csv(sum_growth2, "sum_growth_pimp_all.csv", row.names = FALSE)

Then - we would like to know also what is the effect of the salt on different root components across different accessions - so let’s make a histogram for this :)

colnames(sum_growth2)
##  [1] "genotype"           "MR.delta.Control"   "LRno.delta.Control"
##  [4] "aLRL.delta.Control" "MR.delta.Salt"      "LRno.delta.Salt"   
##  [7] "aLRL.delta.Salt"    "MR.STI"             "LRno.STI"          
## [10] "aLRL.STI"
STI_histo_set <- sum_growth2[,c(1,8:10)]
head(STI_histo_set)
STI_histo_melt <- melt(STI_histo_set)
## Using genotype as id variables
head(STI_histo_melt)
STI_growth_histo <- gghistogram(STI_histo_melt, x = "value",
            add = "mean", rug = TRUE,
            color = "variable", fill = "variable", 
            palette = c("#1b9e77", "#d95f02", "#7570b3")) + xlab("fraction of growth rate at control")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
STI_growth_histo

STI_histo_set$of_interest <- "no"
unique(STI_histo_set$genotype)
##   [1] " 001" " 002" " 003" " 005" " 006" " 007" " 008" " 009" " 011" " 012"
##  [11] " 013" " 014" " 015" " 017" " 019" " 020" " 021" " 022" " 023" " 024"
##  [21] " 027" " 028" " 029" " 030" " 031" " 032" " 033" " 034" " 035" " 036"
##  [31] " 037" " 038" " 040" " 042" " 043" " 044" " 045" " 046" " 048" " 049"
##  [41] " 050" " 052" " 053" " 054" " 055" " 056" " 057" " 059" " 060" " 061"
##  [51] " 062" " 063" " 064" " 065" " 066" " 067" " 069" " 070" " 072" " 073"
##  [61] " 074" " 075" " 076" " 078" " 079" " 080" " 081" " 082" " 084" " 085"
##  [71] " 086" " 087" " 088" " 089" " 090" " 091" " 092" " 093" " 094" " 095"
##  [81] " 096" " 097" " 098" " 099" " 101" " 102" " 103" " 104" " 105" " 106"
##  [91] " 107" " 108" " 109" " 111" " 112" " 113" " 115" " 117" " 118" " 119"
## [101] " 120" " 121" " 125" " 126" " 127" " 128" " 129" " 130" " 131" " 132"
## [111] " 133" " 136" " 138" " 139" " 140" " 141" " 142" " 143" " 144" " 146"
## [121] " 147" " 149" " 150" " 151" " 153" " 154" " 155" " 156" " 157" " 158"
## [131] " 159" " 160" " 162" " 165" " 166" " 167" " 168" " 169" " 171" " 172"
## [141] " 173" " 174" " 175" " 176" " 178" " 181" " 182" " 183" " 185" " 186"
## [151] " 187" " 188" " 189" " 190" " 191" " 192" " 193" " 194" " 195" " 197"
## [161] " 198" " 199" " 200" " 201" " 207" " 211" " 212" " 213" " 214" " 222"
## [171] " 227" " 228" " 229" " 230" " 231" " 233" " 234" " 235" " 236" " 237"
## [181] " 239" " 240" " 241" " 244" " 245" " 247" " 248" " 249" " 250" " 251"
## [191] " 252" " 253" " 255" " 256" " 258" " 259" " 260" " 261" " 262" " 264"
## [201] " 267" " 268" " 269" " 270" " 271" " 272" " 273" " 274" " 277" " 278"
## [211] " 279" " 280" " 282" " 283" " 284" " 285" " 286" " 287" " 288" " 290"
## [221] " 291" " 292" " 293" " 294" " 298" " 299" " 300" " 301" " 307" " 308"
interest <- c(" 261", " 248", " 141", " 058", " 035")

for(i in 1:nrow(STI_histo_set)){
  if(STI_histo_set$genotype[i] %in% interest){
    STI_histo_set$of_interest[i] <-  STI_histo_set$genotype[i]
  }
}

library(reshape2)
STI_histo_melt2 <- melt(STI_histo_set)
## Using genotype, of_interest as id variables
head(STI_histo_melt2)
STI_histo_melt2$of_interest <- gsub(" 035", "LA1258", STI_histo_melt2$of_interest) #a034f0
STI_histo_melt2$of_interest <- gsub(" 058", "LA1371",  STI_histo_melt2$of_interest) #a7d35d
STI_histo_melt2$of_interest <- gsub(" 141", "LA1670", STI_histo_melt2$of_interest) #c55252
STI_histo_melt2$of_interest <- gsub(" 248", "LA2540", STI_histo_melt2$of_interest) #1d6e1b
STI_histo_melt2$of_interest <- gsub(" 261", "LA2647", STI_histo_melt2$of_interest) #f77f47
STI_histo_melt2$of_interest <- gsub("no", "other", STI_histo_melt2$of_interest) #grey

unique(STI_histo_melt2$variable)
## [1] MR.STI   LRno.STI aLRL.STI
## Levels: MR.STI LRno.STI aLRL.STI
STI_histo_melt2$variable <- gsub("MR.STI", "Main Root Growth", STI_histo_melt2$variable)
STI_histo_melt2$variable <- gsub("LRno.STI", "Increase in Lateral Root Number", STI_histo_melt2$variable)
STI_histo_melt2$variable <- gsub("aLRL.STI", "Average Lateral Root Growth", STI_histo_melt2$variable)

colnames(STI_histo_melt2)[2] <- "Genotype"

unique(STI_histo_melt2$Genotype)
## [1] "other"  "LA1258" "LA1670" "LA2540" "LA2647"
FFAR_STI_growth_histo <- gghistogram(STI_histo_melt2, x = "value",
            add = "mean", rug = TRUE,
            color = "Genotype", fill = "Genotype", 
            palette = c("#a034f0", "#a7d35d", "#c55252", "#1d6e1b", "#f77f47", "grey"),
            facet.by = "variable", ncol = 1) + xlab("fraction of growth recorded at non-stress conditions")
## Warning: Using `bins = 30` by default. Pick better value with the argument
## `bins`.
FFAR_STI_growth_histo

getwd()
## [1] "/Users/magdalena/Dropbox_backup/DataAndAnalysis/Tomato/PimpiBIG csv raw files"
pdf("FFAR_SIT_figure.pdf", height = 5, width = 5)
FFAR_STI_growth_histo
dev.off()
## quartz_off_screen 
##                 2

cool - now we can also look in detail of how the individual accessions behave throughout these three STI

STI_growth_paired <- ggpaired(STI_histo_melt, x = "variable", y = "value",
                               color = "variable", line.color = "gray", line.size = 0.1,
                               palette = "jco", xlab ="", ylab ="Fraction of growth rate at control")
STI_growth_paired <- STI_growth_paired + stat_compare_means(paired = TRUE, label.x = 1.5) + rremove("legend")
STI_growth_paired

pdf("Fig.STI_Growth_rates_MR_noLR_aLRL.pdf", width = 10, height = 10)
plot_grid(STI_growth_histo, STI_growth_paired, ncol=1, labels = "AUTO")
dev.off()
## quartz_off_screen 
##                 2

ok - also - lets look at these things in a bit more traditional setting:

sum_growth2
STI_MR_vs_aLRL <- ggscatter(sum_growth2, x = "MR.STI", y = "aLRL.STI", color = "aLRL.delta.Control", size = 0.3, 
                            rug = TRUE, add = "reg.line") + stat_cor(method = "pearson")
STI_MR_vs_aLRL <- STI_MR_vs_aLRL + gradient_color(c("blue", "grey", "red"))

STI_MR_vs_aLRL
## `geom_smooth()` using formula 'y ~ x'

STI_MR_vs_LRno <- ggscatter(sum_growth2, x = "MR.STI", y = "LRno.STI", color = "LRno.delta.Control", size = 0.3, 
                            rug = TRUE, add = "reg.line") + stat_cor(method = "pearson")
STI_MR_vs_LRno <- STI_MR_vs_LRno + gradient_color(c("blue", "grey", "red"))

STI_MR_vs_LRno
## `geom_smooth()` using formula 'y ~ x'

STI_aLRL_vs_LRno <- ggscatter(sum_growth2, x = "aLRL.STI", y = "LRno.STI", color = "LRno.delta.Control", size = 0.3, 
                            rug = TRUE, add = "reg.line") + stat_cor(method = "pearson")
STI_aLRL_vs_LRno <- STI_aLRL_vs_LRno + gradient_color(c("blue", "grey", "red"))

STI_aLRL_vs_LRno
## `geom_smooth()` using formula 'y ~ x'

Conclusions so far

OK - so all of the above is pretty interesting - from the paired STI graph we can tell that there are multiple classes of accessions:

STI_growth_paired

  1. accessions that are equally impaired for all components of RSA
  2. accessions that are LEAST impaired in MRL
  3. accessions that are MOST impaired in MRL
  4. accessions that are MOST impaired in LRno

The correlations between individual SITs is very low for all combinations - which is pretty exciting, and aLRL and MRL are in general the least impacted by the salt stress - while LRno is impaired in most accessions the most - based on this histogram:

STI_growth_histo

now - I am wondering - if we throw only the STI into the hierarchical clustering - would we be able to discern between these classes of accessions?

Let’s see:

Hclust based on the SITs:

First - let’s prepare the matrix:

colnames(sum_growth2)
##  [1] "genotype"           "MR.delta.Control"   "LRno.delta.Control"
##  [4] "aLRL.delta.Control" "MR.delta.Salt"      "LRno.delta.Salt"   
##  [7] "aLRL.delta.Salt"    "MR.STI"             "LRno.STI"          
## [10] "aLRL.STI"
STI_only <- sum_growth2[,c(1,8:10)]
# get only numeric variables from your data - NOT plant identifiers 
STI_matrix <- STI_only[, c(2:4)]
# transfer all numeric variables into matrix
STI_matrix2 <- as.matrix(STI_matrix)
# add plant identifiers as row names
row.names(STI_matrix2) <- STI_only$genotype
# omit missing values - otherwise we wont be able to do the clustering 
final_m <- na.omit(STI_matrix2)
dim(STI_matrix2)
## [1] 230   3
dim(final_m)
## [1] 230   3
head(final_m)
##         MR.STI  LRno.STI  aLRL.STI
##  001 1.2207550 0.2886179 0.9878750
##  002 1.7812165 0.8893443 0.6813830
##  003 0.6241646 0.5460317 0.9047426
##  005 0.8284342 1.3500000 0.6491019
##  006 1.2725551 0.4566210 0.5787553
##  007 1.7744666 0.3670213 1.0556062
# run a correlation
magda_cor = cor(final_m,method=c("pearson"))
# calculate distance
magda_dist = dist(magda_cor)
# this is the clustering itself - but now we are clustering how phenotypes are related to eachother
magda_clust = hclust(magda_dist,method="ward.D2")
plot(as.dendrogram(magda_clust),horiz=T)

# transposing the matrix
magda_t_matrix=t(final_m)
magda_t_cor = cor(magda_t_matrix,method=c("pearson"))
magda_t_dist = dist(magda_t_cor)
# clustering of accessions
magda_t_clust = hclust(magda_t_dist,method="ward.D2")
plot(as.dendrogram(magda_t_clust),horiz=T)

clusters <- cutree(magda_t_clust,h=24)
unique(clusters)
## [1] 1 2 3 4 5 6 7
write.table(as.data.frame(cutree(magda_t_clust,h=24)),file="STI_clusters.txt",sep="\t",quote=F)
# the scaling only now applies to "row" which are our different phenotypes
heatmap.2(magda_t_matrix,Rowv=as.dendrogram(magda_clust),Colv=as.dendrogram(magda_t_clust),col=blue2red(100),scale=c("row"),density.info="none",trace="none")

OK - let’s save this one into a file before we forget

pdf("Fig.STI_clustering.pdf",width=12,height=7)
heatmap.2(magda_t_matrix,Rowv=as.dendrogram(magda_clust),Colv=as.dendrogram(magda_t_clust),col=blue2red(100),scale=c("row"),density.info="none",trace="none")
dev.off()
## quartz_off_screen 
##                 2

cool - now let’s see if the clusters actually differ in their respective growth rates / STIs.

First - let’s fuse “clusters” with the other growth rate data

clusters
##  001  002  003  005  006  007  008  009  011  012  013  014  015  017  019  020 
##    1    2    3    4    5    5    6    1    6    1    1    3    1    1    4    5 
##  021  022  023  024  027  028  029  030  031  032  033  034  035  036  037  038 
##    1    7    1    1    3    1    1    3    2    6    7    3    1    1    3    3 
##  040  042  043  044  045  046  048  049  050  052  053  054  055  056  057  059 
##    3    5    1    1    3    3    5    1    1    5    3    1    3    6    5    7 
##  060  061  062  063  064  065  066  067  069  070  072  073  074  075  076  078 
##    1    1    3    4    1    7    1    1    3    2    3    3    3    1    1    5 
##  079  080  081  082  084  085  086  087  088  089  090  091  092  093  094  095 
##    1    5    1    5    3    5    5    5    3    3    7    1    5    1    3    3 
##  096  097  098  099  101  102  103  104  105  106  107  108  109  111  112  113 
##    1    6    3    3    1    6    1    1    1    1    1    3    4    1    3    3 
##  115  117  118  119  120  121  125  126  127  128  129  130  131  132  133  136 
##    3    1    5    5    1    3    1    3    3    5    3    6    2    1    1    3 
##  138  139  140  141  142  143  144  146  147  149  150  151  153  154  155  156 
##    1    3    1    1    5    3    5    6    7    3    5    5    1    3    7    1 
##  157  158  159  160  162  165  166  167  168  169  171  172  173  174  175  176 
##    6    2    1    4    3    1    3    3    6    1    1    4    3    2    5    3 
##  178  181  182  183  185  186  187  188  189  190  191  192  193  194  195  197 
##    2    1    1    3    3    3    3    3    1    6    6    1    3    1    3    3 
##  198  199  200  201  207  211  212  213  214  222  227  228  229  230  231  233 
##    3    2    7    7    6    1    1    2    3    1    7    1    1    7    3    3 
##  234  235  236  237  239  240  241  244  245  247  248  249  250  251  252  253 
##    4    2    1    1    3    1    1    2    1    5    3    5    5    6    3    1 
##  255  256  258  259  260  261  262  264  267  268  269  270  271  272  273  274 
##    3    2    4    2    3    5    5    4    4    1    5    1    1    3    5    5 
##  277  278  279  280  282  283  284  285  286  287  288  290  291  292  293  294 
##    6    1    1    3    3    3    6    5    1    1    3    1    1    1    5    1 
##  298  299  300  301  307  308 
##    2    4    3    2    7    5
sumatrix <- sum_growth2[,c(2:10)]
sumatrix2 <- as.matrix(sumatrix)
row.names(sumatrix2) <- sum_growth2$genotype
sumatrix3 <- na.omit(sumatrix2)

sum_growth3 <- cbind(sumatrix3, clusters)
head(sum_growth3)
##      MR.delta.Control LRno.delta.Control aLRL.delta.Control MR.delta.Salt
##  001        1.2059372           6.150000          0.1881415     1.4721539
##  002        0.7807096           2.033333          0.6265680     1.3906129
##  003        1.2698976           5.250000          0.2862967     0.7926251
##  005        1.2294472           3.833333          0.4431234     1.0185161
##  006        1.2223445           7.300000          0.2833526     1.5555007
##  007        0.6433493           3.133333          0.3487621     1.1416019
##      LRno.delta.Salt aLRL.delta.Salt    MR.STI  LRno.STI  aLRL.STI clusters
##  001        1.775000       0.1858603 1.2207550 0.2886179 0.9878750        1
##  002        1.808333       0.4269328 1.7812165 0.8893443 0.6813830        2
##  003        2.866667       0.2590248 0.6241646 0.5460317 0.9047426        3
##  005        5.175000       0.2876322 0.8284342 1.3500000 0.6491019        4
##  006        3.333333       0.1639918 1.2725551 0.4566210 0.5787553        5
##  007        1.150000       0.3681554 1.7744666 0.3670213 1.0556062        5

ok - now let’s make some graphs per clusters starting with STIs:

growth_cluster3 <- as.data.frame(sum_growth3)
growth_cluster3
STIcluster_MR.STI <- ggerrorplot(growth_cluster3, y = "MR.STI", x = "clusters", fill="clusters", 
                                   color="clusters", desc_stat = "mean_sd", add = "jitter", 
                                   add.params = list(color = "darkgray"), xlab="", 
                                   ylab="Fraction of Control (Main Root Growth)", title = "Main Root STI") 
STIcluster_MR.STI <- STIcluster_MR.STI + rremove("legend") + stat_compare_means(method="t.test", ref.group = 1, 
                                                              label = "p.signif", hide.ns = T)
STIcluster_MR.STI

STIcluster_LRno.STI <- ggerrorplot(growth_cluster3, y = "LRno.STI", x = "clusters", fill="clusters", 
                                   color="clusters", desc_stat = "mean_sd", add = "jitter", 
                                   add.params = list(color = "darkgray"), xlab="", 
                                   ylab="Fraction of Control (LR #)", title = "Lateral Root # STI") 
STIcluster_LRno.STI <- STIcluster_LRno.STI + rremove("legend") + stat_compare_means(method="t.test", ref.group = 1, 
                                                              label = "p.signif", hide.ns = T)
STIcluster_LRno.STI

STIcluster_aLRL.STI <- ggerrorplot(growth_cluster3, y = "aLRL.STI", x = "clusters", fill="clusters", 
                                   color="clusters", desc_stat = "mean_sd", add = "jitter", 
                                   add.params = list(color = "darkgray"), xlab="", 
                                   ylab="Fraction of Control (avg. Lateral Root Growth)", 
                                   title = " avg Lateral Root Growth STI") 
STIcluster_aLRL.STI <- STIcluster_aLRL.STI + rremove("legend") + stat_compare_means(method="t.test", ref.group = 1, 
                                                              label = "p.signif", hide.ns = T)
STIcluster_aLRL.STI

Let’s put these into one figure and think about it in another session:

pdf("Fig.STI_based_clusters_STI_trait_comparison.pdf", height = 15, width = 10)
plot_grid(STIcluster_MR.STI, STIcluster_LRno.STI, STIcluster_aLRL.STI, ncol=1, labels="AUTO")
dev.off()
## quartz_off_screen 
##                 2

I m still wondering how the correlations between the traits would look if we would color it per cluster now:

growth_cluster3$clusters <- as.factor(growth_cluster3$clusters)

STI_aLRL_vs_LRno_clust <- ggscatter(growth_cluster3, x = "aLRL.STI", y = "LRno.STI", color = "clusters", size = 0.3, 
                            rug = TRUE, ellipse = TRUE, palette = "jco") + stat_cor(method = "pearson")
STI_aLRL_vs_LRno_clust

STI_aLRL_vs_MR_clust <- ggscatter(growth_cluster3, x = "aLRL.STI", y = "MR.STI", color = "clusters", size = 0.3, 
                            rug = TRUE, ellipse = TRUE, palette = "jco") + stat_cor(method = "pearson")
STI_aLRL_vs_MR_clust

STI_LRno_vs_MR_clust <- ggscatter(growth_cluster3, x = "LRno.STI", y = "MR.STI", color = "clusters", size = 0.3, 
                            rug = TRUE, ellipse = TRUE, palette = "jco") + stat_cor(method = "pearson")
STI_LRno_vs_MR_clust

I wonder if we could visualize accessions that belong to individual clusters in the continuous graphs with average per accession.

Let’s load the STI_cluster table:

cluster01 <- read.table("STI_clusters_better.txt", header = T)
head(cluster01)
colnames(cluster01)[1] <- "genotype"
head(cluster01)

now let’s fuse it with the MR_sum dataset that we used previously for timeseries graphs:

head(MR_sum)
MR_sum2 <- MR_sum
MR_sum2$genotype <- as.numeric(as.character(MR_sum2$genotype))
MR_cluster <- merge(MR_sum2, cluster01, by="genotype", all=T)
head(MR_cluster)
MR_cluster$Cluster <- as.factor(MR_cluster$Cluster)
MR_cluster$geno_cond <- paste(MR_cluster$genotype, "_", MR_cluster$Condition, sep="")

Cool - now let’s see how the TRS graph looks like when we colour per cluster:

TRS_clust_lgraph <- ggplot(data=MR_cluster, aes(x= DAS, y=TRS.mean, group = geno_cond, color = Condition)) 
TRS_clust_lgraph <- TRS_clust_lgraph + geom_line(alpha = 0.1) 
TRS_clust_lgraph <- TRS_clust_lgraph + stat_summary(fun.data = mean_se, geom="ribbon", linetype=0, aes(group=Condition), alpha=0.3) + stat_summary(fun.y=mean, aes(group= Condition),  size=0.7, geom="line", linetype = "dashed")
## Warning: `fun.y` is deprecated. Use `fun` instead.
TRS_clust_lgraph <- TRS_clust_lgraph + ggtitle("") +facet_grid(~Cluster)
TRS_clust_lgraph <- TRS_clust_lgraph + ylab("Total Root Size (cm)") + xlab("Days After Stress")
TRS_clust_lgraph

STIcluster_MR.C <- ggerrorplot(growth_cluster3, y = "MR.delta.Control", x = "clusters", fill="clusters", 
                                   color="clusters", desc_stat = "mean_sd", add = "jitter", 
                                   add.params = list(color = "darkgray"), xlab="Clusters based on STI", 
                                   ylab="Main Root Growth (cm / day)", title = "Control") 
STIcluster_MR.C <- STIcluster_MR.C + rremove("legend") + stat_compare_means(method="t.test", ref.group = 1, 
                                                              label = "p.signif", hide.ns = T)
STIcluster_MR.C

STIcluster_MR.S <- ggerrorplot(growth_cluster3, y = "MR.delta.Salt", x = "clusters", fill="clusters", 
                                   color="clusters", desc_stat = "mean_sd", add = "jitter", 
                                   add.params = list(color = "darkgray"), xlab="Clusters based on STI", 
                                   ylab="Main Root Growth (cm / day)", title = "Salt") 
STIcluster_MR.S <- STIcluster_MR.S + rremove("legend") + stat_compare_means(method="t.test", ref.group = 1, 
                                                              label = "p.signif", hide.ns = T)
STIcluster_MR.S

STIcluster_aLR.C <- ggerrorplot(growth_cluster3, y = "aLRL.delta.Control", x = "clusters", fill="clusters", 
                                   color="clusters", desc_stat = "mean_sd", add = "jitter", 
                                   add.params = list(color = "darkgray"), xlab="Clusters based on STI", 
                                   ylab="avg Lateral Root Growth (cm / day)", title = "Control") 
STIcluster_aLR.C <- STIcluster_aLR.C + rremove("legend") + stat_compare_means(method="t.test", ref.group = 1, 
                                                              label = "p.signif", hide.ns = T)
STIcluster_aLR.C

STIcluster_aLR.S <- ggerrorplot(growth_cluster3, y = "aLRL.delta.Salt", x = "clusters", fill="clusters", 
                                   color="clusters", desc_stat = "mean_sd", add = "jitter", 
                                   add.params = list(color = "darkgray"), xlab="Clusters based on STI", 
                                   ylab="avg Lateral Root Growth (cm / day)", title = "Salt") 
STIcluster_aLR.S <- STIcluster_aLR.S + rremove("legend") + stat_compare_means(method="t.test", ref.group = 1, 
                                                              label = "p.signif", hide.ns = T)
STIcluster_aLR.S

STIcluster_LRno.C <- ggerrorplot(growth_cluster3, y = "LRno.delta.Control", x = "clusters", fill="clusters",  
                                   color="clusters", desc_stat = "mean_sd", add = "jitter", 
                                   add.params = list(color = "darkgray"), xlab="Clusters based on STI", 
                                   ylab="Lateral Root Increase (# LR / day)", title = "Control") 
STIcluster_LRno.C <- STIcluster_LRno.C + rremove("legend") + stat_compare_means(method="t.test", ref.group = 1, 
                                                              label = "p.signif", hide.ns = T)
STIcluster_LRno.C

library(plotly)
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
ggplotly(STIcluster_LRno.C)
STIcluster_LRno.S <- ggerrorplot(growth_cluster3, y = "LRno.delta.Salt", x = "clusters", fill="clusters", 
                                   color="clusters", desc_stat = "mean_sd", add = "jitter", 
                                   add.params = list(color = "darkgray"), xlab="Clusters based on STI", 
                                   ylab="Lateral Root Increase (# LR / day)", title = "Salt") 
STIcluster_LRno.S <- STIcluster_LRno.S + rremove("legend") + stat_compare_means(method="t.test", ref.group = 1, 
                                                              label = "p.signif", hide.ns = T)
STIcluster_LRno.S