this is the shoot ion leakage experiment for the 5 Arabidopsis genotypes I did in soil.2 weeks old seedlings were subjected to 100 mM salt for 2 weeks. We measure Chl.Ind etc with CropReporter. Overall no difference in ion leakage between the genotypes as I expected based on my 2021 experiment. However, I did the RSA analysis for the same seedlings +/- in plate that I wait for those results to see whether I can replicate the duf story.I did average both trays.

getwd()
## [1] "C:/Users/Julkowska Lab/Desktop/R codes by Maryam/20231020_ion_leakae_duf_wrky_2xko_soil_grown"
setwd("C:/Users/Julkowska Lab/Desktop/R codes by Maryam/20231020_ion_leakae_duf_wrky_2xko_soil_grown/")
list.files(pattern = ".csv")
## [1] "20231019_duf_wrky_2xko_soil_salt_ion_leakage_forR.csv"
IL <- read.csv("20231019_duf_wrky_2xko_soil_salt_ion_leakage_forR.csv")
IL
IL$All.ID<-paste(IL$Geno, IL$Condition, sep="_")
IL
library(ggplot2)
library(ggpubr)
library(multcompView)
aov(Ion.leakage ~ All.ID, data = IL)
## Call:
##    aov(formula = Ion.leakage ~ All.ID, data = IL)
## 
## Terms:
##                   All.ID Residuals
## Sum of Squares  21977.65  16960.08
## Deg. of Freedom        9       110
## 
## Residual standard error: 12.41702
## Estimated effects may be unbalanced
Output <- TukeyHSD(aov(Ion.leakage ~ All.ID, data = IL))
Output
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Ion.leakage ~ All.ID, data = IL)
## 
## $All.ID
##                            diff        lwr        upr     p adj
## 2xD_salt-2xD_ctrl    31.8369760  15.465299  48.208653 0.0000003
## 2xE_ctrl-2xD_ctrl    -3.2013701 -19.573047  13.170307 0.9997702
## 2xE_salt-2xD_ctrl    22.6107769   6.239100  38.982454 0.0008047
## col_ctrl-2xD_ctrl     2.5883554 -13.783321  18.960032 0.9999613
## col_salt-2xD_ctrl    25.4290884   9.057412  41.800765 0.0000867
## duf_ctrl-2xD_ctrl    -3.4016133 -19.773290  12.970064 0.9996220
## duf_salt-2xD_ctrl    24.8920045   8.520328  41.263681 0.0001344
## wrky_ctrl-2xD_ctrl    2.3962619 -13.975415  18.767939 0.9999800
## wrky_salt-2xD_ctrl   25.9273562   9.555679  42.299033 0.0000574
## 2xE_ctrl-2xD_salt   -35.0383461 -51.410023 -18.666669 0.0000000
## 2xE_salt-2xD_salt    -9.2261991 -25.597876   7.145478 0.7211856
## col_ctrl-2xD_salt   -29.2486205 -45.620297 -12.876944 0.0000033
## col_salt-2xD_salt    -6.4078876 -22.779564   9.963789 0.9594064
## duf_ctrl-2xD_salt   -35.2385893 -51.610266 -18.866912 0.0000000
## duf_salt-2xD_salt    -6.9449715 -23.316648   9.426705 0.9337113
## wrky_ctrl-2xD_salt  -29.4407140 -45.812391 -13.069037 0.0000027
## wrky_salt-2xD_salt   -5.9096198 -22.281297  10.462057 0.9759583
## 2xE_salt-2xE_ctrl    25.8121470   9.440470  42.183824 0.0000632
## col_ctrl-2xE_ctrl     5.7897255 -10.581951  22.161402 0.9790383
## col_salt-2xE_ctrl    28.6304585  12.258782  45.002135 0.0000056
## duf_ctrl-2xE_ctrl    -0.2002432 -16.571920  16.171434 1.0000000
## duf_salt-2xE_ctrl    28.0933746  11.721698  44.465051 0.0000090
## wrky_ctrl-2xE_ctrl    5.5976320 -10.774045  21.969309 0.9833343
## wrky_salt-2xE_ctrl   29.1287263  12.757049  45.500403 0.0000036
## col_ctrl-2xE_salt   -20.0224214 -36.394098  -3.650745 0.0052001
## col_salt-2xE_salt     2.8183115 -13.553365  19.189988 0.9999206
## duf_ctrl-2xE_salt   -26.0123902 -42.384067  -9.640713 0.0000535
## duf_salt-2xE_salt     2.2812276 -14.090449  18.652904 0.9999869
## wrky_ctrl-2xE_salt  -20.2145149 -36.586192  -3.842838 0.0045582
## wrky_salt-2xE_salt    3.3165793 -13.055098  19.688256 0.9996927
## col_salt-col_ctrl    22.8407329   6.469056  39.212410 0.0006757
## duf_ctrl-col_ctrl    -5.9899688 -22.361646  10.381708 0.9737106
## duf_salt-col_ctrl    22.3036490   5.931972  38.675326 0.0010139
## wrky_ctrl-col_ctrl   -0.1920935 -16.563770  16.179583 1.0000000
## wrky_salt-col_ctrl   23.3390007   6.967324  39.710678 0.0004607
## duf_ctrl-col_salt   -28.8307017 -45.202379 -12.459025 0.0000047
## duf_salt-col_salt    -0.5370839 -16.908761  15.834593 1.0000000
## wrky_ctrl-col_salt  -23.0328264 -39.404503  -6.661150 0.0005834
## wrky_salt-col_salt    0.4982678 -15.873409  16.869945 1.0000000
## duf_salt-duf_ctrl    28.2936178  11.921941  44.665295 0.0000076
## wrky_ctrl-duf_ctrl    5.7978753 -10.573802  22.169552 0.9788390
## wrky_salt-duf_ctrl   29.3289695  12.957293  45.700646 0.0000030
## wrky_ctrl-duf_salt  -22.4957425 -38.867419  -6.124066 0.0008777
## wrky_salt-duf_salt    1.0353517 -15.336325  17.407029 1.0000000
## wrky_salt-wrky_ctrl  23.5310942   7.159417  39.902771 0.0003968
P7 = Output$All.ID[,'p adj']
stat.test<- multcompLetters(P7)
stat.test
##  2xD_salt  2xE_ctrl  2xE_salt  col_ctrl  col_salt  duf_ctrl  duf_salt wrky_ctrl 
##       "a"       "b"       "a"       "b"       "a"       "b"       "a"       "b" 
## wrky_salt  2xD_ctrl 
##       "a"       "b"
test <- as.data.frame(stat.test$Letters)
test$group1 <- rownames(test)
test$group2 <- rownames(test)
colnames(test)[1] <- "Tukey"
test
###################################################################
test$info <- strsplit(test$group1, "_")
test$info[[1]][2]
## [1] "salt"
test$Geno <- "none"
test$Condition<- "none"
test
for(i in 1:nrow(test)){
  test$Geno[i] <- test$info[[i]][1]
  test$Condition[i] <- test$info[[i]][2]
  
}

test2 <- test[,c(5:6,1)]
test2$group1 <- test2$Geno
test2$group2 <- test2$Geno
IL
IL$Geno<- factor(IL$Geno, levels=c("col", "duf", "wrky","2xD", "2xE"))

IL_graph <- ggplot(data = IL, mapping = aes(x = Geno, y = Ion.leakage, colour = Geno)) 
IL_graph <- IL_graph + geom_boxplot(alpha=0.2) + geom_jitter(width=0.1,alpha=0.2)

IL_graph <- IL_graph + facet_grid(~ Condition, scales = "free_y")

IL_graph <- IL_graph + stat_summary(fun=mean, geom="point", shape=95, size=6, color="black", fill="black")
IL_graph <- IL_graph + scale_color_manual(values = c("blue","blueviolet","cyan", "red", "deeppink", "magenta"))
IL_graph <- IL_graph + ylab("Shoot ion leakage, %") + xlab("") + stat_pvalue_manual(test2, label = "Tukey", y.position = 80)
IL_graph <- IL_graph + theme(axis.text.x = element_text(angle=90, hjust=0.9, vjust=0.5))
IL_graph <- IL_graph + rremove("legend")
IL_graph