Show the code
DT::datatable(dfms$dfm_6f, options=list(pageLength=5))WT NeRh50 maximum amplitudes and decay rate constants for transient currents recorded in the presence of 200 mM NH₄⁺ under static pH (pH6.5), in the presence of an inward proton gradient (pH6.5 to 7.5), and in the absence of NH4+ under the same proton-gradient configurationManuscript figure 6d shows WT maximum amplitude and decay rate constant variation for transient currents recorded in the presence of 200 mM NH₄⁺ under static pH (pH6.5), in the presence of an inward proton gradient (pH6.5 to 7.5), and in the absence of NH4+ under the same proton-gradient configuration (figure 6f)
The data used for the figure are shown in Table 1
We use linear models for amplitude and decay rate as dependent variables, with group as the independent factor, checking fit in Figure 1.
amplitude ~ group and decayrate ~ group. There is some heteroscadicity in the maximum amplitude data, and there are suggestions of a slight departure from normality in the same data.
As the model fit is acceptable, we estimate contrasts in Table 2.
EMM <- emmeans::emmeans(model6f_amp_lm, ~ group)
confint(emmeans::contrast(EMM, "pairwise", adjust="sidak")) |>
kableExtra::kbl(digits=3) |>
kableExtra::kable_styling(
bootstrap_options = c("hover", "responsive")
)
EMM <- emmeans::emmeans(model6f_k_lm, ~ group)
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 |
|---|---|---|---|---|---|
| pH6.5 (no gradient) - pH6.5>7.5 gradient NH4 | 0.153 | 0.122 | 17 | -0.171 | 0.477 |
| pH6.5 (no gradient) - pH6.5>7.5 gradient, no NH4 | 1.248 | 0.118 | 17 | 0.937 | 1.559 |
| pH6.5>7.5 gradient NH4 - pH6.5>7.5 gradient, no NH4 | 1.095 | 0.122 | 17 | 0.771 | 1.419 |
| contrast | estimate | SE | df | lower.CL | upper.CL |
|---|---|---|---|---|---|
| pH6.5 (no gradient) - pH6.5>7.5 gradient NH4 | 3.58 | 7.266 | 11 | -12.411 | 19.571 |
For the maximum amplitude data we find that all contrasts with the pH6.5 to pH7.5 gradient with no NH4+ exclude zero from the 95% CI, but the contrast between pH6.5 and pH6.5 to pH7.5 with NH4+ indicates no difference between groups. There is also no support for a difference in decay rate constant between pH6.5 and pH6.5 to pH7.5 with NH4+.
We plot the data, 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(model6f_amp_lm, ~ group),
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(model6f_k_lm, ~ group),
adjust="sidak")) |>
tidyr::separate(contrast, into=c("group1", "group2"), sep=" - ") |>
dplyr::mutate(y.position=90) |>
rstatix::add_significance()
p6f_amp <- ggplot2::ggplot(dfms$dfm_6f,
ggplot2::aes(x=group, y=amplitude, color=group)) +
ggplot2::geom_boxplot(outlier.shape = NA) +
ggplot2::geom_jitter() +
ggplot2::labs(y="Maximum amplitude (nA)", x="") +
ggplot2::ylim(0, 4.5) +
ggplot2::theme_minimal() +
ggpubr::stat_pvalue_manual(EMM_amp,
label="p = {scales::pvalue(p.value)}",
size=3, step.increase=0.2)+
ggplot2::theme(legend.position = "none",
axis.text.x = ggplot2::element_text(angle = 30, vjust = 0.5, hjust=1),
plot.margin=ggplot2::unit(c(0.5,0.5,1,0.5), 'cm'))
p6f_k <- ggplot2::ggplot(dfms$dfm_6f,
ggplot2::aes(x=group, y=decayrate, color=group)) +
ggplot2::geom_boxplot(outlier.shape = NA) +
ggplot2::geom_jitter() +
ggplot2::labs(y="Decay rate constant k (/s)", x="") +
ggplot2::ylim(0, 105) +
ggplot2::theme_minimal() +
ggpubr::stat_pvalue_manual(EMM_k,
label="p = {scales::pvalue(p.value)}",
size=3, step.increase=0.15)+
ggplot2::theme(legend.position = "none",
axis.text.x = ggplot2::element_text(angle = 30, vjust = 0.5, hjust=1),
plot.margin=ggplot2::unit(c(0.5,0.5,1,0.5), 'cm'))
p6f_amp
p6f_k
# Write figures to file (commented out for webpage)
#ggplot2::ggsave("assets/images/fig6f_WT_maximum_amplitude.pdf", p6f_amp)
#ggplot2::ggsave("assets/images/fig6f_WT_maximum_amplitude.png", p6f_amp)
#ggplot2::ggsave("assets/images/fig6f_WT_decay_rate_constant.png", p6f_k)
#ggplot2::ggsave("assets/images/fig6f_WT_decay_rate_constant.pdf", p6f_k)