diff options
author | Christoph Helma <helma@in-silico.ch> | 2016-02-17 21:13:23 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2016-02-17 21:13:23 +0100 |
commit | 4d67ddb9fe72cb4cba42e508a943e1d4d04fef8c (patch) | |
tree | 7495d315e55521adcb1818bc97214b1096915d16 /paper/test-prediction-plot.R | |
parent | 0ab42bc04fefd4dd67b62c87dc651c90dc7988f0 (diff) |
validations, figures, text finalisation started
Diffstat (limited to 'paper/test-prediction-plot.R')
-rw-r--r-- | paper/test-prediction-plot.R | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/paper/test-prediction-plot.R b/paper/test-prediction-plot.R new file mode 100644 index 0000000..c43737f --- /dev/null +++ b/paper/test-prediction-plot.R @@ -0,0 +1,32 @@ +library(ggplot2) +library(grid) +library(gridExtra) + +mazzatorta = read.csv("data/mazzatorta-test-predictions.csv",header=T) +swiss = read.csv("data/swiss-test-predictions.csv",header=T) +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" +maz = data.frame(factor(mazzatorta$SMILES),mazzatorta$LOAEL_predicted,factor(mazzatorta$Dataset)) +names(maz) = n +maz$Type = "predicted" +data = rbind(data,maz) +swi = data.frame(factor(swiss$SMILES),swiss$LOAEL_predicted,factor(swiss$Dataset)) +names(swi) = n +swi$Type = "predicted" +data = rbind(data,swi) +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 <- 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) |