liana.plotting.circle_plot

Contents

liana.plotting.circle_plot#

liana.plotting.circle_plot(adata, uns_key='liana_res', liana_res=None, groupby=None, source_key='source', target_key='target', score_key=None, inverse_score=False, top_n=None, orderby=None, orderby_ascending=None, orderby_absolute=False, filter_fun=None, source_labels=None, target_labels=None, ligand_complex=None, receptor_complex=None, pivot_mode='counts', mask_mode='or', figure_size=(5, 5), edge_alpha=0.5, edge_arrow_size=10, edge_width_scale=(1, 5), node_alpha=1, node_size_scale=(100, 400), node_label_offset=(0.1, -0.2), node_label_size=8, node_label_alpha=0.7)#

Visualize the cell-cell communication network using a circular plot.

Parameters:
  • adata (AnnData) – Annotated data object.

  • uns_key (str | None (default: 'liana_res')) – Key in adata.uns that contains the LIANA results. Default is 'liana_res'.

  • liana_res (DataFrame | None (default: None)) – liana_res a DataFrame in liana’s format.

  • groupby (str (default: None)) – Key to be used for grouping.

  • source_key (str (default: 'source')) – Column name of the sender/source cell types in liana_res.

  • target_key (str (default: 'target')) – Column name of the receiver/target cell types in liana_res.

  • score_key (str (default: None)) – Column name of the score in liana_res. If None, the score is inferred from the method.

  • inverse_score (bool (default: False)) – Whether to invert the score, by default False. If True, the score will be -log10(score).

  • top_n (int (default: None)) – top_n entities to plot.

  • orderby (str | None (default: None)) – If top_n is not None, order the interactions by this column

  • orderby_ascending (bool | None (default: None)) – If top_n is not None, specify how to order the interactions

  • orderby_absolute (bool (default: False)) – If top_n is not None, whether to order by the absolute value of the orderby column.

  • filter_fun (Callable (default: None)) – A function, applied along the columns (axis=1), used to filter the results to be plotted.

  • source_labels (list[str] | str | None (default: None)) – List of labels to use as source, the rest are filtered out.

  • target_labels (list[str] | str | None (default: None)) – List of labels to use as target, the rest are filtered out.

  • ligand_complex (list[str] | str | None (default: None)) – list of ligand complexes to filter the interactions to be plotted. Defaults to None.

  • receptor_complex (list[str] | str | None (default: None)) – list of receptor complexes to filter the interactions to be plotted. Defaults to None.

  • pivot_mode (Literal['counts', 'mean'] (default: 'counts')) – The mode of the pivot table, by default ‘counts’. - ‘counts’: The number of connections between source and target. - ‘mean’: The mean of the values of score_key between source and target cell types (groupby). Note that filter_fun differs by pivot_mode: when counts it would remove all interactions that don’t pass the filter, while for ‘mean’ it would retain interactions don’t pass the filter if the same interaction passes it for any cell type pair.

  • mask_mode (Literal['and', 'or'] (default: 'or')) – The mode of the mask, by default ‘or’. - ‘or’: Include the source or target cell type. - ‘and’: Include the source and target cell type.

  • figure_size (tuple[float, float] (default: (5, 5))) – Figure x,y size

  • edge_alpha (float (default: 0.5)) – The transparency of the edges, by default .5.

  • edge_arrow_size (int (default: 10)) – The size of the arrow, by default 10.

  • edge_width_scale (tuple[float, float] (default: (1, 5))) – The scale of the edge width, by default (1, 5).

  • node_alpha (float (default: 1)) – The transparency of the nodes, by default 1.

  • node_size_scale (tuple[float, float] (default: (100, 400))) – The scale of the node size, by default (100, 400).

  • node_label_offset (tuple[float, float] (default: (0.1, -0.2))) – The offset of the node label, by default (0.1, -0.2).

  • node_label_size (int (default: 8)) – The size of the node label, by default 8.

  • node_label_alpha (float (default: 0.7)) – The transparency of the node label, by default .7.

Return type:

Axes

Returns:

The figure axes containing the circle plot.

Raises:

ValueError – If groupby is not provided