ehrapy.plot.paga_path(adata, nodes, keys, use_raw=True, annotations=('dpt_pseudotime',), color_map=None, color_maps_annotations=mappingproxy({'dpt_pseudotime': 'Greys'}), palette_groups=None, n_avg=1, groups_key=None, xlim=(None, None), title=None, left_margin=None, ytick_fontsize=None, title_fontsize=None, show_node_names=True, show_yticks=True, show_colorbar=True, legend_fontsize=None, legend_fontweight=None, normalize_to_zero_one=False, as_heatmap=True, return_data=False, show=None, save=None, ax=None)[source]#

Feature changes along paths in the abstracted graph.

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

  • nodes (Sequence[str | int]) – A path through nodes of the abstracted graph, that is, names or indices (within .categories) of groups that have been used to run PAGA.

  • keys (Sequence[str]) – Either variables in adata.var_names or annotations in adata.obs. They are plotted using color_map.

  • use_raw (bool) – Use adata.raw for retrieving feature values if it has been set.

  • annotations (Sequence[str]) – Plot these keys with color_maps_annotations. Need to be keys for adata.obs.

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

  • color_maps_annotations (Mapping[str, str | Colormap]) – Color maps for plotting the annotations. Keys of the dictionary must appear in annotations.

  • palette_groups (Sequence[str] | None) – Usually, use the same… as used for coloring the abstracted graph.

  • n_avg (int) – Number of data points to include in computation of running average.

  • groups_key (str | None) – Key of the grouping used to run PAGA. If None, defaults to adata.uns[‘paga’][‘groups’].

  • xlim (tuple[int | None, int | None]) – Matplotlib x limit.

  • title (str | None) – Plot title.

  • left_margin – Margin to the left of the plot.

  • ytick_fontsize (int | None) – Matplotlib ytick fontsize.

  • title_fontsize (int | None) – Font size of the title.

  • show_node_names (bool) – Whether to plot the node names on the nodes bar.

  • show_yticks (bool) – Whether to show the y axis ticks.

  • show_colorbar (bool) – Whether to show the color bar.

  • legend_fontsize (Union[int, float, Literal['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'], None]) – Font size of the legend.

  • legend_fontweight (Union[int, Literal['light', 'normal', 'medium', 'semibold', 'bold', 'heavy', 'black'], None]) – Font weight of the legend.

  • normalize_to_zero_one (bool) – Shift and scale the running average to [0, 1] per feature.

  • as_heatmap (bool) – Whether to display the plot as heatmap.

  • return_data (bool) – Whether to return the timeseries data in addition to the axes if True.

  • ax (Axes | None) – Matplotlib Axis object.

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

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

Return type:

Axes | None


A Axes object, if ax is None, else None. If return_data, return the timeseries data in addition to an axes.