I tried solution from halo22, it didn't work. However, I somehow figured it out myself.
#3d tsne projection yourseuratobject <- RunTSNE(object = yourseuratobject, dims.use = 1:n, do.fast = TRUE, dim.embed = 3) tsne_1 <- yourseuratobject@firstname.lastname@example.org[,1] tsne_2 <- yourseuratobject@email@example.com[,2] tsne_3 <- yourseuratobject@firstname.lastname@example.org[,3] library(scatterplot3d) scatterplot3d(x = tsne_1, y = tsne_2, z = tsne_3, color = as.numeric(1:n)[yourseuratobject@ident]) library(rgl) #interactive 3d plotting plot3d(x = tsne_1, y = tsne_2, z = tsne_3, col = as.numeric(1:n)[yourseuratobject@ident], type="s",radius=0.3) rgl::rglwidget() #save as html
PS: tsne coordinates are stored in yourseuratobject@email@example.com cluster identity by SNN is store in yourseuratobject@ident
Hope this would help!
You can use the R-package tsne to do this https://cran.r-project.org/web/packages/tsne/tsne.pdf
For your analysis you will have to figure out what input to provide to tSNE, ideally PC's obtained from seurat are the suggested input but you can also use your variable genes with scaled values.
I know this is old now. But Ive written some code which will help you create a 3D expression plot using plotly out of a seurat v3.0.0 object. Dont forget to star and fork :)
Find the complete solution here: https://github.com/Dragonmasterx87/3D-Plotting-in-Seurat-3.0.0