Sankey plot function

cellhint.sankeyplot(alignment, node_color: DataFrame | None = None, novel_node_color: str = '#FFFFFF', remain_node_color: str = '#F0F0F0', link_color: str | None = None, title: str = 'CellHint label harmonization', show: bool = True, save: str | bool = False, width: int | None = None, height: int | None = None, layout_dict: dict = {}, trace_dict: dict = {}, expand_label: bool = False) None[source]

Generate a Sankey diagram showing the CellHint label harmonization in a qualitative manner.

Parameters:
  • alignment – A DistanceAlignment or DataFrame object representing the harmonization result.

  • node_color – A DataFrame with three consecutive columns representing dataset, cell type, and color, respectively. Default to a color scheme that allows matched cell types to have the same colors.

  • novel_node_color – Color of dataset-specific (i.e., novel) cell types. (Default: ‘#FFFFFF’)

  • remain_node_color – Color of remaining unresolved cell types. (Default: ‘#F0F0F0’)

  • link_color – Color of links. Default to translucent grey as used in plotly.

  • title – Figure title. (Default: ‘CellHint label harmonization’)

  • show – Whether to show the plot. (Default: True)

  • save – Whether to save the plot. This can also be a figure filename. Supported figure suffixes are: .html, .png, .jpg, .jpeg, .webp, .svg, .pdf, .eps. (Default: False)

  • width – Figure width in pixels. Default to 700 in a canonical Plotly setting.

  • height – Figure height in pixels. Default to 450 in a canonical Plotly setting.

  • layout_dict – A dict passed to the method .update_layout of plotly.graph_objects.Figure for setting the figure layout. Example keys include plot_bgcolor which sets the plot area color, font_color which sets the text color, font_size which sets the text size, etc.

  • trace_dict – A dict passed to the method .update_traces of plotly.graph_objects.Figure for setting the Sankey plot. Example keys include note_pad which sets the padding between nodes, link_line_color which sets the link border color, orientation which sets the plot orientation, etc.

  • expand_label – Ignored. Whether to show the unique expanded labels. Only for developer use. (Default: False)

Return type:

None