ehrapy.plot.dpt_groups_pseudotime

ehrapy.plot.dpt_groups_pseudotime(adata, color_map=None, palette=None, show=None, save=None)[source]

Plot groups and pseudotime.

Parameters:
  • adata (AnnData) – AnnData object object containing all observations.

  • color_map (str | Colormap | None) – Matplotlib Colormap

  • palette (Sequence[str] | Cycler | None) – Matplotlib color Palette

  • show (bool | None) – Whether to show the plot.

  • save (bool | str | None) – Whether to save the plot or a path to save the plot.

Examples

>>> import ehrapy as ep
>>> import numpy as np
>>> adata = ep.dt.mimic_2(encoded=True)
>>> ep.pp.knn_impute(adata)
>>> ep.pp.log_norm(adata, offset=1)
>>> ep.pp.neighbors(adata, method="gauss")
>>> ep.tl.leiden(adata, resolution=0.5, key_added="leiden_0_5")
>>> ep.tl.diffmap(adata, n_comps=10)
>>> adata.uns["iroot"] = np.flatnonzero(adata.obs["leiden_0_5"] == "0")[0]
>>> ep.tl.dpt(adata, n_branchings=3)
>>> ep.pl.dpt_groups_pseudotime(adata)
Preview:
../../_images/dpt_groups_pseudotime.png