snapatac2.tl.umap#

snapatac2.tl.umap(adata, n_comps=2, use_dims=None, use_rep='X_spectral', key_added='umap', random_state=0, inplace=True, **kwargs)[source]#
Parameters:
  • adata (AnnData | AnnDataSet | ndarray) – The annotated data matrix.

  • n_comps (int) – The number of dimensions of the embedding.

  • use_dims (int | list[int] | None) – Use these dimensions in use_rep.

  • use_rep (str) – Use the indicated representation in .obsm.

  • key_added (str) – adata.obs key under which to add the cluster labels.

  • random_state (int | None) – Random seed.

  • inplace (bool) – Whether to store the result in the anndata object.

  • **kwargs – Other parameters defined in umap.UMAP

Returns:

if inplace=True it stores UMAP embedding in adata.obsm["X_`key_added”]`. Otherwise, it returns the result as a numpy array.

Return type:

np.ndarray | None