summaryrefslogtreecommitdiff
path: root/scripts/tsne-mutagenicity.R
blob: c8d63d11fe27d3429455ed3c07896ccb0dcb4038 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env Rscript
library(Rtsne)
library(ggplot2)
args = commandArgs(trailingOnly=TRUE)
tsne = read.csv(args[1],header=T)
tsne[,1] = NULL
labels = read.csv(args[2],header=F)[,1]
tsne_plot = data.frame(x = tsne$x, y = tsne$y)
colors = c("PA" = "#00BFC4", "mutagen" = "#F8766D", "non-mutagen" = "#7CAE00")
plot = ggplot(tsne_plot)
plot + geom_point(aes(x=x, y=y, color = labels)) + xlab(element_blank()) + ylab(element_blank()) + theme(axis.ticks = element_blank(), axis.text = element_blank(), legend.title=element_blank(), legend.position="bottom") + scale_color_manual(values = colors)
ggsave(args[3])