diff options
Diffstat (limited to 'test-prediction-plot.R')
-rw-r--r-- | test-prediction-plot.R | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test-prediction-plot.R b/test-prediction-plot.R new file mode 100644 index 0000000..d1d6acb --- /dev/null +++ b/test-prediction-plot.R @@ -0,0 +1,21 @@ +library(ggplot2) + +combined = read.csv("data/combined-test-predictions.csv",header=T) +test <- read.csv("data/test.csv",header=T) +n = c("SMILES","LOAEL","Source") + +data = data.frame(factor(test$SMILES),test$LOAEL,factor(test$Dataset)) +names(data) = n +data$Type = "experimental" +comb = data.frame(factor(combined$SMILES),combined$LOAEL_predicted,factor(combined$Dataset)) +names(comb) = n +comb$Type = "predicted" +data = rbind(data,comb) +data$LOAEL = -log(data$LOAEL) +data$SMILES <- reorder(data$SMILES,data$LOAEL) +#img <- ggplot(data, aes(SMILES,LOAEL,ymin = min(LOAEL), ymax=max(LOAEL),shape=Source,color=Type)) +img <- ggplot(data, aes(SMILES,LOAEL,ymin = min(LOAEL), ymax=max(LOAEL),color=Type)) +img <- img + ylab('-log(LOAEL mg/kg_bw/day)') + xlab('Compound') + theme(axis.text.x = element_blank()) +img <- img + geom_point() + +ggsave(file='figure/test-prediction.pdf', plot=img,width=12, height=8) |