#!/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])