1 # make figure 1 from paper
2 options(stringsAsFactors=FALSE)
4 args = commandArgs(TRUE)
7 df = read.delim(args[1])
9 df[df$method == "bis2", "method"] = "bismark-bt2"
10 df[df$method == "bis1", "method"] = "bismark-bt1"
11 df[df$method == "bwastrand", "method"] = "bwa-strand"
12 df[df$method == "bwa", "method"] = "bwameth"
14 df[grep("sim_R1", df$method, fixed=TRUE), "method"] = "bison"
15 df[grep("real_R1", df$method, fixed=TRUE), "method"] = "bison"
17 points = c('bismark-bt1', 'bismark-bt2', 'gsnap')
18 df$size = as.numeric(ifelse(df$method %in% points, 1.2, 0.4))
23 df = df[order(df$qual),]
25 df = df[(df$on + df$off) != 0,]
32 p = ggplot(df, aes(x=off, y=on, by=method)) +
33 geom_point(aes(shape=method, size=size, linestyle=method)) +
34 scale_size_identity() +
35 scale_shape(solid = FALSE) +
36 guides(size=FALSE, linestyle=FALSE) +
37 geom_line(data=df[!df$method %in% points,], aes(shape=method), size=0.4) +
38 scale_shape(solid = FALSE) +
39 guides(linestyle=FALSE)
42 #geom_line(aes(linestyle=method), size=1.4) + scale_shape(solid=FALSE)
43 #geom_line(aes(color=method), linetype="dotted")
44 p = p + ylab("% Reads On Target")
45 p = p + xlab("% Reads Off Target")
48 #legend.position = c(0.55, 0.25),
49 legend.position = c(0.75, 0.25),
50 legend.text=element_text(size=6, lineheight=5),
51 axis.text=element_text(size=6),
52 axis.title=element_text(size=8),
53 legend.key.size=unit(6, "mm")
57 p = p + guides(shape=guide_legend(ncol=2, title=NULL), size=FALSE, method=FALSE)
58 ggsave(file=args[2], units="cm", width=8.6, height=6.3,