summaryrefslogtreecommitdiff
path: root/scripts/tsne-cdk.R
blob: cdf44e5db62d6e3fc6113b6876fb80a6def204ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/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")