summaryrefslogtreecommitdiff
path: root/scripts/pa-groups.R
blob: 3c6ce2cb27d9217498e55121fde3cae1a3e8763d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env Rscript
library(ggplot2)
args = commandArgs(trailingOnly=TRUE)
groups = read.csv(args[1],header=T)
data = read.csv(args[2])
for (i in c(2:10)) {
  name = names(groups)[i]
  cols = c(2:15)
  group = data[groups[i] == 1,cols]
  freq = 100*colSums(group,na.rm=TRUE)/colSums(!is.na(group))
  algos = toupper(names(data)[cols])
  algos = gsub("HIGH",'HC',algos)
  algos = gsub(".CONFIDENCE",'',algos)
  algos = gsub("\\.",'-',algos)
  algos <- factor(algos,levels=rev(c(
  "MP2D-LAZAR-ALL",
  "MP2D-LAZAR-HC",
  "MP2D-RF",
  "MP2D-LR",
  "MP2D-LR2",
  "MP2D-NN",
  "MP2D-SVM",
  "CDK-LAZAR-ALL",
  "CDK-LAZAR-HC",
  "CDK-RF",
  "CDK-LR",
  "CDK-LR2",
  "CDK-NN",
  "CDK-SVM"
  )))
  plot = ggplot(data.frame(freq),aes(x=freq,y=algos)) + geom_bar(stat="identity") + xlab("% mutagenic") + ylab(element_blank()) + xlim(c(0,100))# + theme(axis.text.x = element_text(angle=90))
  ggsave(paste("figures/",name,".png",sep=""))
}