I'm trying to use the t-SNE algorithm on some microarrays data. More specifically my data frame has 18600 columns with genes (features) and 72 rows with conditions with replicates ( 10xWt , 10xTg , etc ). The expression values are in log2 scale.
Here is the code that I'm trying to run.
# t-SNE implementation
library(Rtsne)
set.seed(1)
for(i in 1:15){
tsne = Rtsne(data.T[,-18601], dims = 2, perplexity=i, verbose=TRUE, max_iter = 1000, pca=T)
colors = rainbow(length(unique(data.T$classes)))
names(colors) = unique(data.T$classes)
plot(tsne$Y, t='n', main="tsne")
text(tsne$Y, labels=data.T$classes, col=colors[data.T$classes])
readline(prompt="Press [enter] to continue")
}
Please note that I'm not counting the column 18601 because this colums contains the labels/classes for each condition.
The think here is that when I execute this script, R returns me this error:
Error: protect(): protection stack overflow
Should I change the --max-pp-size
or it's a bug in Rtsne package?
Also I was wondering if it is more meaningful to run the tSNE algorithm using not the log2 values of the expression level but the log fold change values in respect to the Wt (wild type) condition. I'm asking because I couldn't find a such other implementation of the tSNE on microarray data.
For the configuration of the Rtsne function I read this article
Any other suggestion on the implementation is welcomed.