rapids_singlecell.tl.diffmap#
- rapids_singlecell.tl.diffmap(adata, n_comps=15, *, sort='decrease', density_normalize=True, rng=None, use=None, out=False, neighbors_key=None, key_added=None)[source]#
Diffusion Maps [CLL+05, HBT15].
Diffusion maps has been proposed for visualizing single-cell data. This is a reimplementation of scanpys function.
The width (“sigma”) of the connectivity kernel is implicitly determined by the number of neighbors used to compute the single-cell graph in
scanpy.pp.neighbors()orneighbors().- Parameters:
- adata
AnnData Annotated data matrix.
- n_comps
int(default:15) The number of dimensions of the representation.
- sort
Literal['decrease','increase'] (default:'decrease') Leave as is for the same behavior as
scanpy.tl.diffmap().- density_normalize
bool(default:True) Leave as is for the same behavior as
scanpy.tl.diffmap().- rng
int|integer|Sequence[int] |SeedSequence|Generator|BitGenerator|None(default:None) Random seed or
Generatorfor reproducibility. The supersededrandom_stateargument is still accepted.- use
GraphAcc|str|None(default:None) The neighborhood graph (connectivities) to use, e.g.
A.obsp['k']. Strings are resolved byanndata.acc.AdAcc.resolve(), e.g.'obsp.k'. IfNone, the oneneighbors()wrote by default.- out
MultiAcc|str|bool(default:False) Where to write the embedding, e.g.
A.obsm['dm']; the eigenvalues go to.uns['dm']['evals']. IfTrue, the embedding is returned instead. IfFalse, it is written to the default places below.
- adata
- Return type:
- Returns:
The embedding if
out=True, elseNone. By default sets (seeoutfor other keys):adata.obsm['X_diffmap']numpy.ndarrayDiffusion map representation of data, which is the right eigen basis of the transition matrix with eigenvectors as columns.
adata.uns['diffmap_evals']numpy.ndarrayArray of size (number of eigen vectors). Eigenvalues of transition matrix.