ehrapy.plot.dpt_timeseries

Contents

ehrapy.plot.dpt_timeseries#

ehrapy.plot.dpt_timeseries(edata, color_map=None, as_heatmap=True, show=None, save=None)[source]#

Heatmap of pseudotime series.

Parameters:
  • edata (EHRData) – Central data object.

  • color_map (str | Colormap | None, default: None) – Matplotlib Colormap

  • as_heatmap (bool, default: True) – Whether to render the plot a heatmap

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

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

Examples

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