pegasus.diffmap¶
-
pegasus.
diffmap
(data, n_components=100, rep='pca', solver='eigsh', random_state=0, max_t=5000)[source]¶ Calculate Diffusion Map.
- Parameters
data (
anndata.AnnData
) – 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.
random_state (
int
, optional, default:0
) – Random seed set for reproducing results.max_t (
float
, optional, default:5000
) – pegasus tries to determine the best t to sum up to between[1, max_t]
.
- 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(adata)