rapids_singlecell.tl.diffmap

Contents

rapids_singlecell.tl.diffmap#

rapids_singlecell.tl.diffmap(adata, n_comps=15, *, neighbors_key=None, sort='decrease', density_normalize=True)[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() or neighbors().

Parameters:
adata AnnData

Annotated data matrix.

n_comps int (default: 15)

The number of dimensions of the representation.

neighbors_key str | None (default: None)

Key in adata.uns where neighbor parameters are stored. If None, defaults to "neighbors".

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().

Return type:

None

Returns:

Updates adata with the following fields:

adata.obsm['X_diffmap']numpy.ndarray

Diffusion map representation of data, which is the right eigen basis of the transition matrix with eigenvectors as columns.

adata.uns['diffmap_evals']numpy.ndarray

Array of size (number of eigen vectors). Eigenvalues of transition matrix.