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: