spac.transformations.run_umap(adata, n_neighbors=75, min_dist=0.1, n_components=2, metric='euclidean', random_state=0, transform_seed=42, layer=None, output_derived_feature='X_umap', associated_table=None, **kwargs)[source]

Perform UMAP analysis on the specific layer of the AnnData object or the default data.

Parameters:
  • adata (AnnData) – Annotated data matrix.

  • n_neighbors (int, default=75) – Number of neighbors to consider when constructing the UMAP. This influences the balance between preserving local and global structures in the data.

  • min_dist (float, default=0.1) – Minimum distance between points in the UMAP space. Controls how tightly the embedding is allowed to compress points together.

  • n_components (int, default=2) – Number of dimensions for embedding.

  • metric (str, optional) – Metric to compute distances in high dimensional space. Check https://umap-learn.readthedocs.io/en/latest/api.html for options. The default is ‘euclidean’.

  • random_state (int, default=0) – Seed used by the random number generator(RNG) during UMAP fitting.

  • transform_seed (int, default=42) – RNG seed during UMAP transformation.

  • layer (str, optional) – Layer of AnnData object for UMAP. Defaults to adata.X.

  • output_derived_feature (str, default='X_umap') – The name of the column in adata.obsm that will contain the umap coordinates.

  • associated_table (str, optional) – If set, use the corresponding key adata.obsm to calcuate the UMAP. Takes priority over the layer argument.

Returns:

adata – Updated AnnData object with UMAP coordinates stored in the obsm attribute. The key for the UMAP embedding in obsm is “X_umap” by default.

Return type:

anndata.AnnData