Panel A of figure 2 is isothermal titration calorimetry data that was analyzed outside of R.
Setup packages and plotting for the notebook:
# Check packages
source("../../tools/package_setup.R")
# Load packages
library(tidyverse)
library(cowplot)
library(kableExtra)
# Code display options
knitr::opts_chunk$set(tidy.opts=list(width.cutoff=60),tidy=FALSE, echo = TRUE, message=FALSE, warning=FALSE, fig.align="center", fig.retina = 2)
# Load plotting tools
source("../../tools/plotting_tools.R")
# Modify the plot theme
theme_set(theme_notebook())
Let’s read in the dnase dataset and look at the table:
dnase_extracts <- read_csv('../../../data/LC-MS/2018_10_08_HPLC_concentrations_df.csv',comment = "#") %>%
filter(Strain=='WT' & Day=='D4') %>%
group_by(Phenazine,Condition,Material) %>%
mutate(mean = ifelse(Replicate==1, mean(calcConc), NA))
dnase_extracts %>%
kable() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"), full_width = F) %>%
scroll_box(height = '250px')
Phenazine | Strain | Condition | Replicate | Material | Day | RT | Area | Channel Name | Amount | calcConc | mean |
---|---|---|---|---|---|---|---|---|---|---|---|
PYO | WT | DNase | 1 | cells | D4 | 5.952 | 78120 | 313.0nm | 2.523 | 72.32600 | 71.055111 |
PCA | WT | DNase | 1 | cells | D4 | 3.170 | 10966 | 364.0nm | 0.698 | 20.00933 | 17.601333 |
PCN | WT | DNase | 1 | cells | D4 | 8.799 | 283489 | 364.0nm | 19.744 | 565.99467 | 567.934444 |
PYO | WT | DNase | 1 | agar | D4 | 5.963 | 13770 | 313.0nm | 0.445 | 1.42400 | 1.163733 |
PCA | WT | DNase | 1 | agar | D4 | 3.066 | 42599 | 364.0nm | 2.712 | 8.67840 | 7.740800 |
PCN | WT | DNase | 1 | agar | D4 | 8.807 | 117981 | 364.0nm | 8.217 | 26.29440 | 24.491733 |
PYO | WT | DNase | 2 | agar | D4 | 5.967 | 9463 | 313.0nm | 0.306 | 0.97920 | NA |
PCA | WT | DNase | 2 | agar | D4 | 3.065 | 34587 | 364.0nm | 2.202 | 7.04640 | NA |
PCN | WT | DNase | 2 | agar | D4 | 8.812 | 100344 | 364.0nm | 6.989 | 22.36480 | NA |
PYO | WT | DNase | 3 | agar | D4 | 5.964 | 10533 | 313.0nm | 0.340 | 1.08800 | NA |
PCA | WT | DNase | 3 | agar | D4 | 3.105 | 36801 | 364.0nm | 2.343 | 7.49760 | NA |
PCN | WT | DNase | 3 | agar | D4 | 8.803 | 111355 | 364.0nm | 7.755 | 24.81600 | NA |
PYO | WT | none | 1 | agar | D4 | 5.971 | 15508 | 313.0nm | 0.501 | 1.60320 | 1.349333 |
PCA | WT | none | 1 | agar | D4 | 3.054 | 43066 | 364.0nm | 2.742 | 8.77440 | 8.238933 |
PCN | WT | none | 1 | agar | D4 | 8.815 | 75035 | 364.0nm | 5.226 | 16.72320 | 22.126933 |
PYO | WT | none | 2 | agar | D4 | 5.968 | 12382 | 313.0nm | 0.400 | 1.28000 | NA |
PCA | WT | none | 2 | agar | D4 | 3.060 | 40419 | 364.0nm | 2.573 | 8.23360 | NA |
PCN | WT | none | 2 | agar | D4 | 8.814 | 101441 | 364.0nm | 7.065 | 22.60800 | NA |
PYO | WT | none | 3 | agar | D4 | 5.964 | 11287 | 313.0nm | 0.364 | 1.16480 | NA |
PCA | WT | none | 3 | agar | D4 | 3.059 | 37847 | 364.0nm | 2.409 | 7.70880 | NA |
PCN | WT | none | 3 | agar | D4 | 8.811 | 121366 | 364.0nm | 8.453 | 27.04960 | NA |
PYO | WT | DNase | 2 | cells | D4 | 5.942 | 75064 | 313.0nm | 2.424 | 69.48800 | NA |
PCA | WT | DNase | 2 | cells | D4 | 3.132 | 9362 | 364.0nm | 0.596 | 17.08533 | NA |
PCN | WT | DNase | 2 | cells | D4 | 8.789 | 285936 | 364.0nm | 19.915 | 570.89667 | NA |
PYO | WT | DNase | 3 | cells | D4 | 5.949 | 77070 | 313.0nm | 2.489 | 71.35133 | NA |
PCA | WT | DNase | 3 | cells | D4 | 3.119 | 8611 | 364.0nm | 0.548 | 15.70933 | NA |
PCN | WT | DNase | 3 | cells | D4 | 8.797 | 283951 | 364.0nm | 19.776 | 566.91200 | NA |
PYO | WT | none | 1 | cells | D4 | 5.957 | 102908 | 313.0nm | 3.323 | 95.25933 | 88.847556 |
PCA | WT | none | 1 | cells | D4 | 3.113 | 13782 | 364.0nm | 0.877 | 25.14067 | 20.324667 |
PCN | WT | none | 1 | cells | D4 | 8.804 | 306236 | 364.0nm | 21.328 | 611.40267 | 614.231111 |
PYO | WT | none | 2 | cells | D4 | 5.946 | 98479 | 313.0nm | 3.180 | 91.16000 | NA |
PCA | WT | none | 2 | cells | D4 | 3.100 | 9417 | 364.0nm | 0.599 | 17.17133 | NA |
PCN | WT | none | 2 | cells | D4 | 8.792 | 301514 | 364.0nm | 20.999 | 601.97133 | NA |
PYO | WT | none | 3 | cells | D4 | 5.931 | 86539 | 313.0nm | 2.795 | 80.12333 | NA |
PCA | WT | none | 3 | cells | D4 | 3.092 | 10222 | 364.0nm | 0.651 | 18.66200 | NA |
PCN | WT | none | 3 | cells | D4 | 8.778 | 315202 | 364.0nm | 21.953 | 629.31933 | NA |
Now, let’s look at an overview of the experiment.
ggplot(dnase_extracts ,aes(x=Condition,y=calcConc))+
geom_col( aes(y = mean), fill = 'light gray') +
geom_jitter(width=0.1,height=0,shape=21,size=1)+
facet_wrap(Material~Phenazine,scales='free')
And let’s do a statistical test to compare the DNase +/- treatments.
First, a t-test for whether or not agar with DNase concentrations were higher than the ‘none’ treatment:
dnase_extracts %>%
spread(Condition,calcConc) %>%
filter(Material=='agar') %>%
group_by(Material,Phenazine) %>%
summarise(conf_int_low = t.test( DNase,none, alternative = 'greater')$conf.int[1],
conf_int_high = t.test( DNase,none, alternative = 'greater')$conf.int[2],
p_value = t.test( DNase,none, alternative = 'greater')$p.value)
## # A tibble: 3 x 5
## # Groups: Material [1]
## Material Phenazine conf_int_low conf_int_high p_value
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 agar PCA -1.79 Inf 0.778
## 2 agar PCN -5.71 Inf 0.261
## 3 agar PYO -0.585 Inf 0.811
There are no significant differences p<0.05.
Second, a t-test for whether or not biofilm (aka cell) with DNase concentrations were lower than the ‘none’ treatment
dnase_extracts %>%
spread(Condition,calcConc) %>%
filter(Material=='cells') %>%
group_by(Material,Phenazine) %>%
summarise(conf_int_low = t.test( DNase, none, alternative = 'less')$conf.int[1],
conf_int_high = t.test(DNase, none, alternative = 'less')$conf.int[2],
p_value = t.test( DNase, none, alternative = 'less')$p.value)
## # A tibble: 3 x 5
## # Groups: Material [1]
## Material Phenazine conf_int_low conf_int_high p_value
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 cells PCA -Inf 3.76 0.198
## 2 cells PCN -Inf -23.5 0.0127
## 3 cells PYO -Inf -4.94 0.0273
There is a significant difference for PYO and PCN.
Here you can see that the agar concentrations between the Dnase treated and untreated don’t differ meaningfully, but the cell/biofilm concentrations might. This might be because for this experiment the colonies were transferred to a fresh agar plate for only 24hrs as opposed to staying on the same plate for 4 days as with the pel experiment. So, let’s ignore the agar concentrations for now. It’s also important to note that by calculating a ratio as we did above for pel we do risk amplifying meaningless differences by dividing large numbers by small numbers.
Here’s the biofilm only:
# Plot layout
dnase_plot <- ggplot(dnase_extracts %>% filter(Material=='cells') ,aes(x=Condition,y=calcConc))+
geom_col( aes(y = mean), fill = 'light gray') +
geom_jitter(width=0.1,height=0,shape=21,size=1)+
facet_wrap(~Phenazine,scales='free')
# Plot styling
dnase_plot_styled <- dnase_plot +
labs(x=NULL, y=expression("Biofilm concentration" ~ (mu*M ))) +
scale_x_discrete(limits = c("none",'DNase')) +
guides(fill = F)+
theme(axis.text.x = element_text(angle = 45, hjust = 1))
dnase_plot_styled
Let’s read in and look at the table of pel data.
pel_extracts <- read_csv('../../../data/LC-MS/2018_10_30_HPLC_concentrations_df.csv',comment = "#") %>%
filter(strain %in% c('WTpar','dPel'))
pel_extracts %>%
kable() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"), full_width = F) %>%
scroll_box(height = '250px')
measured_phenazine | strain | amount_added | added_phenazine | material | replicate | RT | Area | Channel Name | Amount | calcConc |
---|---|---|---|---|---|---|---|---|---|---|
PCA | dPel | NA | NA | agar | 1 | 3.060 | 114063 | 364.0nm | 7.487 | 23.95840 |
PCN | dPel | NA | NA | agar | 1 | 8.858 | 303178 | 364.0nm | 19.998 | 63.99360 |
PYO | dPel | NA | NA | agar | 1 | 6.007 | 24774 | 313.0nm | 0.762 | 2.43840 |
PCA | dPel | NA | NA | agar | 2 | 3.056 | 99389 | 364.0nm | 6.524 | 20.87680 |
PCN | dPel | NA | NA | agar | 2 | 8.870 | 229828 | 364.0nm | 15.160 | 48.51200 |
PYO | dPel | NA | NA | agar | 2 | 6.014 | 23647 | 313.0nm | 0.727 | 2.32640 |
PCA | dPel | NA | NA | agar | 3 | 3.055 | 104913 | 364.0nm | 6.887 | 22.03840 |
PCN | dPel | NA | NA | agar | 3 | 8.861 | 217660 | 364.0nm | 14.357 | 45.94240 |
PYO | dPel | NA | NA | agar | 3 | 6.005 | 25757 | 313.0nm | 0.792 | 2.53440 |
PCA | dPel | NA | NA | cells | 1 | 3.181 | 8470 | 364.0nm | 0.556 | 15.93867 |
PCN | dPel | NA | NA | cells | 1 | 8.852 | 185244 | 364.0nm | 12.219 | 350.27800 |
PYO | dPel | NA | NA | cells | 1 | 6.009 | 113480 | 313.0nm | 3.491 | 100.07533 |
PCA | dPel | NA | NA | cells | 2 | 3.186 | 10494 | 364.0nm | 0.689 | 19.75133 |
PCN | dPel | NA | NA | cells | 2 | 8.850 | 179462 | 364.0nm | 11.838 | 339.35600 |
PYO | dPel | NA | NA | cells | 2 | 6.005 | 117862 | 313.0nm | 3.625 | 103.91667 |
PCA | dPel | NA | NA | cells | 3 | 3.197 | 11134 | 364.0nm | 0.731 | 20.95533 |
PCN | dPel | NA | NA | cells | 3 | 8.840 | 201283 | 364.0nm | 13.277 | 380.60733 |
PYO | dPel | NA | NA | cells | 3 | 5.993 | 124770 | 313.0nm | 3.838 | 110.02267 |
PCA | WTpar | NA | NA | cells | 1 | 3.234 | 10524 | 364.0nm | 0.691 | 19.80867 |
PCN | WTpar | NA | NA | cells | 1 | 8.840 | 227724 | 364.0nm | 15.021 | 430.60200 |
PYO | WTpar | NA | NA | cells | 1 | 5.995 | 86700 | 313.0nm | 2.667 | 76.45400 |
PCA | WTpar | NA | NA | cells | 2 | 3.222 | 11003 | 364.0nm | 0.722 | 20.69733 |
PCN | WTpar | NA | NA | cells | 2 | 8.851 | 206671 | 364.0nm | 13.632 | 390.78400 |
PYO | WTpar | NA | NA | cells | 2 | 6.005 | 84758 | 313.0nm | 2.607 | 74.73400 |
PCA | WTpar | NA | NA | cells | 3 | 3.178 | 5777 | 364.0nm | 0.379 | 10.86467 |
PCN | WTpar | NA | NA | cells | 3 | 8.840 | 220629 | 364.0nm | 14.553 | 417.18600 |
PYO | WTpar | NA | NA | cells | 3 | 5.995 | 88787 | 313.0nm | 2.731 | 78.28867 |
PCA | WTpar | NA | NA | agar | 1 | 3.056 | 124641 | 364.0nm | 8.182 | 26.18240 |
PCN | WTpar | NA | NA | agar | 1 | 8.855 | 393800 | 364.0nm | 25.976 | 83.12320 |
PYO | WTpar | NA | NA | agar | 1 | 6.008 | 25687 | 313.0nm | 0.790 | 2.52800 |
PCA | WTpar | NA | NA | agar | 2 | 3.043 | 135302 | 364.0nm | 8.882 | 28.42240 |
PCN | WTpar | NA | NA | agar | 2 | 8.861 | 435638 | 364.0nm | 28.736 | 91.95520 |
PYO | WTpar | NA | NA | agar | 2 | 6.009 | 27091 | 313.0nm | 0.833 | 2.66560 |
PCA | WTpar | NA | NA | agar | 3 | 3.040 | 122418 | 364.0nm | 8.036 | 25.71520 |
PCN | WTpar | NA | NA | agar | 3 | 8.854 | 387178 | 364.0nm | 25.539 | 81.72480 |
PYO | WTpar | NA | NA | agar | 3 | 6.003 | 24705 | 313.0nm | 0.760 | 2.43200 |
Ok, now let’s plot an overview of the dataset.
pel_extracts_means <- pel_extracts %>%
group_by(material, measured_phenazine, strain) %>%
mutate(mean = ifelse(replicate==1, mean(calcConc), NA))
ggplot(pel_extracts_means ,aes(x=strain,y=calcConc))+
geom_col( aes(y = mean), fill = 'light gray') +
geom_jitter(width=0.1,height=0,shape=21,size=2)+
facet_wrap(material~measured_phenazine,scales='free')+
scale_x_discrete(breaks = c('dPel','WTpar'), labels=c(expression(Delta*"pel"),"WT")) +
labs(x='Strain',y=expression("Biofilm concentration" ~ (mu*M )) ) +
guides(fill=F)
You can see that for each phenazine the concentration differs between the strains for both the cells aka biofilm and the agar.
And let’s perform the t-test on whether or not ∆pel concentrations are different than WT concentrations.
pel_extracts %>%
spread(strain,calcConc) %>%
group_by( material ,measured_phenazine) %>%
summarise(conf_int_low = t.test(dPel, WTpar, alternative = 'two.sided')$conf.int[1],
conf_int_high = t.test(dPel,WTpar, alternative = 'two.sided')$conf.int[2],
p_value = t.test( dPel,WTpar, alternative = 'two.sided')$p.value)
## # A tibble: 6 x 5
## # Groups: material [2]
## material measured_phenazine conf_int_low conf_int_high p_value
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 agar PCA -7.90 -1.07 0.0219
## 2 agar PCN -52.8 -12.8 0.0131
## 3 agar PYO -0.362 0.144 0.297
## 4 cells PCA -9.60 13.1 0.650
## 5 cells PCN -103. -8.85 0.0301
## 6 cells PYO 17.2 39.2 0.00553
Both the agar and biofilm concentrations for PYO and PCN are statistically significantly different in ∆pel vs. WT strains.
Let’s calculate the retention ratio.
# Split dataset by material
pel_extracts_means_agar <- pel_extracts_means %>%
filter(material=='agar')
pel_extracts_means_biofilm <- pel_extracts_means %>%
filter(material=='cells')
# Join agar and cell observations and calculate retention ratios = biofilm / agar
pel_extracts_means_join <- left_join(pel_extracts_means_biofilm,
pel_extracts_means_agar,
by=c('strain','replicate','measured_phenazine'),
suffix = c('_from_biofilm','_from_agar')
) %>%
mutate(retention_ratio = calcConc_from_biofilm / calcConc_from_agar) %>%
mutate(mean_retention_ratio = mean_from_biofilm / mean_from_agar)
# Plot Layout
plot_pel <- ggplot(pel_extracts_means_join ,aes(x=strain,y=retention_ratio))+
geom_col( aes(y = mean_retention_ratio), fill = 'light gray') +
geom_jitter(width=0.1,height=0,shape=21,size=1)+
facet_wrap(~measured_phenazine,scales='free')
# Styling
plot_pel_styled <- plot_pel +
scale_x_discrete(breaks = c('WTpar','dPel'),
labels=c("WT",expression(Delta*"pel")),
limits = c('WTpar','dPel')) +
scale_y_continuous(labels = fold_label)+
labs(x=NULL, y = '[Biofilm] / [Agar]') +
guides(fill=F) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
plot_pel_styled
And let’s perform the t-test on whether or not ∆pel ratios are greater than WT ratios.
pel_extracts_means_join %>%
spread(strain,retention_ratio) %>%
group_by(measured_phenazine) %>%
summarise(conf_int_low = t.test(dPel, WTpar, alternative = 'greater')$conf.int[1],
conf_int_high = t.test(dPel,WTpar, alternative = 'greater')$conf.int[2],
p_value = t.test( dPel,WTpar, alternative = 'greater')$p.value)
## # A tibble: 3 x 4
## measured_phenazine conf_int_low conf_int_high p_value
## <chr> <dbl> <dbl> <dbl>
## 1 PCA -0.0872 Inf 0.101
## 2 PCN -0.128 Inf 0.0561
## 3 PYO 9.45 Inf 0.000692
There is a statistically significant difference for PYO.
Let’s read in the data and calculate the concentrations.
df_dphz_2 <- read_csv("../../../data/LC-MS/2019_07_23_colony_HPLC_dPHZ_data_2.csv")
df_dphz_2 <- df_dphz_2 %>%
mutate(condition_conc = fct_relevel(condition_conc, c('0uM','10uM','100uM','200uM','500uM'))) %>%
mutate(condition = fct_relevel(condition, c('PBS','etbr','dmso','pi')))
df_dphz_conc <- df_dphz_2 %>%
filter(added_phz == measured_phz) %>%
mutate(measured_phz_conc = case_when(
material == 'cells' ~ (Amount * 2) * (800 / 60),
material == 'agar' ~ (Amount * 2) * (8 / 5)
)) %>%
group_by(measured_phz, strain, condition, condition_conc) %>%
mutate(mean_phz_conc = mean(measured_phz_conc))
And let’s plot:
plot_dphz_etbr <- ggplot(df_dphz_conc %>% filter(condition %in% c('etbr','PBS')),
aes(x = condition_conc, y = measured_phz_conc)) +
geom_col(data = df_dphz_conc %>% filter(condition %in% c('etbr','PBS') & rep ==1),
aes(x = condition_conc, y = mean_phz_conc), fill = 'light gray') +
geom_point(shape = 21, size = 1) + facet_wrap(~measured_phz, scales = 'free') + ylim(0, NA) +
labs(x = expression('EtBr added to agar'~(mu*M)), y = expression('Biofilm phz concentration'~(mu*M)))+
scale_x_discrete(labels = c(0, 10, 100, 500)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
plot_dphz_etbr
Let’s read in the standards, biofilm and metadata:
df_stds <- read_csv("../../../data/Spectroscopy/2019_11_22_std_preCTdna.csv") %>% gather(key = "well", value = "FluorInt", -wavelength) %>% mutate(read = 1)
df_biofilms <- read_csv("../../../data/Spectroscopy/2019_11_22_std_wt_dphz_postCTdna.csv") %>% gather(key = "well", value = "FluorInt", -wavelength) %>% mutate(read = 2)
df_meta <- read_csv("../../../data/Spectroscopy/2019_11_22_well_metadata.csv")
df_toto <- left_join(bind_rows(df_stds, df_biofilms), df_meta, by = c('well')) %>% filter(wavelength == 535) %>% filter(!(strain == 'std' & read == 2))
df_toto %>% kable() %>% kable_styling(bootstrap_options = 'condensed') %>%
scroll_box(width = "100%", height = "400px")
wavelength | well | FluorInt | read | strain | toto_added | ctDNA_added | well_std_conc | bio_rep | tech_rep |
---|---|---|---|---|---|---|---|---|---|
535 | A1 | 55732 | 1 | std | TRUE | TRUE | 50.0000000 | 1 | 1 |
535 | A2 | 57010 | 1 | std | TRUE | TRUE | 25.0000000 | 1 | 1 |
535 | A3 | 52506 | 1 | std | TRUE | TRUE | 12.5000000 | 1 | 1 |
535 | A4 | 43673 | 1 | std | TRUE | TRUE | 6.2500000 | 1 | 1 |
535 | A5 | 29038 | 1 | std | TRUE | TRUE | 3.1250000 | 1 | 1 |
535 | A6 | 19617 | 1 | std | TRUE | TRUE | 1.5625000 | 1 | 1 |
535 | A7 | 11332 | 1 | std | TRUE | TRUE | 0.7812500 | 1 | 1 |
535 | A8 | 5564 | 1 | std | TRUE | TRUE | 0.3906250 | 1 | 1 |
535 | A9 | 2778 | 1 | std | TRUE | TRUE | 0.1953125 | 1 | 1 |
535 | A10 | 1406 | 1 | std | TRUE | TRUE | 0.0976562 | 1 | 1 |
535 | A11 | 682 | 1 | std | TRUE | TRUE | 0.0488281 | 1 | 1 |
535 | A12 | 774 | 1 | std | TRUE | TRUE | 0.0244141 | 1 | 1 |
535 | B1 | 12139 | 2 | WT | TRUE | TRUE | NA | 1 | 1 |
535 | B2 | 13446 | 2 | WT | TRUE | TRUE | NA | 2 | 1 |
535 | B3 | 11074 | 2 | WT | TRUE | TRUE | NA | 3 | 1 |
535 | B4 | 11370 | 2 | WT | TRUE | TRUE | NA | 4 | 1 |
535 | B5 | 12068 | 2 | WT | TRUE | TRUE | NA | 5 | 1 |
535 | B6 | 11855 | 2 | WT | TRUE | TRUE | NA | 6 | 1 |
535 | B7 | 10123 | 2 | WT | TRUE | FALSE | NA | 1 | 2 |
535 | B8 | 11827 | 2 | WT | TRUE | FALSE | NA | 2 | 2 |
535 | B9 | 9761 | 2 | WT | TRUE | FALSE | NA | 3 | 2 |
535 | B10 | 10182 | 2 | WT | TRUE | FALSE | NA | 4 | 2 |
535 | B11 | 9634 | 2 | WT | TRUE | FALSE | NA | 5 | 2 |
535 | B12 | 11566 | 2 | WT | TRUE | FALSE | NA | 6 | 2 |
535 | C1 | 10915 | 2 | WT | TRUE | FALSE | NA | 1 | 3 |
535 | C2 | 10894 | 2 | WT | TRUE | FALSE | NA | 2 | 3 |
535 | C3 | 9651 | 2 | WT | TRUE | FALSE | NA | 3 | 3 |
535 | C4 | 10147 | 2 | WT | TRUE | FALSE | NA | 4 | 3 |
535 | C5 | 11910 | 2 | WT | TRUE | FALSE | NA | 5 | 3 |
535 | C6 | 12036 | 2 | WT | TRUE | FALSE | NA | 6 | 3 |
535 | C7 | 130 | 2 | WT | FALSE | FALSE | NA | 1 | 4 |
535 | C8 | 190 | 2 | WT | FALSE | FALSE | NA | 2 | 4 |
535 | C9 | 119 | 2 | WT | FALSE | FALSE | NA | 3 | 4 |
535 | C10 | 124 | 2 | WT | FALSE | FALSE | NA | 4 | 4 |
535 | C11 | 144 | 2 | WT | FALSE | FALSE | NA | 5 | 4 |
535 | C12 | 138 | 2 | WT | FALSE | FALSE | NA | 6 | 4 |
535 | E1 | 23490 | 2 | dPHZ | TRUE | TRUE | NA | 1 | 1 |
535 | E2 | 22622 | 2 | dPHZ | TRUE | TRUE | NA | 2 | 1 |
535 | E3 | 24901 | 2 | dPHZ | TRUE | TRUE | NA | 3 | 1 |
535 | E4 | 14964 | 2 | dPHZ | TRUE | TRUE | NA | 4 | 1 |
535 | E5 | 19109 | 2 | dPHZ | TRUE | TRUE | NA | 5 | 1 |
535 | E6 | 14650 | 2 | dPHZ | TRUE | TRUE | NA | 6 | 1 |
535 | F1 | 22498 | 2 | dPHZ | TRUE | FALSE | NA | 1 | 2 |
535 | F2 | 13008 | 2 | dPHZ | TRUE | FALSE | NA | 2 | 2 |
535 | F3 | 15141 | 2 | dPHZ | TRUE | FALSE | NA | 3 | 2 |
535 | F4 | 18463 | 2 | dPHZ | TRUE | FALSE | NA | 4 | 2 |
535 | F5 | 14572 | 2 | dPHZ | TRUE | FALSE | NA | 5 | 2 |
535 | F6 | 17939 | 2 | dPHZ | TRUE | FALSE | NA | 6 | 2 |
535 | G1 | 25159 | 2 | dPHZ | TRUE | FALSE | NA | 1 | 3 |
535 | G2 | 12442 | 2 | dPHZ | TRUE | FALSE | NA | 2 | 3 |
535 | G3 | 14663 | 2 | dPHZ | TRUE | FALSE | NA | 3 | 3 |
535 | G4 | 15324 | 2 | dPHZ | TRUE | FALSE | NA | 4 | 3 |
535 | G5 | 13968 | 2 | dPHZ | TRUE | FALSE | NA | 5 | 3 |
535 | G6 | 16661 | 2 | dPHZ | TRUE | FALSE | NA | 6 | 3 |
535 | H1 | 235 | 2 | dPHZ | FALSE | FALSE | NA | 1 | 4 |
535 | H2 | 164 | 2 | dPHZ | FALSE | FALSE | NA | 2 | 4 |
535 | H3 | 500 | 2 | dPHZ | FALSE | FALSE | NA | 3 | 4 |
535 | H4 | 191 | 2 | dPHZ | FALSE | FALSE | NA | 4 | 4 |
535 | H5 | 208 | 2 | dPHZ | FALSE | FALSE | NA | 5 | 4 |
535 | H6 | 221 | 2 | dPHZ | FALSE | FALSE | NA | 6 | 4 |
Now we can make the plot:
std_levels <- df_toto %>% filter(strain == 'std') %>% filter(FluorInt <30000 & FluorInt >5000) %>%
mutate(eDNA_ug_mL = well_std_conc * 4 * 800 / 60) %>%
mutate(eDNA_dsDNA_uM = eDNA_ug_mL * 150 / 50) %>%
mutate(labels = paste(eDNA_dsDNA_uM, 'mu*M', sep = '~'))
bio_reps <- df_toto %>% filter(strain %in% c('WT','dPHZ') & ctDNA_added == FALSE & toto_added == T) %>%
group_by(strain, bio_rep) %>%
summarise(mean = mean(FluorInt), sd = sd(FluorInt))
plot_toto <- ggplot(bio_reps, aes(x = strain, y = mean)) +
geom_hline(yintercept = std_levels$FluorInt, linetype = 2, color = 'light gray', label = labels)+
geom_pointrange(aes(ymin = mean - sd, ymax = mean + sd), position = position_jitter(width = 0.15, height = 0), size = 0.1) +
geom_text(data = std_levels, aes(x = c(2.5,2.5,2.5,2.5), y = FluorInt - 1000, label = labels),parse = T, color = 'light gray', size = (6 * 5 / 14))+
ylim(0,NA)
plot_toto_styled <- plot_toto +
labs(x = NULL, y = 'TOTO-1 Fluorescence (A.U.)') +
scale_x_discrete(breaks = c('dPHZ','WT'),
labels=c(expression(Delta*"phz*"), 'WT')) +
theme(axis.text.x = element_text(angle = 45, hjust = 1), axis.text.y = element_text(angle = 45, hjust = 1))
plot_toto_styled
Let’s put everything together:
theme_set(theme_figure())
top_panels <- plot_grid(dnase_plot_styled, plot_pel_styled, ncol = 2, labels = c('B','C'), scale = 0.95,
label_size = 12, align = 'hv', axis = 'tblr')
bottom_panels <- plot_grid(plot_dphz_etbr, plot_toto_styled, ncol = 2, labels = c('D','E'),
scale = 0.95, label_size = 12, align = 'hv', axis = 'lr')
all_right_panels <- plot_grid(top_panels, bottom_panels, ncol = 1, scale = 1.0, align = 'hv', axis = 'tblr')
fig_2 <- plot_grid(NULL, all_right_panels, ncol = 2, rel_widths = c(0.5, 1), labels = c('A',''), label_size = 12)
fig_2
## 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] lubridate_1.7.4 hms_0.5.3 modelr_0.1.5
## [4] broom_0.5.2 kableExtra_1.1.0 cowplot_0.9.4
## [7] viridis_0.5.1 viridisLite_0.3.0 knitr_1.23
## [10] forcats_0.4.0 stringr_1.4.0 dplyr_0.8.3
## [13] purrr_0.3.3 readr_1.3.1 tidyr_1.0.0
## [16] 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 haven_2.2.0 lattice_0.20-38
## [5] colorspace_1.4-1 vctrs_0.3.1 generics_0.0.2 htmltools_0.4.0
## [9] yaml_2.2.0 utf8_1.1.4 rlang_0.4.6 pillar_1.4.2
## [13] glue_1.3.1 withr_2.1.2 DBI_1.0.0 dbplyr_1.4.2
## [17] readxl_1.3.1 lifecycle_0.1.0 munsell_0.5.0 gtable_0.3.0
## [21] cellranger_1.1.0 rvest_0.3.5 evaluate_0.14 labeling_0.3
## [25] fansi_0.4.0 highr_0.8 Rcpp_1.0.2 scales_1.0.0
## [29] backports_1.1.4 webshot_0.5.1 jsonlite_1.6 fs_1.3.1
## [33] gridExtra_2.3 digest_0.6.21 stringi_1.4.3 grid_3.5.3
## [37] cli_1.1.0 tools_3.5.3 magrittr_1.5 crayon_1.3.4
## [41] pkgconfig_2.0.3 ellipsis_0.3.0 xml2_1.2.2 reprex_0.3.0
## [45] assertthat_0.2.1 rmarkdown_1.13 httr_1.4.1 rstudioapi_0.10
## [49] R6_2.4.0 nlme_3.1-137 compiler_3.5.3