swiftcnv.plot_alluvial#
- plot_alluvial(adata, cell_type_key='cell_type', col2='CNV_classif', col3='malignant_classif', color_dict=None, figsize=(12, 6), gap_ratio=0, category_fontsize=10, column_fontsize=9, ax=None)#
Plot an alluvial diagram showing malignant classification of original cell type labels.
- Parameters:
adata (anndata.AnnData) – Input AnnData object.
cell_type_key (str, default 'cell_type') – Key of the obs layer used as the first column in the alluvial plot.
col2 (str, default 'CNV_classif') – Key of the obs layer used as the second column in the alluvial plot.
col3 (str, default 'malignant_classif') – Key of the obs layer used as the third column in the alluvial plot.
color_dict (dict, optional) – Dictionary mapping category labels (typically from
col3) to color codes. If None, a default classification color palette is used.figsize (tuple, default (12, 6)) – Tuple defining the width and height of the matplotlib figure.
gap_ratio (float, default 0) – Ratio controlling the proportion of vertical spacing allocated between category boxes within columns.
category_fontsize (int, default 10) – Font size for category text labels displayed inside the node boxes.
column_fontsize (int, default 9) – Font size for the column header labels on the x-axis.
ax (matplotlib.axes.Axes, optional) – Pre-existing Matplotlib Axes object to plot onto. If None, a new figure and axes are created.
- Returns:
Returns None after rendering the plot or displaying it via
plt.show().- Return type:
None