Dimensionality reduction through t-SNE

dimred_tsne(
  MAE,
  tax_level,
  color,
  shape = NULL,
  k = c("2D", "3D"),
  initial_dims = 30,
  perplexity = 10,
  datatype = c("logcpm", "relabu", "counts"),
  tsne_cache = NULL
)

Arguments

MAE

A multi-assay experiment object

tax_level

The taxon level used for organisms

color

A condition to color data points by e.g. "AGE"

shape

A condition to shape data points by e.g. "SEX"

k

Plot dimensions e.g. c("2D","3D")

initial_dims

The number of dimensions to use in reduction method

perplexity

Optimal number of neighbors

datatype

Datatype to use e.g. c("logcpm", "relabu", "counts")

tsne_cache

Pass the cached data back into the function

Value

A list with a plotly object and cached data

Examples

data_dir <- system.file("extdata/MAE.rds", package = "animalcules")
toy_data <- readRDS(data_dir)
results <- dimred_tsne(toy_data,
  tax_level = "phylum",
  color = "AGE",
  shape = "GROUP",
  k = "3D",
  initial_dims = 30,
  perplexity = 10,
  datatype = "logcpm"
)
#> sigma summary: Min. : 0.512599065767779 |1st Qu. : 0.633512978585265 |Median : 0.689297219210298 |Mean : 0.693244142454956 |3rd Qu. : 0.746970619913928 |Max. : 0.912172075133477 |
#> Epoch: Iteration #100 error is: 18.294138775534
#> Epoch: Iteration #200 error is: 1.50141165424373
#> Epoch: Iteration #300 error is: 0.952060563224696
#> Epoch: Iteration #400 error is: 0.677114080350808
#> Epoch: Iteration #500 error is: 0.480387181059822
#> Epoch: Iteration #600 error is: 0.32605649795734
#> Epoch: Iteration #700 error is: 0.310817256441691
#> Epoch: Iteration #800 error is: 0.295704207004553
#> Epoch: Iteration #900 error is: 0.282002218304907
#> Epoch: Iteration #1000 error is: 0.250345074714285
results$plot