HNOBac Manuscript
  1. Methods
  2. Cell Counts & TEER
  • Introduction
  • Methods
    • RNASeq
    • Cell Counts & TEER
    • CFUs 48h
    • CFUs Epithelial Lines
    • LDH 48h
    • LDH Epithelial Lines
    • Cytokines
    • HEK-Blue
  • R Session Info

Table of contents

  • File Paths
  • Cells per HNO well
    • Plot
    • Saving files
  • Cells per Cell Line for Calu-3 and RPMI2650
    • Plot
    • Saving files
  • Multiplicity of Colonization (HNOs)
    • Saving files
  • TEER
    • Saving files

Cell Counts & TEER

library(tidyverse)
library(scales)
library(ggtext)
library(readxl)

File Paths

# Folder paths
MOC_input_path <- "data/input_data/MOC_TEER"
CFUs_input_path <- "data/dataframes"

# Create subfolders for output files
dataframes_folder <- "data/dataframes"
if (!file.exists("data/dataframes")) {
  dir.create("data/dataframes", recursive = TRUE)
}
outputs_folder <- "data/outputs/MOC_TEER"
if (!file.exists("data/outputs/MOC_TEER")) {
  dir.create("data/outputs/MOC_TEER", recursive = TRUE)
}

# Load data 
HNOCells <- read.csv(file.path(MOC_input_path, "MOC_HNOBac_2024.csv")) 
CellLines <- read_excel(file.path(MOC_input_path, "HNObac_Calu3RPMI_MOC_TEER.xlsx"))

HNOTEER <- read_excel(file.path(MOC_input_path, "HNObac_TEER.xlsx"))

CFUs <- read_rds(file.path(CFUs_input_path, "CFU_values.rds"))
CFUs_6h <- read_rds(file.path(CFUs_input_path, "CFU_values_6h.rds"))

Cells per HNO well

HNOCells$Date <- as.factor(HNOCells$Date)
HNOCells$Line <- as.factor(HNOCells$Line)
HNOCells <- HNOCells  %>%
  mutate(Line = factor(Line, levels = c("HNO918", "HNO204", "HNO919"))) 
#summaries by line
HNOCells_summary <- HNOCells %>%
  group_by(Line) %>%
  summarize(median_cells = median(Cells_HNO),
            Q1 = quantile(Cells_HNO, 0.25),
            Q3 = quantile(Cells_HNO, 0.75),
            n = n(),
            SE = sd(Cells_HNO)/sqrt(n),
            CI = SE*1.96,
            mean_cells = mean(Cells_HNO))

#summary of all lines together
HNOall_summary <- HNOCells %>%
  summarize(median_cells = median(Cells_HNO),
            Q1 = quantile(Cells_HNO, 0.25),
            Q3 = quantile(Cells_HNO, 0.75),
            n = n(),
            SE = sd(Cells_HNO)/sqrt(n),
            CI = SE*1.96,
            mean_cells = mean(Cells_HNO))

Plot

boxplot_HNOCells <- ggplot() +
  geom_boxplot(data = HNOCells, aes(x = Line, y = Cells_HNO), outliers = F) +
  
  geom_jitter(data = HNOCells, aes(x = Line, y = Cells_HNO, shape = Line), 
             fill = "#5b5b5b", color = "#5b5b5b", size = 3, width = 0.15, alpha = 0.75) +
  
  scale_shape_manual(values = c(21, 22, 24)) +
  scale_y_log10(limits = c(100000, 10000000),
                labels = trans_format("log10", math_format(10^.x))) +
  labs(x = "HNO Line",
       y = "HNO Cells/Well") +
  theme_bw() +
  theme(panel.grid = element_blank(),
        text = element_text(size = 20), 
        axis.text.x = element_text(color = "black"),
        axis.text.y = element_text(color = "black"))
boxplot_HNOCells

Saving files

ggsave(boxplot_HNOCells, filename = paste0(outputs_folder, "/boxplot_Cells_HNO.png"), width = 12, height = 10)
saveRDS(boxplot_HNOCells, file.path(outputs_folder, paste0("boxplot_Cells_HNO.rds")))
# Save data frames as CSV files in the metadata folder
write_csv(HNOCells, file.path(dataframes_folder, "Cells_HNO_values.csv"))

# Save data frames as R objects in the metadata folder
saveRDS(HNOCells, file.path(dataframes_folder, "Cells_HNO_values.rds"))

# Use this to read the final objects
HNOCells <- readRDS("data/dataframes/Cells_HNO_values.rds")

Cells per Cell Line for Calu-3 and RPMI2650

#factor date and name of the cell line
CellLines$Date <- as.factor(CellLines$Date)
CellLines$Model <- as.factor(CellLines$Model)
#summary of each cell line
CellLines_summary <- CellLines %>%
  group_by(Model) %>%
  summarize(median_cells = median(Cells),
            Q1 = quantile(Cells, 0.25),
            Q3 = quantile(Cells, 0.75),
            n = n(),
            SE = sd(Cells)/sqrt(n),
            CI = SE*1.96, 
            mean_cells = mean(Cells))

Plot

boxplot_CellLines <- ggplot() +
  geom_boxplot(data = CellLines, aes(x = Model, y = Cells)) +
  
  geom_jitter(data = CellLines, aes(x = Model, y = Cells, shape = Model), 
             fill = "#5b5b5b", color = "#5b5b5b", size = 3, width = 0.15, alpha = 0.75) +
  
  scale_shape_manual(values = c(21, 22, 24)) +
  scale_y_log10(limits = c(100000, 10000000),
                labels = trans_format("log10", math_format(10^.x))) +
  labs(x = "Cell Line",
       y = "Cells/Well") +
  theme_bw() +
  theme(panel.grid = element_blank(),
        text = element_text(size = 20), 
        axis.text.x = element_text(color = "black"),
        axis.text.y = element_text(color = "black"))

boxplot_CellLines

Saving files

ggsave(boxplot_CellLines, filename = paste0(outputs_folder, "/boxplot_CellLines_HNO.png"), width = 12, height = 10)
saveRDS(boxplot_CellLines, file.path(outputs_folder, paste0("boxplot_CellLines_HNO.rds")))
# Save data frames as CSV files in the metadata folder
write_csv(CellLines, file.path(dataframes_folder, "Cells_CellLines_values.csv"))

# Save data frames as R objects in the metadata folder
saveRDS(CellLines, file.path(dataframes_folder, "Cells_CellLines_values.rds"))

# Use this to read the final objects
CellLines <- readRDS("data/dataframes/Cells_CellLines_values.rds")

Multiplicity of Colonization (HNOs)

Inoc_CFUs <- CFUs %>%
  filter(Time == "0") %>%
  select(Date, Line, bacteria, Temp, NewCFU) %>%
  distinct(Date, Line, bacteria, NewCFU, .keep_all = TRUE)

Inoc_CFUs_6h <- CFUs_6h %>%
  filter(Time == "0") %>%
  filter(Model == "HNO") %>%
  select(Date, Line, bacteria, Temp, NewCFU)

Inoc <- rbind(Inoc_CFUs, Inoc_CFUs_6h)
CFU_Inoculum <- Inoc %>%
  group_by(Line, bacteria) %>%
  summarize(median_CFUs = median(NewCFU))

MOC_Calcs <- left_join(CFU_Inoculum, HNOCells_summary %>% select(Line, median_cells), by = "Line")

MOC_Calcs <- MOC_Calcs %>%
  mutate(MOC = (median_CFUs/median_cells)) %>%
  group_by(bacteria) %>%
  mutate(avg_MOC = (mean(MOC)))

Saving files

# Save data frames as CSV files in the outputs folder
write_csv(MOC_Calcs, file.path(outputs_folder, "MOC_HNOs.csv"))

TEER

#factor line and date
HNOTEER$Date <- as.factor(HNOTEER$Date)
HNOTEER$Line <- as.factor(HNOTEER$Line)
#create levels for line to order the HNO lines
HNOTEER <- HNOTEER  %>%
  mutate(Line = factor(Line, levels = c("HNO918", "HNO204", "HNO919"))) 
#average the technical replicates together
TEERavg <- HNOTEER %>%
  group_by(Date,Line,LineCharacter,Assay,WithCellHNO) %>%
  summarise(avgTEER = mean(TEER))

#calculate the median and mean for TEER of HNOs
HNOteer_summary <-  TEERavg %>%
  group_by(Line) %>%
  summarize(median_TEER = median(avgTEER),
            Q1 = quantile(avgTEER, 0.25),
            Q3 = quantile(avgTEER, 0.75),
            n = n(),
            SE = sd(avgTEER)/sqrt(n),
            CI = SE*1.96,
            mean_TEER = mean(avgTEER))
#calculate the summary of TEER values
CellTEER_summary <- CellLines %>%
  group_by(Model) %>%
  summarize(median_TEER = median(TEER),
            Q1 = quantile(TEER, 0.25),
            Q3 = quantile(TEER, 0.75),
            n = n(),
            SE = sd(TEER)/sqrt(n),
            CI = SE*1.96, 
            mean_TEER = mean(TEER))

Saving files

# Save data frames as CSV files in the metadata folder
write_csv(HNOTEER, file.path(dataframes_folder, "TEER_values.csv"))

# Save data frames as R objects in the metadata folder
saveRDS(HNOTEER, file.path(dataframes_folder, "TEER_values.rds"))

# Use this to read the final objects
HNOTEER <- readRDS("data/dataframes/TEER_values.rds")
RNASeq
CFUs 48h
Source Code
---
execute:
  message: FALSE
  warning: FALSE
---

# Cell Counts & TEER {.unnumbered}

```{r}
library(tidyverse)
library(scales)
library(ggtext)
library(readxl)
```

## File Paths

```{r}
# Folder paths
MOC_input_path <- "data/input_data/MOC_TEER"
CFUs_input_path <- "data/dataframes"

# Create subfolders for output files
dataframes_folder <- "data/dataframes"
if (!file.exists("data/dataframes")) {
  dir.create("data/dataframes", recursive = TRUE)
}
outputs_folder <- "data/outputs/MOC_TEER"
if (!file.exists("data/outputs/MOC_TEER")) {
  dir.create("data/outputs/MOC_TEER", recursive = TRUE)
}

# Load data 
HNOCells <- read.csv(file.path(MOC_input_path, "MOC_HNOBac_2024.csv")) 
CellLines <- read_excel(file.path(MOC_input_path, "HNObac_Calu3RPMI_MOC_TEER.xlsx"))

HNOTEER <- read_excel(file.path(MOC_input_path, "HNObac_TEER.xlsx"))

CFUs <- read_rds(file.path(CFUs_input_path, "CFU_values.rds"))
CFUs_6h <- read_rds(file.path(CFUs_input_path, "CFU_values_6h.rds"))
```

## Cells per HNO well

```{r}
HNOCells$Date <- as.factor(HNOCells$Date)
HNOCells$Line <- as.factor(HNOCells$Line)
HNOCells <- HNOCells  %>%
  mutate(Line = factor(Line, levels = c("HNO918", "HNO204", "HNO919"))) 
```

```{r}
#summaries by line
HNOCells_summary <- HNOCells %>%
  group_by(Line) %>%
  summarize(median_cells = median(Cells_HNO),
            Q1 = quantile(Cells_HNO, 0.25),
            Q3 = quantile(Cells_HNO, 0.75),
            n = n(),
            SE = sd(Cells_HNO)/sqrt(n),
            CI = SE*1.96,
            mean_cells = mean(Cells_HNO))

#summary of all lines together
HNOall_summary <- HNOCells %>%
  summarize(median_cells = median(Cells_HNO),
            Q1 = quantile(Cells_HNO, 0.25),
            Q3 = quantile(Cells_HNO, 0.75),
            n = n(),
            SE = sd(Cells_HNO)/sqrt(n),
            CI = SE*1.96,
            mean_cells = mean(Cells_HNO))
```

### Plot

```{r}
boxplot_HNOCells <- ggplot() +
  geom_boxplot(data = HNOCells, aes(x = Line, y = Cells_HNO), outliers = F) +
  
  geom_jitter(data = HNOCells, aes(x = Line, y = Cells_HNO, shape = Line), 
             fill = "#5b5b5b", color = "#5b5b5b", size = 3, width = 0.15, alpha = 0.75) +
  
  scale_shape_manual(values = c(21, 22, 24)) +
  scale_y_log10(limits = c(100000, 10000000),
                labels = trans_format("log10", math_format(10^.x))) +
  labs(x = "HNO Line",
       y = "HNO Cells/Well") +
  theme_bw() +
  theme(panel.grid = element_blank(),
        text = element_text(size = 20), 
        axis.text.x = element_text(color = "black"),
        axis.text.y = element_text(color = "black"))
boxplot_HNOCells

```

### Saving files

```{r}
ggsave(boxplot_HNOCells, filename = paste0(outputs_folder, "/boxplot_Cells_HNO.png"), width = 12, height = 10)
saveRDS(boxplot_HNOCells, file.path(outputs_folder, paste0("boxplot_Cells_HNO.rds")))
```

```{r}
# Save data frames as CSV files in the metadata folder
write_csv(HNOCells, file.path(dataframes_folder, "Cells_HNO_values.csv"))

# Save data frames as R objects in the metadata folder
saveRDS(HNOCells, file.path(dataframes_folder, "Cells_HNO_values.rds"))

# Use this to read the final objects
HNOCells <- readRDS("data/dataframes/Cells_HNO_values.rds")
```

## Cells per Cell Line for Calu-3 and RPMI2650

```{r}
#factor date and name of the cell line
CellLines$Date <- as.factor(CellLines$Date)
CellLines$Model <- as.factor(CellLines$Model)
```

```{r}
#summary of each cell line
CellLines_summary <- CellLines %>%
  group_by(Model) %>%
  summarize(median_cells = median(Cells),
            Q1 = quantile(Cells, 0.25),
            Q3 = quantile(Cells, 0.75),
            n = n(),
            SE = sd(Cells)/sqrt(n),
            CI = SE*1.96, 
            mean_cells = mean(Cells))
```

### Plot

```{r}
boxplot_CellLines <- ggplot() +
  geom_boxplot(data = CellLines, aes(x = Model, y = Cells)) +
  
  geom_jitter(data = CellLines, aes(x = Model, y = Cells, shape = Model), 
             fill = "#5b5b5b", color = "#5b5b5b", size = 3, width = 0.15, alpha = 0.75) +
  
  scale_shape_manual(values = c(21, 22, 24)) +
  scale_y_log10(limits = c(100000, 10000000),
                labels = trans_format("log10", math_format(10^.x))) +
  labs(x = "Cell Line",
       y = "Cells/Well") +
  theme_bw() +
  theme(panel.grid = element_blank(),
        text = element_text(size = 20), 
        axis.text.x = element_text(color = "black"),
        axis.text.y = element_text(color = "black"))

boxplot_CellLines
```

### Saving files

```{r}
ggsave(boxplot_CellLines, filename = paste0(outputs_folder, "/boxplot_CellLines_HNO.png"), width = 12, height = 10)
saveRDS(boxplot_CellLines, file.path(outputs_folder, paste0("boxplot_CellLines_HNO.rds")))
```

```{r}
# Save data frames as CSV files in the metadata folder
write_csv(CellLines, file.path(dataframes_folder, "Cells_CellLines_values.csv"))

# Save data frames as R objects in the metadata folder
saveRDS(CellLines, file.path(dataframes_folder, "Cells_CellLines_values.rds"))

# Use this to read the final objects
CellLines <- readRDS("data/dataframes/Cells_CellLines_values.rds")
```

## Multiplicity of Colonization (HNOs)

```{r}
Inoc_CFUs <- CFUs %>%
  filter(Time == "0") %>%
  select(Date, Line, bacteria, Temp, NewCFU) %>%
  distinct(Date, Line, bacteria, NewCFU, .keep_all = TRUE)

Inoc_CFUs_6h <- CFUs_6h %>%
  filter(Time == "0") %>%
  filter(Model == "HNO") %>%
  select(Date, Line, bacteria, Temp, NewCFU)

Inoc <- rbind(Inoc_CFUs, Inoc_CFUs_6h)
```

```{r}
CFU_Inoculum <- Inoc %>%
  group_by(Line, bacteria) %>%
  summarize(median_CFUs = median(NewCFU))

MOC_Calcs <- left_join(CFU_Inoculum, HNOCells_summary %>% select(Line, median_cells), by = "Line")

MOC_Calcs <- MOC_Calcs %>%
  mutate(MOC = (median_CFUs/median_cells)) %>%
  group_by(bacteria) %>%
  mutate(avg_MOC = (mean(MOC)))
```

### Saving files

```{r}
# Save data frames as CSV files in the outputs folder
write_csv(MOC_Calcs, file.path(outputs_folder, "MOC_HNOs.csv"))
```

## TEER

```{r}
#factor line and date
HNOTEER$Date <- as.factor(HNOTEER$Date)
HNOTEER$Line <- as.factor(HNOTEER$Line)
#create levels for line to order the HNO lines
HNOTEER <- HNOTEER  %>%
  mutate(Line = factor(Line, levels = c("HNO918", "HNO204", "HNO919"))) 
```

```{r}
#average the technical replicates together
TEERavg <- HNOTEER %>%
  group_by(Date,Line,LineCharacter,Assay,WithCellHNO) %>%
  summarise(avgTEER = mean(TEER))

#calculate the median and mean for TEER of HNOs
HNOteer_summary <-  TEERavg %>%
  group_by(Line) %>%
  summarize(median_TEER = median(avgTEER),
            Q1 = quantile(avgTEER, 0.25),
            Q3 = quantile(avgTEER, 0.75),
            n = n(),
            SE = sd(avgTEER)/sqrt(n),
            CI = SE*1.96,
            mean_TEER = mean(avgTEER))
```

```{r}
#calculate the summary of TEER values
CellTEER_summary <- CellLines %>%
  group_by(Model) %>%
  summarize(median_TEER = median(TEER),
            Q1 = quantile(TEER, 0.25),
            Q3 = quantile(TEER, 0.75),
            n = n(),
            SE = sd(TEER)/sqrt(n),
            CI = SE*1.96, 
            mean_TEER = mean(TEER))
```

### Saving files

```{r}
# Save data frames as CSV files in the metadata folder
write_csv(HNOTEER, file.path(dataframes_folder, "TEER_values.csv"))

# Save data frames as R objects in the metadata folder
saveRDS(HNOTEER, file.path(dataframes_folder, "TEER_values.rds"))

# Use this to read the final objects
HNOTEER <- readRDS("data/dataframes/TEER_values.rds")
```