pegasus.diffmap

pegasus.diffmap(data, n_components=100, rep='pca', solver='eigsh', max_t=5000, n_jobs=- 1, random_state=0)[source]

Calculate Diffusion Map.

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

  • n_components (int, optional, default: 100) – Number of diffusion components to calculate.

  • rep (str, optional, default: "pca") – Embedding Representation of data used for calculating the Diffusion Map. By default, use PCA coordinates.

  • solver (str, optional, default: "eigsh") –

    Solver for eigen decomposition:
    • "eigsh": default setting. Use scipy eigsh as the solver to find eigenvalus and eigenvectors using the Implicitly Restarted Lanczos Method.

    • "randomized": Use scikit-learn randomized_svd as the solver to calculate a truncated randomized SVD.

  • max_t (float, optional, default: 5000) – pegasus tries to determine the best t to sum up to between [1, max_t].

  • n_jobs (int, optional (default: -1)) – Number of threads to use. -1 refers to using all physical CPU cores.

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

Return type

None

Returns

  • None

  • Update data.obsm

    • data.obsm["X_diffmap"]: Diffusion Map matrix of the data.

  • Update data.uns

    • data.uns["diffmap_evals"]: Eigenvalues corresponding to Diffusion Map matrix.

Examples

>>> pg.diffmap(data)