plastro.plasticity.visualize_walk

plastro.plasticity.visualize_walk(ad: AnnData, walk_indices: ndarray, save_to: str | None = None, show_plots: bool = False) None[source]

Visualize a random walk path on UMAP coordinates.

Creates a scatter plot showing the path of a single random walk, with origin and target cells highlighted.

Parameters:
  • ad (anndata.AnnData) – AnnData object containing UMAP coordinates in obsm[‘X_umap’].

  • walk_indices (np.ndarray) – 1D array of cell indices representing the walk path.

  • save_to (str, optional) – Directory to save the plot, by default None.

  • show_plots (bool, optional) – Whether to display plots interactively, by default False.

Examples

>>> _, _, walks = perform_random_walk(ad, ['Cell_1'])
>>> visualize_walk(ad, walks[0])

Notes

  • Requires UMAP coordinates in ad.obsm[‘X_umap’]

  • Origin cell is marked with a black star

  • Target cell is marked with a red star

  • Intermediate cells are colored with a gradient