This document forms part of the data and code deposited at:
https://github.com/acp29/Elmasri_GRIN2A

Load package requirements

if (!require(package="tidyverse")) utils::install.packages("tidyverse")
library(tidyverse) 
if (!require(package="lme4")) utils::install.packages("lme4")
library(lme4)  
if (!require(package="HLMdiag")) utils::install.packages("HLMdiag")
library(HLMdiag) 
if (!require(package="parameters")) utils::install.packages("parameters")
library(parameters) 
if (!require(package="car")) utils::install.packages("car")
library(car)  
if (!require(package="performance")) utils::install.packages("performance")
library(performance) 
if (!require(package="BayesFactor")) utils::install.packages("BayesFactor")
library(BayesFactor) 
if (!require(package="bayestestR")) utils::install.packages("bayestestR")
library(bayestestR) 
if (!require(package="stats")) utils::install.packages("stats")
library(stats)
if (!require(package="pCalibrate")) utils::install.packages("pCalibrate")
library(pCalibrate)
if (!require(package="afex")) utils::install.packages("afex")
library(afex)
if (!require(package="emmeans")) utils::install.packages("emmeans")
library(emmeans)
if (!require(package="multcomp")) utils::install.packages("multcomp")
library(multcomp)
if (!require(package="knitr")) utils::install.packages("knitr")
library(knitr)
if (!require(package="kableExtra")) utils::install.packages("kableExtra")
library(kableExtra)
if (!require(package="ggplot2")) utils::install.packages("ggplot2")
library(ggplot2)
if (!require(package="qqplotr")) utils::install.packages("qqplotr")
library(qqplotr)
if (!require(package="gridExtra")) utils::install.packages("gridExtra")
library(gridExtra)
if (!require(package="ggforce")) utils::install.packages("ggforce")
library(ggforce)
if (!require(package="devEMF")) utils::install.packages("devEMF")
library(devEMF)
if (!require(package="effectsize")) utils::install.packages("effectsize")
library(effectsize)

Read text in from file

Data <- read.delim("../data/n2a_mutant_imaging.dat", header = TRUE)
Data %>% 
  mutate(roi = row_number()) %>%
  pivot_longer(cols = GluN1:Homer1c, names_to = "protein", values_to = "intensity") -> Data

Factor encoding

Data$mutation <- as.factor(Data$mutation)
Data$expt <- as.factor(Data$expt)
Data$protein <- as.factor(Data$protein)

Set mutation WT and protein Homer1c as reference levels

Data$mutation <- factor(Data$mutation, levels=c("NONE","WT","C436R","T531M","R518H","K669N","L812M"))
Data$protein <- factor(Data$protein, levels=c("Homer1c","GluN1"))

lmer settings

settings <- lmerControl(check.conv.singular = .makeCC(action = "ignore",  tol = 1e-4), boundary.tol=0)

Fit a mixed linear model

# Initialize
variates <- c("intensity")
l <- length(variates)

for (i in 1:l) {
  
variates[i] -> resp  

cat('\n\n\n# Analysis of',resp,'\n\n')

# Plot data
# colours selected from:
#  > library(scales)
#  > show_col(hue_pal()(9))
p1 <- Data %>%
     mutate(mutation_jittered = jitter((as.numeric(mutation)+(as.numeric(protein)-1)/2.5), 0.5),
            grouping=interaction(roi, mutation)) %>%
     mutate(mutation_protein = as.numeric(mutation)+(as.numeric(protein)-1)/2.5) %>%
     ggplot(aes(x=mutation, y=!!sym(resp), group=grouping, color=protein)) + 
     geom_blank() +
     geom_line(aes(mutation_jittered), alpha=0.33, color="grey") +
     geom_point(aes(mutation_jittered), alpha=0.9, shape = 16) +
     scale_color_manual(values=c("#F8766D","#00BA38")) +
     stat_summary(mapping = aes(x=mutation_protein,y=!!sym(resp)), fun.data="median_hilow", fun.args = list(conf.int=0.5), geom="linerange", color="black", size=1.0,inherit.aes=FALSE) + 
     stat_summary(mapping = aes(x=mutation_protein,y=!!sym(resp)), fun="median", geom="point", shape=21, fill="white", color="black", size=2.5, stroke=1, inherit.aes=FALSE) +
     ylab(resp) +
     ggtitle("A") +
     theme(axis.text.x = element_text(angle = 45, vjust=1, hjust=1),axis.line = element_line(colour="black"),
           panel.grid.major = element_blank(),
           panel.grid.minor = element_blank(),
           panel.border = element_blank(),
           panel.background = element_blank(),
           legend.title = element_blank(),
           legend.position = "top")
p2 <- ggplot(Data, aes(x=mutation, y=ratio, colour=mutation)) +
    geom_sina(alpha=0.9, shape = 16) + 
    scale_color_manual(values=c("#D39200","grey","#00C19F","#00B9E3","#619CFF","#DB72FB","#FF61C3")) +
    stat_summary(fun.data="median_hilow", fun.args = list(conf.int=0.5), geom="linerange", color="black", size=1.0) + 
    stat_summary(fun="median", geom="point", shape=21, fill="white", color="black", size=2.5, stroke=1) +
    ylab("ratio") +
    ggtitle("B") +
    theme(axis.text.x = element_text(angle = 45, vjust=1, hjust=1),axis.line = element_line(colour="black"),
          panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(),
          panel.border = element_blank(),
          panel.background = element_blank(),
          legend.position = "none")
grid.arrange(p1, p2, nrow = 1, ncol = 2, top=sprintf("Summary plots of the data for: %s\n",resp))

# Fit the model with planned contrasts and perform hypothesis testing
  
# Setup planned, orthogonal contrasts
# ("NONE","WT",C436R","T531M","R518H","K669N","L812M")
# According to exploratory factor and cluster analysis of published data:
# GOF1 is gain-of-function (Factor 1)
# LOF1 is loss-of-function (Factor 1)
# LOF2 is loss-of-function (Factor 2)
# Factor 1 (functional change, e.g. EC50[Glu])
# Factor 2 (expression change, e.g. surface expression and current density)
None_vs_others  <- c(-6,1,1,1,1,1,1)/7
WT_vs_Mutants   <- c(0,-5,1,1,1,1,1)/6
GOF1_vs_LOF12   <- c(0,0,-2,-2,-2,3,3)/5
LOF1_vs_LOF2    <- c(0,0,-1,-1,2,0,0)/3
GOF1            <- c(0,0,0,0,0,-1,1)/2
LOF2            <- c(0,0,-1,1,0,0,0)/2
contr.orth <- cbind(None_vs_others, WT_vs_Mutants, GOF1_vs_LOF12, LOF1_vs_LOF2, LOF2, GOF1)
rownames(contr.orth) <- levels(Data$mutation)

# Check that contrasts are indeed orthogonal
contr.orth %>%
  cor() %>%
  knitr::kable(caption = sprintf("**All off-diagonal elements in correlation matrix of orthogonal contrasts should be zero: %s**",resp), digits = 2) %>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover")) %>%
  print()
contr.orth %>%
  colSums() %>%
  as.data.frame() %>%
  rename(.,'sum' = '.') %>%
  knitr::kable(caption = sprintf("**Sum of each orthogonal contrast should be zero: %s**",resp), digits = 2) %>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover")) %>%
  print()

# Fit model (with orthogonal contrasts)
contrasts(Data$mutation) <- contr.orth 
attr(Data$mutation,"contrasts") %>%
  as.data.frame() %>%
  rownames_to_column(var = "mutation") %>% 
  knitr::kable(caption = sprintf("**Matrix of contrasts on mutation: %s**",resp), digits = 2) %>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover")) %>%
  print()
contrasts(Data$protein) <- rbind(-1,1)/2
attr(Data$protein,"contrasts") %>% 
  as.data.frame() %>%
  rename(contrast = "V1") %>%
  rownames_to_column(var = "protein") %>% 
  knitr::kable(caption = sprintf("**Matrix of contrasts on protein: %s**",resp), digits = 2) %>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover")) %>%
  print() 
formula <- sprintf("log(%s) ~ mutation * protein + (1|expt/roi)", resp)
model <- lme4::lmer(formula, data = Data, REML = TRUE, control = settings, na.action = "na.fail") 

# Checking model assumptions
resid = residuals(model)
n = length(resid)
stdev = sqrt((n-1)/n) * sd(resid) # standard deviation with denominator n
std_resid = resid/stdev
p1 <- ggplot(Data, aes(x = fitted(model), y = std_resid)) +
  geom_point() +
  ggtitle("a") +
  xlab("Fitted values") + ylab("Standardized Residuals") +
  geom_hline(yintercept = 0) +
  geom_quantile(formula=y~x, color="#619CFF", size=1) +
  geom_smooth(method="loess", formula = y ~ x, color="#F8766D", size=1, se=FALSE)
p2 <- ggplot(Data, aes(x = std_resid)) +
  geom_histogram(aes(y=..density..), binwidth = 0.9*n^(-1/5), fill="#619CFF", alpha=0.33)  +
  geom_density(kernel="gaussian", alpha=0, color="#619CFF", size=1) +
  ggtitle("b") +
  xlab("Standardized Residuals") + ylab("Density") +
  geom_vline(xintercept = 0) +
  geom_function(fun = dnorm, args = list(mean=0, sd=1), col = "#F8766D", size = 1)
p3 <- ggplot(Data, aes(sample = std_resid)) +
  geom_qq_band(distribution = "norm", bandType = "ts", mapping = aes(fill = "TS"), fill="#619CFF", alpha = 0.33) +
  stat_qq() + 
  stat_qq_line(color="#F8766D",size=1) +
  ggtitle("c") +
  xlab("Normal Quantiles") + ylab("Sample Quantiles") 
infl <- hlm_influence(model, level="roi:expt")
p4 <- infl %>% 
  mutate(influential = cooksd > 1.0) %>% 
  ggplot(aes(x=`roi:expt`,y=cooksd, color=influential)) + 
  geom_segment(aes(x=`roi:expt`, xend=`roi:expt`, y=0, yend=cooksd)) + 
  geom_point() + 
  scale_color_manual(values=c("#619CFF","#F8766D")) + 
  ylab("Cook's distance") +
  ggtitle("d") +
  theme(axis.text.x = element_blank(),
        axis.ticks.x = element_blank(),
        legend.position = "none",
        panel.background = element_rect(color="#EBEBEB"),
        panel.grid = element_blank(),
        panel.grid.minor.y = element_line(color = "white", size=0.25),
        panel.grid.major.y = element_line(color = "white", size=0.5),
        axis.line = element_blank(),
        axis.line.x = element_line(size = 0.5, colour = "black"))
grid.arrange(p1, p2, p3, p4, nrow=2, ncol=2, top=sprintf("Plots of standardized model residuals and Cook's distances: %s\n",resp))
  
# Calculated estimated marginal means, By default, emmeans uses Kenward-Roger's method for estimating the degrees of freedom
emm <- emmeans(model, ~ mutation * protein, data = Data, tran = 'log', type = 'response')
emm %>% 
  summary(calc = c(n = ".wgt.")) %>%
  as.data.frame() %>%
  relocate(df, .before = response) %>%
  dplyr::select(-SE) %>%
  knitr::kable(caption = sprintf("**Estimated marginal means with 95%% confidence intervals: %s**",resp), digits = 2) %>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover")) %>%
  print()

# Calculate overall average for Homer1c-tdTomato fluorescence
emmeans(model, ~ mutation * protein, data = Data) %>%
  as.data.frame() %>%
  filter(protein == "Homer1c") %>%
  dplyr::select(emmean) %>% 
  colMeans() %>%
  exp() %>%
  sprintf("**Overall average of %s for Homer1c-tdTomato fluorescence intensity**: %.2f",resp,.) %>%
  print()

# Calculate GluN1/Homer1c ratios
emm.ratios <- contrast(emm, method = "trt.vs.ctrl", interaction = FALSE, by = 'mutation', adjust = "none")
emm.ratios %>%
  confint() %>%
  as.data.frame() %>%
  relocate(df, .before = ratio) %>%
  dplyr::select(-SE) %>%
  knitr::kable(caption = sprintf("**Estimated marginal means with 95%% confidence intervals for GluN1/Homer1c ratios: %s**",resp), digits = 2) %>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover")) %>%
  print()

# Replot data with 95% confidence intervals
emf(sprintf("../img/%s_%s.emf","n2a_mutant_imaging",resp), width=5.5, height=3.5)
emm %>%
    as.data.frame() %>%
    mutate(mutation_protein = as.numeric(mutation)+(as.numeric(protein)-1)/2.5) -> emm_df
p1 <- Data %>%
    mutate(mutation_jittered = jitter((as.numeric(mutation)+(as.numeric(protein)-1)/2.5), 0.5),
           grouping=interaction(roi, mutation)) %>%
    mutate(mutation_protein = as.numeric(mutation)+(as.numeric(protein)-1)/2.5) %>%
    ggplot(aes(x=mutation, y=!!sym(resp), group=grouping, color=protein)) + 
    geom_blank() +
    geom_line(aes(mutation_jittered), alpha=0.3, color="grey", size=0.75) +
    geom_point(aes(mutation_jittered), alpha=0.6, shape = 16, size=0.75) +
    scale_color_manual(values=c("#F8766D","#00BA38")) +
    scale_fill_manual(values=c("#F8766D","#00BA38")) +
    geom_crossbar(data = emm_df, 
                    aes(x=mutation_protein, y=response, ymin=`lower.CL`, ymax=`upper.CL`, fill=protein), 
                    color="black", alpha=0.5, size=0.5, fatten=1, inherit.aes=FALSE) + 
    ylab(resp) +
    theme(axis.text.x = element_text(angle = 45, vjust=1, hjust=1),axis.line = element_line(colour="black"),
          panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(),
          panel.border = element_blank(),
          panel.background = element_blank(),
          legend.title = element_blank(),
          legend.position = c(0.5, 1.06),
          legend.direction = "horizontal",
          text = element_text(size=14))
emm.ratios %>%
    confint() %>%
    as.data.frame() -> emm.ratios_df
p2 <- ggplot(Data, aes(x=mutation, y=ratio, colour=mutation)) +
    geom_sina(alpha=0.6, shape=16, size=0.75, maxwidth=0.4) + 
    geom_crossbar(data = emm.ratios_df, 
                           aes(x=mutation, y=ratio, ymin=`lower.CL`, ymax=`upper.CL`, fill=mutation), 
                    color="black", alpha=0.5, size=0.5, fatten=1, width=0.8, inherit.aes=FALSE) +
    scale_color_manual(values=c("#D39200","grey","#00C19F","#00B9E3","#619CFF","#DB72FB","#FF61C3")) +
    scale_fill_manual(values=c("#D39200","grey","#00C19F","#00B9E3","#619CFF","#DB72FB","#FF61C3")) +
    ylab("ratio") +
    theme(axis.text.x = element_text(angle = 45, vjust=1, hjust=1), axis.line = element_line(colour="black"),
          panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(),
          panel.border = element_blank(),
          panel.background = element_blank(),
          legend.position = "none",
          text=element_text(size=14))
grid.arrange(p1, p2, layout_matrix=rbind(c(1,2)), top=sprintf("Summary plots of the data with 95%% confidence intervals: %s\n",resp))
dev.off() #turn off device and finalize file
setwd("..")

# Update model to remove the control (NONE) from the data set and contrasts since it will 
# make the omnibus test statistic obsolete and isn't be part of our hypothesis test
Data %>% 
  filter(mutation!="NONE") -> droppedData
droppedData$mutation <- factor(droppedData$mutation, levels = levels(droppedData$mutation)[-1])
contr.orth <- contr.orth[,-1] # remove contrast for first column (contrast with level NONE)
contr.orth <- contr.orth[-1,] # remove contrast for first row (level NONE)
contrasts(droppedData$mutation) <- contr.orth 
model <- update(model, data = droppedData)

# Calculate ANOVA table for the fitted model (Type III sum of squares) 
car::Anova(model, type = 3, test.statistic = "F") %>%       # Uses Kenward-Roger degrees of freedom
  as.data.frame() %>%
  rownames_to_column(var="Source") %>%
  filter(Source != "(Intercept)") -> aov

# Calculate Bayes Factors for ANOVA and append them to the ANOVA data frame
# Inclusion Bayes Factor based on matched models (prior odds uniform-equal)
droppedData %>% 
  mutate(logresp = log(!!sym(resp))) %>%
  as.data.frame() -> droppedData
set.seed(123456)
anovaBF(logresp ~ mutation * protein + expt, 
                 whichRandom = "expt", 
                 whichModel = "withmain", 
                 iterations = 20000,
                 data = droppedData) %>%
  bayesfactor_inclusion(match_models = TRUE) %>% 
  as.data.frame() %>% 
  na.omit() %>%    # removes the (nuisance) random factors
  mutate(BF = exp(log_BF)) %>%
  mutate_at("BF", formatC, format='g',digits = 3) %>% 
  dplyr::select(BF) %>% 
  unlist() -> aov$BF

# Calculate orthogonal contrasts and append them to the ANOVA summary table
# I go to the trouble of transforming the t-statistic (which is returned from the linear model) 
# to an F statistic but they give identical p-values; I think this makes more sense and provides 
# more consistency when splitting the source of variation into orthogonal contrasts and presenting 
# them in an ANOVA table (eg. like with summary.aov or orthogonal contrasts in SAS)
model_parameters(model, ci_method = "kenward", exponentiate = TRUE, effects = "fixed") %>%  
  filter(grepl(":",Parameter)) %>%                          # select interaction terms only
  rename(Source = Parameter) %>%                            # set denominator degrees of freedom
  mutate(Df = 1) %>%                                        # set numerator degrees of freedom
  add_column(BF = "")  %>%                                  # add empty column for Bayes factors
  rename(Df.res = df_error) %>%                             # set denominator degrees of freedom
  mutate(F = abs(t)^2) %>%                                  # calculate F statistic
  mutate(`Pr(>F)` = pf(F,Df,Df.res,lower.tail=FALSE)) %>%   # calculate p value
  dplyr::select(c(Source,F,Df,Df.res,`Pr(>F)`,BF)) %>%      # select columns of interest for table
  rbind(aov,.) %>%                                          # row bind with anova table
  mutate(`Pr(>F)` = afex::round_ps_apa(`Pr(>F)`)) %>%       # format p values as APA style
  knitr::kable(caption = sprintf("**ANOVA table (Type III Wald F tests with Kenward-Roger df) and Bayes factors for fixed effects with interaction source split into orthogonal contrasts: %s**",resp), digits = 2) %>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover")) %>%
  add_indent(c(4:8)) %>%                                    # add indentation to indicate source components
  print()

# Calculate intraclass correlation coefficients (ICC) for the random effects
icc(model, by_group=TRUE, tolerance=0) %>% 
  as.data.frame() %>% 
  mutate(N = ngrps(model)) %>%
  rbind(.,c("residual",1-sum(.$ICC),nobs(model))) %>%
  mutate(ICC = as.numeric(ICC)) %>%                               
  knitr::kable(caption = sprintf("**Intraclass correlation coefficients for random effects: %s**",resp), digits = 3) %>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover")) %>%
  print()
  
# 95% confidence intervals for interaction contrasts
emm <- emmeans(model, ~ mutation * protein, data = droppedData, tran = 'log', type = 'response')
emm.interaction <- contrast(emm, method = "trt.vs.ctrl", interaction = TRUE, adjust = "none")
emm.interaction %>%
  confint() %>% 
  relocate(df, .before = ratio) %>%
  dplyr::select(-SE) %>%
  knitr::kable(caption = sprintf("**95%% confidence intervals for contrasts: %s**",resp), digits = 2) %>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover")) %>%
  print()

# Standardized effect sizes (*r*) for interaction contrasts
# Methods used the same as this server: https://easystats4u.shinyapps.io/statistic2effectsize/
emm.interaction %>% 
    as.data.frame() %>% 
    mutate(n = df+nrow(.)+1) %>% 
    mutate(r = t_to_r(t.ratio, df)$r) %>% 
    mutate(z = atanh(r),
           SE = 1/sqrt(n-3),
           CI = sprintf("[%.2f, %.2f]",
                        LL = tanh(z - 1.96*SE),
                        UL = tanh(z + 1.96*SE))) %>%
    dplyr::select(-c(ratio,SE,df,null,t.ratio,p.value,z)) %>%
    knitr::kable(col.names = c("mutation",
                               "Protein",
                               "*N*",
                               "*r*",
                               "95% *CI*"),
                 caption = sprintf("**Standardized effect sizes (*r*) for contrasts: %s**",resp), digits = 2) %>% 
    kableExtra::kable_styling(bootstrap_options = c("striped", "hover")) %>%
    print()

posthoc = FALSE

if (posthoc == TRUE) {
  
# p-values and maximum Bayes Factors for interaction contrasts 
# Dunnett's step-down adjustment to control FWER on p-values (using multcomp package)
# Chapter 4.1.2 in Bretz, F., Hothorn, T. and Westfall, P. (2011) Multiple Comparisons Using R. Taylor and Frances Group, LLC.
emm.interaction %>%   
    as.glht() %>%
    summary(test = adjusted(type = "free")) -> glht.out  
emm.interaction %>%   
  as.data.frame() %>%
  dplyr::select(-SE) %>%
  mutate(p.adj = glht.out$test$pvalues) %>%
  mutate(p.adj = sapply(p.adj,max,.Machine$double.eps)) %>%
  mutate(maxBF = 1/pCalibrate(p.adj,"exploratory")) %>%
  mutate_at("maxBF", formatC, format='g',digits = 3) %>%
  mutate(p.value = afex::round_ps_apa(p.value)) %>%
  mutate(p.adj = afex::round_ps_apa(p.adj)) %>%
  knitr::kable(caption = sprintf("**Hypothesis testing on interaction parameters (Dunnett's step-down p-value adjustment): %s**",resp), digits = 2) %>%
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover")) %>%
  print()

}


}

Analysis of intensity

All off-diagonal elements in correlation matrix of orthogonal contrasts should be zero: intensity
None_vs_others WT_vs_Mutants GOF1_vs_LOF12 LOF1_vs_LOF2 LOF2 GOF1
None_vs_others 1 0 0 0 0 0
WT_vs_Mutants 0 1 0 0 0 0
GOF1_vs_LOF12 0 0 1 0 0 0
LOF1_vs_LOF2 0 0 0 1 0 0
LOF2 0 0 0 0 1 0
GOF1 0 0 0 0 0 1
Sum of each orthogonal contrast should be zero: intensity
sum
None_vs_others 0
WT_vs_Mutants 0
GOF1_vs_LOF12 0
LOF1_vs_LOF2 0
LOF2 0
GOF1 0
Matrix of contrasts on mutation: intensity
mutation None_vs_others WT_vs_Mutants GOF1_vs_LOF12 LOF1_vs_LOF2 LOF2 GOF1
NONE -0.86 0.00 0.0 0.00 0.0 0.0
WT 0.14 -0.83 0.0 0.00 0.0 0.0
C436R 0.14 0.17 -0.4 -0.33 -0.5 0.0
T531M 0.14 0.17 -0.4 -0.33 0.5 0.0
R518H 0.14 0.17 -0.4 0.67 0.0 0.0
K669N 0.14 0.17 0.6 0.00 0.0 -0.5
L812M 0.14 0.17 0.6 0.00 0.0 0.5
Matrix of contrasts on protein: intensity
protein contrast
Homer1c -0.5
GluN1 0.5
Estimated marginal means with 95% confidence intervals: intensity
mutation protein df response n lower.CL upper.CL
NONE Homer1c 14.55 137.45 81 122.20 154.60
WT Homer1c 20.04 132.73 57 117.15 150.39
C436R Homer1c 67.17 130.23 20 110.06 154.10
T531M Homer1c 30.41 122.46 41 106.47 140.85
R518H Homer1c 37.86 129.90 33 112.22 150.38
K669N Homer1c 60.51 138.69 22 117.73 163.39
L812M Homer1c 76.53 88.23 18 74.22 104.88
NONE GluN1 14.55 22.94 81 20.39 25.80
WT GluN1 20.04 41.69 57 36.80 47.24
C436R GluN1 67.17 22.83 20 19.29 27.01
T531M GluN1 30.41 28.73 41 24.98 33.05
R518H GluN1 37.86 39.42 33 34.05 45.63
K669N GluN1 60.51 47.40 22 40.24 55.84
L812M GluN1 76.53 20.62 18 17.35 24.51
[1] “Overall average of intensity for Homer1c-tdTomato fluorescence intensity: 124.46”
Estimated marginal means with 95% confidence intervals for GluN1/Homer1c ratios: intensity
contrast mutation df ratio lower.CL upper.CL
GluN1 / Homer1c NONE 265 0.17 0.15 0.18
GluN1 / Homer1c WT 265 0.31 0.28 0.35
GluN1 / Homer1c C436R 265 0.18 0.15 0.21
GluN1 / Homer1c T531M 265 0.23 0.21 0.26
GluN1 / Homer1c R518H 265 0.30 0.26 0.35
GluN1 / Homer1c K669N 265 0.34 0.29 0.40
GluN1 / Homer1c L812M 265 0.23 0.19 0.28
ANOVA table (Type III Wald F tests with Kenward-Roger df) and Bayes factors for fixed effects with interaction source split into orthogonal contrasts: intensity
Source F Df Df.res Pr(>F) BF
mutation 21.02 5 126.1 <.001 3.52e+17
protein 1901.81 1 185.0 <.001 2.05e+131
mutation:protein 10.29 5 185.0 <.001 4.82e+04
mutationWT_vs_Mutants:protein1 12.71 1 185.0 <.001
mutationGOF1_vs_LOF12:protein1 6.90 1 185.0 .009
mutationLOF1_vs_LOF2:protein1 21.65 1 185.0 <.001
mutationLOF2:protein1 7.45 1 185.0 .007
mutationGOF1:protein1 9.32 1 185.0 .003
Intraclass correlation coefficients for random effects: intensity
Group ICC N
roi:expt 0.187 191
expt 0.094 8
residual 0.719 382
95% confidence intervals for contrasts: intensity
mutation_trt.vs.ctrl protein_trt.vs.ctrl df ratio lower.CL upper.CL
C436R / WT GluN1 / Homer1c 185 0.56 0.46 0.68
T531M / WT GluN1 / Homer1c 185 0.75 0.64 0.88
R518H / WT GluN1 / Homer1c 185 0.97 0.82 1.14
K669N / WT GluN1 / Homer1c 185 1.09 0.90 1.32
L812M / WT GluN1 / Homer1c 185 0.74 0.60 0.92
Standardized effect sizes (r) for contrasts: intensity
mutation Protein N r 95% CI
C436R / WT GluN1 / Homer1c 191 -0.39 [-0.50, -0.26]
T531M / WT GluN1 / Homer1c 191 -0.26 [-0.39, -0.12]
R518H / WT GluN1 / Homer1c 191 -0.03 [-0.17, 0.11]
K669N / WT GluN1 / Homer1c 191 0.06 [-0.08, 0.20]
L812M / WT GluN1 / Homer1c 191 -0.20 [-0.33, -0.06]