#Figure1e
# Figure1e
library(ggplot2)
library(dplyr)
dat <- read.csv("20240904Badolescentis_van-sacch.csv", sep = ',', header = TRUE)
dat %>%
#filter(BugID != "KPG12", BugID != "NT5071") %>%
ggplot(aes(x = compound, y = FC)) +
geom_boxplot(outlier.shape = NA, )+ #removes outliers from the boxplot
stat_boxplot(geom = "errorbar", width = 0.1) +
geom_jitter()+
#geom_point(aes(size=5))+
#facet_wrap(c("SCFA", "Type", "Passage"), ncol = 4)+
#scale_x_discrete(limits = rev(sort(unique(dat$compound)))) +
#theme(text = element_text(size = 13), axis.text.x = element_text(angle = 45,hjust = 1)) +
#ggtitle("auc_l") +
ylim(0,1.5) +
theme(text = element_text(size = 13), axis.text.x = element_text(angle = 45,hjust = 1),
panel.background = element_rect(fill='white'),
panel.grid.major = element_line(color = "black", linewidth = 4),  # Adjust gridline color and size
panel.grid.minor = element_blank(),  # Remove minor gridlines
panel.grid.major.x = element_line(color = "grey", linewidth = 0.2),  # Color for x-axis major gridlines
panel.grid.major.y = element_line(color = "grey", linewidth = 0.2),   # Color for y-axis major gridlines
axis.line.x = element_line(colour = 'black', linewidth = 0.5, linetype='solid'),
axis.line.y = element_line(colour = 'black', linewidth = 0.5, linetype='solid')
)
box_stats <- dat %>%
# group_by(compound) %>%
summarise(
Q1 = quantile(FC, 0.25),
median = quantile(FC, 0.50),
Q3 = quantile(FC, 0.75),
IQR = IQR(FC),
lower_whisker = max(min(FC), Q1 - 1.5 * IQR),
upper_whisker = min(max(FC), Q3 + 1.5 * IQR),
minimum = min(FC),
maximum = max(FC)
)
write.csv(box_stats, "box_stats_Fig1e.csv")
View(box_stats)
#Figure2f
library(dplyr)
library(ggplot2)
dat2 <- read.csv("Tab_AdMeta_norm-Pmerd-Rint_Mix1.csv", sep = ',', header = TRUE)
