metachat.pl.plot_LRC_markers
- metachat.pl.plot_LRC_markers(adata, LRC_name, LRC_marker_genes, avg=False, figsize=(10, 5), plot_savepath=None)[source]
Visualize expression of LRC (Long-Range Channel) marker genes in spatial omics data.
This function plots the spatial expression of selected LRC marker genes. It can either visualize individual genes separately or compute and plot the average expression of all selected markers.
Parameters
- adataanndata.AnnData
Annotated data matrix with spatial coordinates stored in
adata.obsm["spatial"].- LRC_namestr
Name tag for the LRC type (e.g., “CSF”, “Blood”). Used in plot titles and output naming.
- LRC_marker_geneslist
List of LRC marker gene names to visualize. Genes not found in
adata.var_namesare automatically skipped.- avgbool, default=False
If True, plots the average expression of all marker genes. If False, plots each gene separately.
- figsizetuple of float, default=(10, 5)
Figure size (width, height) in inches.
- plot_savepathstr, optional
Path to save the figure (e.g.
"results/LRC_markers_Blood.pdf"). If None, the figure is displayed interactively.
Returns
- axmatplotlib.axes.Axes or list of Axes
Matplotlib axis or list of axes containing the rendered plot(s).
Notes
Marker genes are filtered to retain only those present in
adata.var_names.Average expression is computed directly from
adata.X(converted to dense if needed).When multiple genes are plotted, they are arranged in a single row of subplots.