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")
#> Warning: the condition has length > 1 and only the first element will be used
#> 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: 17.5527601116614
#> Epoch: Iteration #200 error is: 1.24507480596162
#> Epoch: Iteration #300 error is: 0.576592257543887
#> Epoch: Iteration #400 error is: 0.347454049345548
#> Epoch: Iteration #500 error is: 0.250975118340985
#> Epoch: Iteration #600 error is: 0.231231480751805
#> Epoch: Iteration #700 error is: 0.218904084428896
#> Epoch: Iteration #800 error is: 0.212953899514953
#> Epoch: Iteration #900 error is: 0.210685915592865
#> Epoch: Iteration #1000 error is: 0.208776239231956
results$plot