#!/usr/bin/env Rscript library(Rtsne) library(ggplot2) data <- read.csv("figures/tsne-cdk.csv",header=F) #data[,1] <- NULL #labels <- data[,2] #data[,2] <- NULL m <- as.matrix(data) #class(m) <- "numeric" #print(m) tsne <- Rtsne(m,verbose=T,check_duplicates=F) write.csv(data.frame(x = tsne$Y[,1], y = tsne$Y[,2]),"figures/tsne-coordinates-cdk.csv") #tsne_plot <- data.frame(x = tsne$Y[,1], y = tsne$Y[,2]) #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("figures/tsne-cdk.png")