This method provides visualization of 3D-tSNE plot given a Seurat Object and returns a plotly plot and a dataframe of TSNE coordinates. It optionally saves the plotly image embedded in an html file.

tSNE3D(
  object,
  color.variable,
  label.variable,
  dot.size = 4,
  legend = TRUE,
  colors = c("darkblue", "purple4", "green", "red", "darkcyan", "magenta2", "orange",
    "yellow", "black"),
  filename = "plot.html",
  save.plot = FALSE,
  npcs = 15
)

Arguments

object

Seurat-class object

color.variable

Metadata column in Seurat Object to use for color

label.variable

Metadata column in Seurat Object to use for label

dot.size

Dot size for plot (default is 4)

legend

If TRUE, show legend (default is TRUE)

colors

Colors used for the color.variable

filename

Filename for saving plot (default is "plot.html")

save.plot

Save plot as widget in html file (default is FALSE)

npcs

Number of principal components used for tSNE calculations (default is 15)