TsneState

TsneState

This creates a t-SNE embedding based on the neighbor index constructed by NeighborIndexState. This wraps runTSNE and related functions from scran.js.

Methods not documented here are not part of the stable API and should not be used by applications.

Classes

TsneState

Methods

animate()

Description:
  • Repeat the animation iterations. It is assumed that setVisualizationAnimate has been set appropriately to process each iteration.

Source:
Returns:

A promise that resolves on successful completion of all iterations.

compute(parameters)

Description:
  • This method should not be called directly by users, but is instead invoked by runAnalysis.

Source:
Parameters:
Name Type Description
parameters object

Parameter object, equivalent to the tsne property of the parameters of runAnalysis.

Properties
Name Type Description
perplexity number

Number specifying the perplexity for the probability calculations.

iterations number

Number of iterations to run the algorithm.

animate boolean

Whether to process animation iterations, see setVisualizationAnimate for details.

Returns:

t-SNE coordinates are computed in parallel on a separate worker thread. A promise is returned that resolves when those calculations are complete.

fetchParameters() → {object}

Source:
Returns:

Object containing the parameters.

Type
object

(async) fetchResults(optionsopt) → {object}

Source:
Parameters:
Name Type Attributes Default Description
options object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
copy boolean <optional>
true

Whether to create a copy of the coordinates, if the caller might mutate them.

Returns:

Object containing:

  • x: a Float64Array containing the x-coordinate for each cell.
  • y: a Float64Array containing the y-coordinate for each cell.
  • iterations: the number of iterations processed.
Type
object