liana.plotting.connectivity

Contents

liana.plotting.connectivity#

liana.plotting.connectivity(adata, idx, spatial_key='spatial', connectivity_key='spatial_connectivities', size=1, figure_size=(5.4, 5), return_fig=True)#

Plot spatial connectivity weights.

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

  • idx (int) – Column index of the connectivity weights to plot.

  • spatial_key (str (default: 'spatial')) – Key in adata.obsm that contains the spatial coordinates. Default is 'spatial'.

  • connectivity_key (str (default: 'spatial_connectivities')) – Key in adata.obsp that contains the spatial connectivity matrix. Default is 'spatial_connectivity'.

  • size (float (default: 1)) – Size of the points

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

  • return_fig (bool (default: True)) – bool whether to return the fig object.

Return type:

Figure

Returns:

The resulting connectivity plot.

Raises:

AssertionError – If connectivity_key or spatial_key are not in adata.obsp or adata.obsm respectively.