dynamo.tl.stationary_distribution(adata, method='kmc', direction='both', calc_rnd=True)[source]

Compute stationary distribution of cells using the transition matrix.

Update the AnnData object with source, sink stationary distributions and the randomized results, depending on the direction and calc_rnd arguments.

  • adata (AnnData) – an AnnData object.

  • method (str) – the method to calculate the stationary distribution. Defaults to “kmc”.

  • direction (Literal['both', 'forward', 'backward']) – the direction of diffusion for calculating the stationary distribution, can be one of both, forward, backward. Defaults to “both”.

  • calc_rnd (bool) – whether to also calculate the stationary distribution from the control randomized transition matrix. Defaults to True.

Return type: