scvelo.utils.get_moments(adata, layer=None, second_order=None, centered=True, mode='connectivities')

Computes moments for a specified layer.

First and second order moments. If centered, that corresponds to means and variances across nearest neighbors.

adata: AnnData

Annotated data matrix.

layer: str (default: None)

Key of layer with abundances to consider for moment computation.

second_order: bool (default: None)

Whether to compute second order moments from abundances.

centered: bool (default: True)

Whether to compute centered (=variance) or uncentered second order moments.

mode: ‘connectivities’ or ‘distances’ (default: ‘connectivities’)

Distance metric to use for moment computation.


Mx (first or second order moments)