Notes

To see how we got from the raw electrochemical scans to the datasets used here, please see the following notebooks:

This supplemental figure and notebook underlies some of the data in main figure 5, particularly the final panel. Specifically the model coefficients for \(D_{ap}\) are calculated in the Fig. S6C and S6F sections. These data are saved as .csv files in the directory containing this notebook.


Setup packages and plotting for the notebook:

Fig. S6A - WT & ∆phz SWV vs. GC

Let’s compare WT and ∆phz* + PYO biofilms. We’ll go ahead and read in some of the processed data from the WT and ∆phz processing notebooks. First we will look at the decays of the SWV peak currents:

Fig. S6B - WT and ∆phz signal decay

Now let’s plot the SWV vs. GC plots that we use to calculate \(D_{ap}\):

Fig. S6C - ∆phz + PYO \(D_{ap}\) fits

First, we will read in the paired SWV and GC signals that were generated from the processing notebook. Then we can plot the SWV vs. GC signals for both biofilms and technical replicates. Each dataset is fit with a linear model shaded with a 95% confidence interval.

Above we generated the linear models on the fly for plotting, but let’s actually generate those models so that we can look at the quality of each fit. These R squared values will be added to each panel in illustrator.

exp_id run_id r.squared adj.r.squared p.value
Biofilm 1 Rep 1 0.9910550 0.9903669 1.055808e-14
Biofilm 1 Rep 2 0.9857378 0.9846407 2.195505e-13
Biofilm 1 Rep 3 0.9468821 0.9427961 1.150624e-09
Biofilm 2 Rep 1 0.9977380 0.9975640 1.380000e-18
Biofilm 2 Rep 2 0.9831090 0.9818097 6.600651e-13
Biofilm 2 Rep 3 0.9846676 0.9834882 3.515615e-13


Here are the actual coefficients from those models, including 95% confidence intervals. We will use these coefficients to calculate Dap in Fig. 6. We will write this dataframe to a csv for later use.

exp_id run_id term estimate std.error statistic p.value conf.low conf.high
Biofilm 1 Rep 1 signal_SWV 0.1513328 0.0039875 37.951641 0e+00 0.1427183 0.1599473
Biofilm 1 Rep 2 signal_SWV 0.1045085 0.0034865 29.975017 0e+00 0.0969763 0.1120407
Biofilm 1 Rep 3 signal_SWV 0.1203080 0.0079031 15.222956 0e+00 0.1032345 0.1373816
Biofilm 2 Rep 1 signal_SWV 0.2791415 0.0036863 75.723946 0e+00 0.2711777 0.2871052
Biofilm 2 Rep 2 signal_SWV 0.2125194 0.0077260 27.507105 0e+00 0.1958284 0.2292104
Biofilm 2 Rep 3 signal_SWV 0.2230086 0.0077181 28.894223 0e+00 0.2063346 0.2396825
Biofilm 1 Rep 1 (Intercept) 0.0000000 0.0000000 -14.499185 0e+00 0.0000000 0.0000000
Biofilm 1 Rep 2 (Intercept) 0.0000000 0.0000000 -10.551620 1e-07 0.0000000 0.0000000
Biofilm 1 Rep 3 (Intercept) -0.0000001 0.0000000 -9.616970 3e-07 -0.0000001 0.0000000
Biofilm 2 Rep 1 (Intercept) 0.0000000 0.0000000 -18.031183 0e+00 0.0000000 0.0000000
Biofilm 2 Rep 2 (Intercept) 0.0000000 0.0000000 -10.724706 1e-07 0.0000000 0.0000000
Biofilm 2 Rep 3 (Intercept) 0.0000000 0.0000000 -9.337288 4e-07 0.0000000 0.0000000


Fig. S6D - GC vs. [PYO]

Let’s import the blank IDA data. This data was processed from this notebook, and includes SWV and GC scans taken with a blank IDA in solutions of known concentrations of PYO.

Let’s read in the data and convert the µM units to \(mol / cm^3\), which will be important to calculate \(D_{ap}\) in correct units.

Here is the relationship between GC peak current and concentration:

\(I_{GC}\) is simply \(I = nFSDC\), so \(D_{ap}\) is:

\[D_{ap} = \frac{m}{n F S}\]

We can define a simple function to calculate this \(D_{ap}\) from the slope of the line in the above plot.

Fitting the linear model and calculating \(D_{ap}\) gives these values:

term estimate std.error statistic p.value conf.low conf.high dap dap_high dap_low dataset
C_mol_cm3 22.13434 0.1841017 120.2289 1.3e-06 21.54844 22.72023 6.9e-06 7.1e-06 6.7e-06 GC


Fig. S6E - SWV vs. [PYO]

Now we will look at the relationship between concentration and peak SWV current.

For a plot of \(I_{SWV}\) vs. \(C\), the slope can be defined in terms of the parameters for \(I_{SWV}\) other than concentration. This yields an expression for \(D_{ap}\):

\[D_{ap} = \pi t_p \left( \frac{m}{\psi n F A} \right) ^2 \]

So we’ll again define the function to calculate it:

The linear model of this data gives the following:

term estimate std.error statistic p.value conf.low conf.high dap dap_high dap_low dataset
C_mol_cm3 111.2799 1.590469 69.96673 6.4e-06 106.2183 116.3415 7e-06 7.7e-06 6.4e-06 SWV


Fig. S6F - SWV vs. GC

Finally, we will examine the peak SWV current vs. the peak GC current, which is not dependent on the known PYO concentrations.

Recall that for this type of data:

\[D_{ap} = \frac{1}{\pi t_p} \left( \frac{m A \psi}{S} \right) ^2\]

So, here’s a function that will calculate \(D_{ap}\) from the slope of this data:

And now, we’ll fit a linear model and calculate a \(D_{ap}\). We’ll go ahead and save a csv of this result for use in main figure 6F.

term estimate std.error statistic p.value conf.low conf.high dap dap_high dap_low dataset
signal_SWV 0.1987799 0.0033905 58.6286 1.09e-05 0.1879898 0.2095699 6.8e-06 7.6e-06 6.1e-06 SWVvsGC


Fig. S6G - \(D_{ap}\) estimates (Blank + PYO)

Now let’s compare the estimates from each subset of the data:

Fig. S6H - Nafion \(D_{ap}\) estimates

Create figure


## R version 3.5.3 (2019-03-11)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS  10.15.6
## 
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] viridis_0.5.1     viridisLite_0.3.0 modelr_0.1.5     
##  [4] broom_0.5.2       kableExtra_1.1.0  cowplot_0.9.4    
##  [7] forcats_0.4.0     stringr_1.4.0     dplyr_0.8.3      
## [10] purrr_0.3.3       readr_1.3.1       tidyr_1.0.0      
## [13] tibble_2.1.3      ggplot2_3.3.0     tidyverse_1.3.0  
## 
## loaded via a namespace (and not attached):
##  [1] tidyselect_0.2.5 xfun_0.7         splines_3.5.3    haven_2.2.0     
##  [5] lattice_0.20-38  colorspace_1.4-1 vctrs_0.3.1      generics_0.0.2  
##  [9] htmltools_0.4.0  mgcv_1.8-27      yaml_2.2.0       rlang_0.4.6     
## [13] pillar_1.4.2     glue_1.3.1       withr_2.1.2      DBI_1.0.0       
## [17] dbplyr_1.4.2     readxl_1.3.1     lifecycle_0.1.0  munsell_0.5.0   
## [21] gtable_0.3.0     cellranger_1.1.0 rvest_0.3.5      evaluate_0.14   
## [25] labeling_0.3     knitr_1.23       highr_0.8        Rcpp_1.0.2      
## [29] scales_1.0.0     backports_1.1.4  webshot_0.5.1    jsonlite_1.6    
## [33] fs_1.3.1         gridExtra_2.3    hms_0.5.3        digest_0.6.21   
## [37] stringi_1.4.3    grid_3.5.3       cli_1.1.0        tools_3.5.3     
## [41] magrittr_1.5     crayon_1.3.4     pkgconfig_2.0.3  Matrix_1.2-15   
## [45] xml2_1.2.2       reprex_0.3.0     lubridate_1.7.4  assertthat_0.2.1
## [49] rmarkdown_1.13   httr_1.4.1       rstudioapi_0.10  R6_2.4.0        
## [53] nlme_3.1-137     compiler_3.5.3