scanpy.pl.paga_path

scanpy.pl.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)

Gene expression and annotation changes along paths in the abstracted graph.

Parameters
adata : AnnDataAnnData

An annotated data matrix.

nodes : Sequence[Union[str, int]]Sequence[Union[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]Sequence[str]

Either variables in adata.var_names or annotations in adata.obs. They are plotted using color_map.

use_raw : boolbool (default: True)

Use adata.raw for retrieving gene expressions if it has been set.

annotations : Sequence[str]Sequence[str] (default: ('dpt_pseudotime',))

Plot these keys with color_maps_annotations. Need to be keys for adata.obs.

color_map : Colormap | str | NoneUnion[Colormap, str, None] (default: None)

Matplotlib colormap.

color_maps_annotations : MappingMapping[str, Union[str, Colormap]] (default: mappingproxy({'dpt_pseudotime': 'Greys'}))

Color maps for plotting the annotations. Keys of the dictionary must appear in annotations.

palette_groups : Sequence[str] | NoneOptional[Sequence[str]] (default: None)

Ususally, use the same sc.pl.palettes... as used for coloring the abstracted graph.

n_avg : intint (default: 1)

Number of data points to include in computation of running average.

groups_key : str | NoneOptional[str] (default: None)

Key of the grouping used to run PAGA. If None, defaults to adata.uns['paga']['groups'].

as_heatmap : boolbool (default: True)

Plot the timeseries as heatmap. If not plotting as heatmap, annotations have no effect.

show_node_names : boolbool (default: True)

Plot the node names on the nodes bar.

show_colorbar : boolbool (default: True)

Show the colorbar.

show_yticks : boolbool (default: True)

Show the y ticks.

normalize_to_zero_one : boolbool (default: False)

Shift and scale the running average to [0, 1] per gene.

return_data : boolbool (default: False)

Return the timeseries data in addition to the axes if True.

show : bool | NoneOptional[bool] (default: None)

Show the plot, do not return axis.

save : str | bool | NoneUnion[str, bool, None] (default: None)

If True or a str, save the figure. A string is appended to the default filename. Infer the filetype if ending on {'.pdf', '.png', '.svg'}.

ax : Axes | NoneOptional[Axes] (default: None)

A matplotlib axes object.

Return type

Axes | NoneOptional[Axes]

Returns

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