I m doing PCA along with RTNSE on my data set .My code
data<- read.csv('module500.csv',header = T,row.names = 1)
head(data)
set.seed(1) # set random seed
rtsne_out <- Rtsne(as.matrix(data), pca = FALSE, verbose = TRUE)
# plot 2D t-SNE projection
plot(rtsne_out$Y, asp = 1, pch = 20, col = "red",
cex = 0.75, cex.axis = 1.25, cex.lab = 1.25, cex.main = 1.5,
xlab = "t-SNE dimension 1", ylab = "t-SNE dimension 2",
main = "2D t-SNE projection")
My example data file contains following data
HSC_mean CMP_mean GMP_mean Mono_mean Granulocyte_mean
The dim is about
> dim(data)
[1] 499 5
Im getting an image like this tnse output
Im trying how to label the cluster since this is about 499 genes and 5 sample so how do i label those I mean since I have 5 sample so 5 different colour which can label those cluster , Im not sure how do they do in the paper which i came across label each cluster...any help or suggestion would be highly appreciated
Just to make my what i'm trying to say have a look at this figure from this paper tsne figure b and the rest
i got it....I can know see different color based I mean as i defined the colour of samples based on the order of my sample, another issue how do i get to label those data points , not in terms of genes, but as labelling them in terms of sample as legend , in terms of color you have defined ...
To label them after you have already called
plot()
(but it will be difficult to label all of them), you will need another vector, this time of names:okay can i just show my color code as legend ? i think it would be difficult to put those in the plot
Yes, actually, when I was in the gym this morning thinking about your question, I thought that it would be easier to just show a legend. Refer to our other thread: C: heatmap data frame annotation issue