metachat.pl.plot_summary_pathway
- metachat.pl.plot_summary_pathway(ms_result=None, metapathway_rank=None, senspathway_rank=None, plot_metapathway_index=None, plot_senspathway_index=None, figsize=(10, 10), plot_savepath=None)[source]
Plot a Sankey diagram summarizing metabolic cell communication between metabolite and sensor pathways.
This function visualizes how metabolite pathways contribute to sensor pathways based on group-level MCC results. Each link represents the overall communication score between a metabolite pathway (source) and a sensor pathway (target), scaled by interaction intensity.
Parameters
- ms_resultpandas.DataFrame
A matrix of pathway-level metabolic communication scores. Rows correspond to metabolite pathways, columns to sensor pathways. Typically generated from
mc.tl.summary_pathway().- metapathway_rankpandas.DataFrame
DataFrame containing metabolite pathway rankings.
- senspathway_rankpandas.DataFrame
DataFrame containing sensor pathway rankings.
- plot_metapathway_indexlist of int
Indices (in
metapathway_rank) of metabolite pathways to include in the Sankey diagram.- plot_senspathway_indexlist of int
Indices (in
senspathway_rank) of sensor pathways to include in the Sankey diagram.- figsizetuple of float, default=(10, 10)
Figure size (width, height) in inches.
- plot_savepathstr, optional
Path to save the plot as a static image (e.g.,
"results/pathway_summary.pdf"). The format is inferred from the file extension. IfNone, the figure will be displayed interactively.
Returns
- figplotly.graph_objects.Figure
The Sankey diagram figure object.
Notes
This function requires results computed by
mc.tl.summary_pathway().Each node represents a pathway; link width corresponds to relative communication strength.
Scores are log-scaled and rescaled for better visual contrast.