stlearn.pl.ccinet_plot

stlearn.pl.ccinet_plot(adata: AnnData, use_label: str, lr: Optional[str] = None, pos: Optional[dict] = None, return_pos: bool = False, cmap: str = 'default', font_size: int = 12, node_size_exp: int = 1, node_size_scaler: int = 1, min_counts: int = 0, sig_interactions: bool = True, fig: Optional[Figure] = None, ax: Optional[Axes] = None, pad=0.25, title: Optional[str] = None, figsize: tuple = (10, 10))[source]

Circular celltype-celltype interaction network based on LR-CCI analysis. The size of the nodes drawn for each cell type indicates the total no. of spot interactions that cell type is involved in; while the color of the arrows between nodes is coloured by the total no. of interactions between those particular cell types.

Parameters:
  • adata (AnnData) – Data on which st.tl.cci.run & st.tl.cci.run_cci has been applied.

  • use_label (str) – Indicates the cell type labels or deconvolution results used for cell-cell interaction counting by LR pairs.

  • lr (str) – The LR pair to visualise the cci network for. If None, will use spot cci counts across all LR pairs from adata.uns[f’lr_cci_{use_label}’].

  • pos (dict) – Positions to draw each cell type, format as outputted from running networkx.circular_layout(graph). If not inputted will be generated.

  • return_pos (bool) – Whether to return the positions of the cell types drawn or not; useful for input back into this function via the ‘pos’ parameter to get consistent positioning of the cell types when plotting for different LR pairs.

  • cmap (str) – Cmap to use when generating the cell colors, if not already specified by adata.uns[f’{use_label}_colors’].

  • font_size (int) – Size of the cell type labels.

  • node_size_scaler (float) – Scaler to multiply by node sizes to increase/decrease size.

  • node_size_exp (int) – Increases difference between node sizes by this exponent.

  • min_counts (int) – Minimum no. of LR interactions for connection to be drawn.

Returns:

pos – Dictionary of positions where the nodes are draw if return_pos is True, useful for consistent layouts.

Return type:

dict