scviva.tools.vision.apply_tsne#

scviva.tools.vision.apply_tsne(X, perplexity=30.0, n_iter=800)[source]#

t-SNE 2D projection via sklearn.

Mirrors R VISION’s applytSNE10 / applytSNE30. Input is expected to be the latent-space coordinates (PCA scores), matching R’s behaviour of passing t(latentSpace) to Rtsne with pca=FALSE.

Parameters:
X ndarray

Latent-space cell coordinates.

perplexity float

t-SNE perplexity, by default 30.0. Use 10.0 for the "tSNE10" variant.

n_iter int

Maximum number of optimisation iterations, by default 800 (matches R’s max_iter=800).

Return type:

ndarray

Returns:

ndarray of shape (n_cells, 2) 2D t-SNE coordinates.