pegasus.umap

pegasus.umap(data, rep='pca', n_components=2, n_neighbors=15, min_dist=0.5, spread=1.0, random_state=0, out_basis='umap')[source]

Calculate UMAP embedding of cells.

This function uses umap-learn package. See [McInnes18] for details on UMAP.

Parameters
  • data (pegasusio.MultimodalData) – Annotated data matrix with rows for cells and columns for genes.

  • rep (str, optional, default: "pca") – Representation of data used for the calculation. By default, use PCA coordinates. If None, use the count matrix data.X.

  • n_components (int, optional, default: 2) – Dimension of calculated UMAP coordinates. By default, generate 2-dimensional data for 2D visualization.

  • n_neighbors (int, optional, default: 15) – Number of nearest neighbors considered during the computation.

  • min_dist (float, optional, default: 0.5) – The effective minimum distance between embedded data points.

  • spread (float, optional, default: 1.0) – The effective scale of embedded data points.

  • random_state (int, optional, default: 0) – Random seed set for reproducing results.

  • out_basis (str, optional, default: "umap") – Key name for calculated UMAP coordinates to store.

Return type

None

Returns

  • None

  • Update data.obsm

    • data.obsm['X_' + out_basis]: UMAP coordinates of the data.

Examples

>>> pg.umap(data)