scFates.pp.diffusion

Contents

scFates.pp.diffusion#

scFates.pp.diffusion(adata, n_components=10, knn=30, alpha=0, multiscale=True, n_eigs=None, device='cpu', n_pcs=50, save_uns=False, copy=False)#

Wrapper to generate diffusion maps using Palantir.

Parameters:
adata AnnData

Annotated data matrix.

n_components int (default: 10)

Number of diffusion components.

knn int (default: 30)

Number of nearest neighbors for graph construction.

alpha float (default: 0)

Normalization parameter for the diffusion operator.

multiscale bool (default: True)

Whether to get mutliscale diffusion space (calls palantir.utils.determine_multiscale_space).

n_eigs Optional[int] (default: None)

if multiscale is True, how much components to retain.

device Literal['cpu', 'gpu'] (default: 'cpu')

Run method on either cpu or on gpu.

do_PCA

Whether to perform PCA or not.

n_pcs int (default: 50)

Number of PC components.

seed

Get reproducible results for the GPU implementation.

copy bool (default: False)

Return a copy instead of writing to adata.

Returns:

adata : anndata.AnnData if copy=True it returns AnnData, else it update field to adata:

.obsm[‘X_diffusion’]

if multiscale = False, diffusion space.

.obsm[‘X_multiscale_diffusion’]

if multiscale = True, multiscale diffusion space.

.uns[‘diffusion’]

dict containing results from Palantir.