Figure 3: Comparison of WT and D162 variants

Figure 3 in the manuscript uses panels C and D to show the distribution of maximum amplitude and decay rate between LPR5 and LPR10 for WT and D162 variants.

The Dataset

We process the NeRh50_Table_S1_raw_data_used_in_figures.csv dataset to obtain the data for this analysis, and generate a new column with interaction labels for LPR and Variant to obtain Table 1.

Show the code
# Import dataframes
dfm_fig3_amp <- dfms$dfm_fig3_amp |>
  dplyr::mutate(intact = interaction(LPR, Variant))
dfm_fig3_amp$intact <- factor(dfm_fig3_amp$intact, levels=c("LPR5.WT", "LPR5.D162A", "LPR10.WT", "LPR10.D162A"))

dfm_fig3_k <- dfms$dfm_fig3_k |>
  dplyr::mutate(intact = interaction(LPR, Variant))
dfm_fig3_k$intact <- factor(dfm_fig3_k$intact, levels=c("LPR5.WT", "LPR5.D162A", "LPR10.WT", "LPR10.D162A"))

# Show interactive tables of data
DT::datatable(dfms$dfm_fig3_amp)
DT::datatable(dfms$dfm_fig3_k)
# Write datasets to file (commented out for website)
#readr::write_csv(dfm_fig3_amp, "assets/data/02_fig3_amplitude.csv")
#readr::write_csv(dfm_fig3_k, "assets/data/02_fig3_rate.csv")
Table 1: Measurements for WT and D162A across LPR5 and LPR10 for maximum amplitude and decay rate constant.
(a) Maximum amplitude
(b) Decay rate

We visualise the dataset in the style of figure 3, in Figure 1.

Show the code
# Visualise datasets as box/whisker with superimposed datapoints
p2_amp <- ggplot2::ggplot(dfm_fig3_amp, ggplot2::aes(x=intact, y=Value, color=Variant)) +
  ggplot2::geom_boxplot(outlier.shape = NA) +
  ggplot2::geom_jitter() +
  ggplot2::labs(y="Maximum amplitude (nA)", x="") +
  ggplot2::ylim(0, 3.5) +
  ggplot2::theme_minimal()

p2_k <- ggplot2::ggplot(dfm_fig3_k, ggplot2::aes(x=intact, y=Value, color=Variant)) +
  ggplot2::geom_boxplot(outlier.shape = NA) +
  ggplot2::geom_jitter() +
  ggplot2::labs(y="Decay rate constant k (/s)", x="") +
  ggplot2::ylim(0, 75) +
  ggplot2::theme_minimal()


ggpubr::ggarrange(p2_amp, p2_k,
                  common.legend=TRUE,
                  labels=c("C", "E"))
Figure 1: WT measurements across LPR5, LPR10, LPR50 for the D2O condition, as in figures 3C and 3D from the draft manuscript

Downloads

The Question

We have multiple questions for this dataset. Within each plot we wish to determine any effects of changing Variant, and of changing LPR.

The Models

We fit linear models separately to the maximum amplitude and decay constant datasets, treating LPR and Variant as explanatory variables. Initially we fit a model with interactions Value ~ LPR * Variant.

Show the code
model2_amp_lm <- lm(Value ~ LPR * Variant, data=dfm_fig3_amp)
model2_k_lm <- lm(Value ~ LPR * Variant, data=dfm_fig3_k)

performance::check_model(model2_amp_lm, size_title=6)
performance::check_model(model2_k_lm, size_title=6)
(a) Maximum amplitude
(b) Decay rate
Figure 2: Diagnostic checks for linear model fits of Value ~ LPR * Variant

There are no major concerns in the Figure 2 diagnostic plots other than heteroscedasticity, and we extract the contrasts taking this into account, in Table 2.

Show the code
EMM1 <- emmeans::emmeans(model2_amp_lm, ~ LPR | Variant,
                        vcov=sandwich::vcovHC(model2_amp_lm))
confint(emmeans::contrast(EMM1, "pairwise", adjust="sidak")) |>
  kableExtra::kbl(digits=3) |>
  kableExtra::kable_styling(
    bootstrap_options = c("hover", "responsive")
  )
EMM2 <- emmeans::emmeans(model2_amp_lm, ~ Variant | LPR,
                        vcov=sandwich::vcovHC(model2_amp_lm))
confint(emmeans::contrast(EMM2, "pairwise", adjust="sidak")) |>
  kableExtra::kbl(digits=3) |>
  kableExtra::kable_styling(
    bootstrap_options = c("hover", "responsive")
  )
EMM3 <- emmeans::emmeans(model2_k_lm, ~ LPR | Variant,
                        vcov=sandwich::vcovHC(model2_k_lm))
confint(emmeans::contrast(EMM3, "pairwise", adjust="sidak")) |>
  kableExtra::kbl(digits=3) |>
  kableExtra::kable_styling(
    bootstrap_options = c("hover", "responsive")
  )
EMM4 <- emmeans::emmeans(model2_k_lm, ~ Variant | LPR,
                        vcov=sandwich::vcovHC(model2_k_lm))
confint(emmeans::contrast(EMM4, "pairwise", adjust="sidak")) |>
  kableExtra::kbl(digits=3) |>
  kableExtra::kable_styling(
    bootstrap_options = c("hover", "responsive")
  )
Table 2: Contrasts for model fits
(a) Maximum amplitude: change `LPR`, constant `Variant`
contrast Variant estimate SE df lower.CL upper.CL
LPR5 - LPR10 WT 0.914 0.083 33 0.745 1.083
LPR5 - LPR10 D162A 0.183 0.082 33 0.015 0.350
(b) Maximum amplitude: change `Variant`, constant `LPR`
contrast LPR estimate SE df lower.CL upper.CL
WT - D162A LPR5 0.892 0.089 33 0.711 1.073
WT - D162A LPR10 0.161 0.076 33 0.007 0.315
(c) Decay rate: change `LPR`, constant `Variant`
contrast Variant estimate SE df lower.CL upper.CL
LPR5 - LPR10 WT 11.023 1.176 30 8.622 13.424
LPR5 - LPR10 D162A -1.859 6.106 30 -14.330 10.612
(d) Decay rate: change `Variant`, constant `LPR`
contrast LPR estimate SE df lower.CL upper.CL
WT - D162A LPR5 2.725 4.358 30 -6.175 11.625
WT - D162A LPR10 -10.157 4.436 30 -19.216 -1.097

From Table 2 we see that the following contrasts are indicated not to include zero in their 95% confidence interval (estimates in Table 2), which we interpret as an effect due either to modifying LPR or by introducing the D162A substitution:

  • WT maximum amplitude decreases by -0.914nA [-1.08,-0.745] from LPR5 to LPR10
  • WT decay rate constant decreases by -11.0/s [-13.4,-8.62] from LPR5 to LPR10
  • D162 maximum amplitude decreases by -0.183nA [-0.350,-0.0155] from LPR5 to LPR10
  • At LPR5, D162A has a lower maximum amplitude than WT by -0.892nA [-1.07,-0.711]
  • At LPR10, D162A has a lower maximum amplitude than WT by -0.161nA [-0.315,-0.007]
  • At LPR10, D162A has a higher decay rate constant by 10.5/s [1.45,19.6]

Figure

We visualise this in Figure 3.

Show the code
# Get p-values, accounting for heteroscedasticity and multiple testing
# Also generate group1 and group2 columns
EMMp1 <- as.data.frame(pairs(EMM1)) |>
  tidyr::separate(contrast, into=c("group1", "group2"), sep=" - ") |>
  dplyr::mutate(group1 = paste0(group1, ".", Variant)) |>
  dplyr::mutate(group2 = paste0(group2, ".", Variant)) |>
  dplyr::select(!Variant)

EMMp2 <- as.data.frame(pairs(EMM2)) |>
  tidyr::separate(contrast, into=c("group1", "group2"), sep=" - ") |>
  dplyr::mutate(group1 = paste0(LPR, ".", group1)) |>
  dplyr::mutate(group2 = paste0(LPR, ".", group2)) |>
  dplyr::select(!LPR)

EMMp3 <- as.data.frame(pairs(EMM3))  |>
  tidyr::separate(contrast, into=c("group1", "group2"), sep=" - ") |>
  dplyr::mutate(group1 = paste0(group1, ".", Variant)) |>
  dplyr::mutate(group2 = paste0(group2, ".", Variant)) |>
  dplyr::select(!Variant)

EMMp4 <- as.data.frame(pairs(EMM4))  |>
  tidyr::separate(contrast, into=c("group1", "group2"), sep=" - ") |>
  dplyr::mutate(group1 = paste0(LPR, ".", group1)) |>
  dplyr::mutate(group2 = paste0(LPR, ".", group2)) |>
  dplyr::select(!LPR)

EMM_amp <- rbind(EMMp1, EMMp2)  |>
  dplyr::mutate(y.position=2.5) |>
  rstatix::add_significance()
EMM_k <- rbind(EMMp3, EMMp4) |>
  dplyr::mutate(y.position=60) |>
  rstatix::add_significance()

p2_amp_annot <- p2_amp +
  ggpubr::stat_pvalue_manual(EMM_amp, label="p = {scales::pvalue(p.value)}",
                             size=3, step.increase=0.1) + 
  ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 45, vjust = 0.5, hjust=1))

p2_k_annot <- p2_k +
  ggpubr::stat_pvalue_manual(EMM_k, label="p = {scales::pvalue(p.value)}",
                             size=3, step.increase=0.1) + 
  ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 45, vjust = 0.5, hjust=1))

p_comp <- ggpubr::ggarrange(p2_amp_annot, p2_k_annot,
                            labels=c("C", "E"))
p_comp

# Write figures to file (commented out for webpage)
#ggplot2::ggsave("assets/images/fig03_WT_in_D20.pdf", p_comp)
#ggplot2::ggsave("assets/images/fig03_WT_in_D20.png", p_comp)
Figure 3: WT measurements across LPR5, LPR10, LPR50 for the D2O condition, as in figures 3C and 3E from the draft manuscript, with p-values indicated

Downloads