Additional file 2: Text S1. Figure and statistics generation script. # Load packages library(ggplot2) library(gridExtra) library(ggpubr) library(scales) library(pastecs) # The working directory should be set to where you have the bioassay_data.csv file is located # use setwd("path/to/dir/with/data") dat <- read.csv("bioassay_data.csv") dat$type <- as.factor(dat$type) dat_k = dat[dat$strain == 'Kilifi', ] dat_k[dat_k$mortality_24 < 75,] dat_m = dat[dat$strain == 'Mbita', ] dat$type <- as.factor(dat$type) kil_plot <- ggplot(dat_k, aes(x=type, y=mortality_24)) + geom_boxplot(fill='skyblue', outlier.shape = NA) #kil_plot <- kil_plot + geom_point(aes(), size = 4, shape = 4) kil_plot <- kil_plot + coord_cartesian(ylim = c(75, 100)) kil_plot <- kil_plot + xlab(" ") + ylab(" ") + ggtitle('Kilifi') + theme(plot.title = element_text(hjust = 0.5)) kil_plot <- kil_plot + stat_compare_means(method = "t.test", label.x = 1.2, label.y = 100.5) + theme(plot.margin=grid::unit(c(0,0,0,0), "mm")) kil_plot mbi_plot <- ggplot(dat_m, aes(x=type, y=mortality_24)) + geom_boxplot(fill='skyblue', outlier.shape = NA) #mbi_plot <- mbi_plot + geom_point(aes(), size = 4, shape = 4) mbi_plot <- mbi_plot + coord_cartesian(ylim = c(75, 100)) mbi_plot <- mbi_plot + xlab(" ") + ylab("24hr Mortality (%)") + ggtitle('Mbita') + theme(plot.title = element_text(hjust = 0.5)) mbi_plot <- mbi_plot + stat_compare_means(method = "t.test", label.x = 1.2, label.y = 100.5) + theme(plot.margin=grid::unit(c(0,0,0,0), "mm")) mbi_plot combined_plot <- ggplot(dat, aes(x=type, y=mortality_24)) + geom_boxplot(fill='skyblue', outlier.shape = NA) #mbi_plot <- mbi_plot + geom_point(aes(), size = 4, shape = 4) combined_plot <- combined_plot + coord_cartesian(ylim = c(75, 100)) combined_plot <- combined_plot + xlab(" ") + ylab(" ") + ggtitle('Combined') + theme(plot.title = element_text(hjust = 0.5)) combined_plot <- combined_plot + stat_compare_means(method = "t.test", label.x = 1.2, label.y = 100.5) + theme(plot.margin=grid::unit(c(0,0,0,0), "mm")) combined_plot blank_theme <- theme_minimal()+ theme( axis.title.x = element_blank(), axis.title.y = element_blank(), panel.border = element_blank(), panel.grid=element_blank(), axis.ticks = element_blank(), plot.title=element_text(size=14, face="bold"), plot.margin=grid::unit(c(0,0,0,0), "mm") ) # Save bar plots plot <- ggarrange(mbi_plot, kil_plot, combined_plot, ncol=3) plot ggsave("Figure_3.png", plot=plot, width = 6, height = 8) # Summary Statsitics stat.desc(dat[dat$type=='3D' & dat$strain == 'Mbita',]$mortality_24) stat.desc(dat[dat$type=='3D' & dat$strain == 'Kilifi',]$mortality_24) stat.desc(dat[dat$type=='WHO' & dat$strain == 'Mbita',]$mortality_24) stat.desc(dat[dat$type=='WHO' & dat$strain == 'Kilifi',]$mortality_24) # Count n nrow(dat[dat$type=='3D' & dat$strain == 'Mbita',]) nrow(dat[dat$type=='3D' & dat$strain == 'Kilifi',]) nrow(dat[dat$type=='WHO' & dat$strain == 'Mbita',]) nrow(dat[dat$type=='WHO' & dat$strain == 'Kilifi',])