I'm trying to run t-sne on my coding as well as non coding genes. Even though I'm getting output I'm not confident about my code (The output it's difficult to interpret).
I have a data set of total 16 cell type and about 3000 genes.
This is how my data is first column is gene rest is sample:
gene H1 H2 H3 H4 M2 M3 M4 C1 C2 C3 C4 G2 G3 G4 Gran1 Gran2
The code used:
library(Rtsne) file1<- read.csv('UNIQUE_WGCNA_FILE.csv',header = T,row.names = 1) trn <- data.matrix(file1) dim(trn) tsne <- Rtsne(as.matrix(trn[,1:16]), check_duplicates = FALSE, pca = FALSE, perplexity=50, theta=0.5, dims=3) cols <- rainbow(10) plot(tsne$Y, t='n') text(tsne$Y, labels=as.numeric(trn[,1]), col=cols[trn[,1]]) require(rgl) plot3d(tsne$Y, col=cols[trn[,1]]) legend3d("topright", legend = '0':'5', pch = 16, col = rainbow(10)) rgl.postscript("Merge.pdf", "pdf")
I'm getting output but I don't know how to label so its becoming difficult. Any suggestion or help how to label would be appreciated.