Show the code
DT::datatable(dfms$dfm_4c, options=list(pageLength=5))WT NeRh50 maximum amplitudes and decay rate constants in response to changes in lipid-protein ratio (LPR)Manuscript figure 4c shows WT maximum amplitude and decay rate constant variation over LPR5, LPR10, and LPR50 for the WT NeRh50 with NH4+ (figure 4c).
The data used for the figure are shown in Table 1
We use linear models for amplitude and decay rate as dependent variables, with LPR as the independent factor, checking fit in Figure 1.
amplitude ~ LPR and decayrate ~ LPR. The splines for linearity/heteroscadicity are odd, but the datapoints are not concerning. There is some evidence of non-normality of residuals in the decay rate data, but nothing especially concerning.
As the model fit is acceptable, we estimate contrasts in Table 2.
EMM <- emmeans::emmeans(model4c_amp_lm, ~ LPR)
confint(emmeans::contrast(EMM, "pairwise", adjust="sidak")) |>
kableExtra::kbl(digits=3) |>
kableExtra::kable_styling(
bootstrap_options = c("hover", "responsive")
)
EMM <- emmeans::emmeans(model4c_k_lm, ~ LPR)
confint(emmeans::contrast(EMM, "pairwise", adjust="sidak")) |>
kableExtra::kbl(digits=3) |>
kableExtra::kable_styling(
bootstrap_options = c("hover", "responsive")
)| contrast | estimate | SE | df | lower.CL | upper.CL |
|---|---|---|---|---|---|
| LPR5 - LPR10 | 0.914 | 0.075 | 21 | 0.720 | 1.108 |
| LPR5 - LPR50 | 1.467 | 0.084 | 21 | 1.250 | 1.684 |
| LPR10 - LPR50 | 0.553 | 0.084 | 21 | 0.336 | 0.770 |
| contrast | estimate | SE | df | lower.CL | upper.CL |
|---|---|---|---|---|---|
| LPR5 - LPR10 | 11.312 | 1.314 | 13 | 7.716 | 14.908 |
| LPR5 - LPR50 | 20.582 | 1.630 | 13 | 16.122 | 25.042 |
| LPR10 - LPR50 | 9.270 | 1.670 | 13 | 4.700 | 13.840 |
As no contrast includes zero in the 95% confidence interval, we conclude that there are differences in amplitude and decay rate constant for each pairwise comparison between LPR condition.
We plot the differences, indicating P-values for the contrasts in Figure 2.
# Get p-values, accounting for heteroscedasticity and multiple testing
# Also generate group1 and group2 columns
EMM_amp <- as.data.frame(pairs(emmeans::emmeans(model4c_amp_lm, ~ LPR),
adjust="sidak")) |>
tidyr::separate(contrast, into=c("group1", "group2"), sep=" - ") |>
dplyr::mutate(y.position=2.5) |>
rstatix::add_significance()
EMM_k <- as.data.frame(pairs(emmeans::emmeans(model4c_k_lm, ~ LPR),
adjust="sidak")) |>
tidyr::separate(contrast, into=c("group1", "group2"), sep=" - ") |>
dplyr::mutate(y.position=85) |>
rstatix::add_significance()
p4c_amp <- ggplot2::ggplot(dfms$dfm_4c,
ggplot2::aes(x=LPR, y=amplitude, color=LPR)) +
ggplot2::geom_boxplot(outlier.shape = NA) +
ggplot2::geom_jitter() +
ggplot2::labs(y="Maximum amplitude (nA)") +
ggplot2::ylim(0, 3.5) +
ggplot2::theme_minimal() +
ggpubr::stat_pvalue_manual(EMM_amp,
label="p = {scales::pvalue(p.value)}",
size=3, step.increase=0.1)
p4c_k <- ggplot2::ggplot(dfms$dfm_4c,
ggplot2::aes(x=LPR, y=decayrate, color=LPR)) +
ggplot2::geom_boxplot(outlier.shape = NA) +
ggplot2::geom_jitter() +
ggplot2::labs(y="Decay rate constant k (/s)") +
ggplot2::ylim(0, 105) +
ggplot2::theme_minimal() +
ggpubr::stat_pvalue_manual(EMM_k,
label="p = {scales::pvalue(p.value)}",
size=3, step.increase=0.1)
p4c_amp
p4c_k
# Write figures to file (commented out for webpage)
#ggplot2::ggsave("assets/images/fig4c_WT_maximum_amplitude.pdf", p4c_amp)
#ggplot2::ggsave("assets/images/fig4c_WT_maximum_amplitude.png", p4c_amp)
#ggplot2::ggsave("assets/images/fig4c_WT_decay_rate_constant.pdf", p4c_k)
#ggplot2::ggsave("assets/images/fig4c_WT_decay_rate_constant.png", p4c_k)