Estefani Gaytan Nunez
No preview for this file type
library(ggplot2)
# Run1
dfa <- data.frame(Measure=rep(c("Precision", "Recall", "F1-score"), each=4),
Strategy=rep(c("OD", "Ph", "Technique", "Med", "Temp", "Vess", "Agit", "Phase", "Air", "Anti", "Strain", "Gtype", "Substrain", "Supp", "Gversion"),3),
Score=c(
1, 0.405, 0.577,
1, 1, 1,
0.88, 1, 0.936,
0.852, 0.912, 0.881,
0.818, 1, 0.9,
0, 0, 0,
0, 0, 0,
1, 0.947, 0.973,
0.92, 0.742, 0.821,
1, 0.444, 0.615,
1, 1, 1,
0.905, 0.811, 0.856,
0, 0, 0,
0.883, 0.669, 0.762,
0, 0, 0
))
# ECO-DEV-WITH-EFFECT-COMBINATION: Combination of strategies with effect in E. coli development dataset
dfa <- data.frame(Measure=rep(c("Precision", "Recall", "F1-score"), each=4),
Strategy=rep(c("Dev", "Dev+Vrb", "Dev+Vrb+Att", "Dev+Vrb+Att+Aut"),3),
Score=c(0.78, 0.79, 0.81, 0.81, 0.41, 0.56, 0.63, 0.63, 0.53, 0.65, 0.71, 0.71))
head(dfa)
# Run1
dfa <- data.frame(Measure=rep(c("Precision", "Recall", "F1-score"), each=15),
Strategy=rep(c("OD", "Ph", "Technique", "Med", "Temp", "Vess", "Agit", "Phase", "Air", "Anti", "Strain", "Gtype", "Substrain", "Supp", "Gversion"),3),
Score=c(
1, 1, 0.88, 0.852, 0.818, 0, 0, 1, 0.92, 1, 1, 0.905, 0, 0.883, 0,
0.405, 1, 1, 0.912, 1, 0, 0, 0.947, 0.742, 0.444, 1, 0.811, 0, 0.669, 0
0.577, 1, 0.936, 0.881, 0.9, 0, 0, 0.973, 0.821, 0.615, 1, 0.856, 0, 0.762, 0
))
# Run1
dfa <- data.frame(Measure=rep(c("Precision", "Recall", "F1-score"), each=15),
Strategy=rep(c("OD", "Ph", "Technique", "Med", "Temp", "Vess", "Agit", "Phase", "Air", "Anti", "Strain", "Gtype", "Substrain", "Supp", "Gversion"),3),
Score=c(
1, 1, 0.88, 0.852, 0.818, 0, 0, 1, 0.92, 1, 1, 0.905, 0, 0.883, 0,
0.405, 1, 1, 0.912, 1, 0, 0, 0.947, 0.742, 0.444, 1, 0.811, 0, 0.669, 0,
0.577, 1, 0.936, 0.881, 0.9, 0, 0, 0.973, 0.821, 0.615, 1, 0.856, 0, 0.762, 0
))
head(dfa)
pa<-ggplot(dfa, aes(x=Strategy, y=Score, group=Measure)) +
geom_line(aes(color=Measure))+
geom_point(aes(color=Measure))+
scale_color_manual(values=c("#999999", "#E69F00", "#56B4E9"))+
#scale_color_manual(values=c("#e6194b", "#3cb44b", "#0082c8"))+
geom_text(aes(label = Score))+
labs(title="Combination of strategies with effect in E. coli development dataset",x="Combination of strategies", y = "Score")+
#labs(title="(a)",x="Combination of strategies", y = "Score")+
theme_classic()
pa
title_plot = "Salmonella evaluation dataset"
pa<-ggplot(df, aes(x=Strategy, y=Score, group=Measure)) +
geom_line(aes(color=Measure))+
geom_point(aes(color=Measure))+
scale_color_manual(values=c("#999999", "#E69F00", "#56B4E9"))+
#scale_color_manual(values=c("#e6194b", "#3cb44b", "#0082c8"))+
geom_text(aes(label = Score))+
labs(title=title_plot,x="Strategies", y = "Score")+
#theme_classic()+
theme(
legend.position="top",
# Centrar título: plot.title = element_text(hjust = 0.5),
axis.line = element_line(colour = "gray"),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank(),
)
pa<-ggplot(dfa, aes(x=Strategy, y=Score, group=Measure)) +
geom_line(aes(color=Measure))+
geom_point(aes(color=Measure))+
scale_color_manual(values=c("#999999", "#E69F00", "#56B4E9"))+
#scale_color_manual(values=c("#e6194b", "#3cb44b", "#0082c8"))+
geom_text(aes(label = Score))+
labs(title="Combination of strategies with effect in E. coli development dataset",x="Combination of strategies", y = "Score")+
#labs(title="(a)",x="Combination of strategies", y = "Score")+
theme(
legend.position="top",
# Centrar título: plot.title = element_text(hjust = 0.5),
axis.line = element_line(colour = "gray"),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank()
)
pa
ggsave(".png")
pa
pa<-ggplot(dfa, aes(x=Strategy, y=Score, group=Measure)) +
geom_line(aes(color=Measure))+
geom_point(aes(color=Measure))+
scale_color_manual(values=c("#999999", "#E69F00", "#56B4E9"))+
#scale_color_manual(values=c("#e6194b", "#3cb44b", "#0082c8"))+
geom_text(aes(label = Score))+
labs(title="Prediction of best model (Run1)",x="Conditions", y = "Score")+
#labs(title="(a)",x="Combination of strategies", y = "Score")+
theme(
legend.position="top",
# Centrar título: plot.title = element_text(hjust = 0.5),
axis.line = element_line(colour = "gray"),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank()
)
pa
# Run1
dfa <- data.frame(Measure=rep(c("Precision", "Recall", "F1-score"), each=15),
Strategy=rep(c(
"Agit",
"Gversion",
"Substrain",
"Vess",
"OD",
"Anti",
"Supp",
"Air",
"Gtype",
"Med",
"Temp",
"Technique",
"Phase",
"pH",
"Strain"
),3),
Score=c(
0,
0,
0,
0,
1,
1,
0.883,
0.92,
0.905,
0.852,
0.818,
0.88,
1,
1,
1,
0,
0,
0,
0,
0.405,
0.444,
0.669,
0.742,
0.811,
0.912,
1,
1,
0.947,
1,
1,
0,
0,
0,
0,
0.577,
0.615,
0.762,
0.821,
0.856,
0.881,
0.9,
0.936,
0.973,
1,
1
))
head(dfa)
pa<-ggplot(dfa, aes(x=Strategy, y=Score, group=Measure)) +
geom_line(aes(color=Measure))+
geom_point(aes(color=Measure))+
scale_color_manual(values=c("#999999", "#E69F00", "#56B4E9"))+
#scale_color_manual(values=c("#e6194b", "#3cb44b", "#0082c8"))+
geom_text(aes(label = Score))+
labs(title="Prediction of the best model (Run1)",x="Conditions", y = "Score")+
theme(
legend.position="top",
# Centrar título: plot.title = element_text(hjust = 0.5),
axis.line = element_line(colour = "gray"),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank()
)
pa
pa<-ggplot(dfa, aes(x=Strategy, y=Score, group=Measure)) +
geom_line(aes(color=Measure, stat="identity"))+
geom_point(aes(color=Measure))+
scale_color_manual(values=c("#999999", "#E69F00", "#56B4E9"))+
#scale_color_manual(values=c("#e6194b", "#3cb44b", "#0082c8"))+
geom_text(aes(label = Score))+
labs(title="Prediction of the best model (Run1)",x="Conditions", y = "Score")+
theme(
legend.position="top",
# Centrar título: plot.title = element_text(hjust = 0.5),
axis.line = element_line(colour = "gray"),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank()
)
pa<-ggplot(dfa, aes(x=Strategy, y=Score, group=Measure)) +
geom_line(aes(color=Measure), stat="identity")+
geom_point(aes(color=Measure))+
scale_color_manual(values=c("#999999", "#E69F00", "#56B4E9"))+
#scale_color_manual(values=c("#e6194b", "#3cb44b", "#0082c8"))+
geom_text(aes(label = Score))+
labs(title="Prediction of the best model (Run1)",x="Conditions", y = "Score")+
theme(
legend.position="top",
# Centrar título: plot.title = element_text(hjust = 0.5),
axis.line = element_line(colour = "gray"),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank()
)
pa
# Based on http://www.sthda.com/english/wiki/ggplot2-line-plot-quick-start-guide-r-software-and-data-visualization
library(ggplot2)
#library(ggpubr)
#library(cowplot)
######### BEST MODELS ##########
# Run1
dfa <- data.frame(Measure=rep(c("Precision", "Recall", "F1-score"), each=15),
Strategy=rep(c(
"Agit",
"Gversion",
"Substrain",
"Vess",
"OD",
"Anti",
"Supp",
"Air",
"Gtype",
"Med",
"Temp",
"Technique",
"Phase",
"pH",
"Strain"
),3),
Score=c(
0,
0,
0,
0,
1,
1,
0.883,
0.92,
0.905,
0.852,
0.818,
0.88,
1,
1,
1,
0,
0,
0,
0,
0.405,
0.444,
0.669,
0.742,
0.811,
0.912,
1,
1,
0.947,
1,
1,
0,
0,
0,
0,
0.577,
0.615,
0.762,
0.821,
0.856,
0.881,
0.9,
0.936,
0.973,
1,
1
))
head(dfa)
pa<-ggplot(dfa, aes(x=Strategy, y=Score, group=Measure)) +
geom_line(aes(color=Measure))+
geom_point(aes(color=Measure))+
scale_color_manual(values=c("#999999", "#E69F00", "#56B4E9"))+
#scale_color_manual(values=c("#e6194b", "#3cb44b", "#0082c8"))+
geom_text(aes(label = Score))+
labs(title="Prediction of the best model (Run1)",x="Conditions", y = "Score")+
theme(
legend.position="top",
# Centrar título: plot.title = element_text(hjust = 0.5),
axis.line = element_line(colour = "gray"),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank()
)
pa
ggsave(".png")
# Based on http://zevross.com/blog/2019/04/02/easy-multi-panel-plots-in-r-using-facet_wrap-and-facet_grid-from-ggplot2/
library(ggplot2)
#library(ggpubr)
#library(cowplot)
organism = 'ECO'
if (organism == 'ECO') {
######### ECO DEVELOPMENT DATASET ##########
# ECO-DEV-WITH-EFFECT-COMBINATION: Combination of strategies with effect in E. coli development dataset
df <- data.frame(Panel=rep(c("Combination of strategies (effect)", "Separated strategies (effect)", "Combination of strategies (no effect)", "Separated strategies (no effect)"), each=12),
Measure=rep(c("Precision", "Recall", "F1-score"), each=4),
Strategy=c(rep(c("D", "D+V", "D+V+At", "D+V+At+Au"),3),rep(c("D", "V", "At", "Au"),3)),
Score=c(
0.78, 0.79, 0.81, 0.81, 0.41, 0.56, 0.63, 0.63, 0.53, 0.65, 0.71, 0.71,
0.78, 0.89, 0.93, 1.00, 0.41, 0.35, 0.13, 0.01, 0.53, 0.50, 0.23, 0.02,
0.82, 0.82, 0.84, 0.84, 0.55, 0.66, 0.72, 0.72, 0.66, 0.73, 0.78, 0.78,
0.82, 0.88, 0.94, 1.00, 0.55, 0.39, 0.20, 0.01, 0.66, 0.54, 0.33, 0.02))
filename = "ECO-dev-multi-panel.png"
title_plot = "E. coli development dataset"
} else if (organism == 'STM')
{
######### STM DEVELOPMENT DATASET ##########
# STM-DEV-WITH-EFFECT-COMBINATION: Combination of strategies with effect in Salmonella evaluation dataset
df <- data.frame(Panel=rep(c("Combination of strategies (effect)", "Separated strategies (effect)", "Combination of strategies (no effect)", "Separated strategies (no effect)"), each=12),
Measure=rep(c("Precision", "Recall", "F1-score"), each=4),
Strategy=c(rep(c("D", "D+V", "D+V+At", "D+V+At+Au"),3),rep(c("D", "V", "At", "Au"),3)),
Score=c(
0.78, 0.77, 0.76, 0.76, 0.33, 0.49, 0.54, 0.54, 0.47, 0.60, 0.63, 0.63,
0.78, 0.81, 0.70, 0.88, 0.33, 0.33, 0.10, 0.01, 0.47, 0.47, 0.18, 0.02,
0.84, 0.82, 0.81, 0.81, 0.47, 0.59, 0.65, 0.65, 0.60, 0.68, 0.72, 0.72,
0.84, 0.84, 0.77, 0.86, 0.47, 0.40, 0.17, 0.01, 0.60, 0.55, 0.27, 0.02))
filename = "STM-dev-multi-panel.png"
title_plot = "Salmonella evaluation dataset"
}
head(df)
pa<-ggplot(df, aes(x=Strategy, y=Score, group=Measure)) +
geom_line(aes(color=Measure))+
geom_point(aes(color=Measure))+
scale_color_manual(values=c("#999999", "#E69F00", "#56B4E9"))+
#scale_color_manual(values=c("#e6194b", "#3cb44b", "#0082c8"))+
geom_text(aes(label = Score))+
labs(title=title_plot,x="Strategies", y = "Score")+
#theme_classic()+
theme(
legend.position="top",
# Centrar título: plot.title = element_text(hjust = 0.5),
axis.line = element_line(colour = "gray"),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank(),
)+
facet_wrap(~Panel, scale="free")
ggsave(filename)
No preview for this file type