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 :
AnnData
AnnData
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 inadata.obs
. They are plotted usingcolor_map
.- use_raw :
bool
bool
(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 foradata.obs
.- color_map :
Colormap
|str
|None
Union
[Colormap
,str
,None
] (default:None
) Matplotlib colormap.
- color_maps_annotations :
Mapping
Mapping
[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
] |None
Optional
[Sequence
[str
]] (default:None
) Ususally, use the same
sc.pl.palettes...
as used for coloring the abstracted graph.- n_avg :
int
int
(default:1
) Number of data points to include in computation of running average.
- groups_key :
str
|None
Optional
[str
] (default:None
) Key of the grouping used to run PAGA. If
None
, defaults toadata.uns['paga']['groups']
.- as_heatmap :
bool
bool
(default:True
) Plot the timeseries as heatmap. If not plotting as heatmap,
annotations
have no effect.- show_node_names :
bool
bool
(default:True
) Plot the node names on the nodes bar.
- show_colorbar :
bool
bool
(default:True
) Show the colorbar.
- show_yticks :
bool
bool
(default:True
) Show the y ticks.
- normalize_to_zero_one :
bool
bool
(default:False
) Shift and scale the running average to [0, 1] per gene.
- return_data :
bool
bool
(default:False
) Return the timeseries data in addition to the axes if
True
.- show :
bool
|None
Optional
[bool
] (default:None
) Show the plot, do not return axis.
- save :
str
|bool
|None
Union
[str
,bool
,None
] (default:None
) If
True
or astr
, save the figure. A string is appended to the default filename. Infer the filetype if ending on {'.pdf'
,'.png'
,'.svg'
}.- ax :
Axes
|None
Optional
[Axes
] (default:None
) A matplotlib axes object.
- adata :
- Return type
- Returns
A
Axes
object, ifax
isNone
, elseNone
. Ifreturn_data
, return the timeseries data in addition to an axes.