interscale.evaluation.plot_flow_clusters

interscale.evaluation.plot_flow_clusters#

interscale.evaluation.plot_flow_clusters(cluster_grid, X_lin, Y_lin, adata_slice, fov_id, fov_key='fov', cell_type_col=None, **kwargs)#

Visualize identified flow domains as a segmented background for spatial transcriptomics data.

This function overlays a Voronoi-like heatmap (representing clustered interaction patterns) with the actual cell positions to provide spatial context to the unsupervised domains.

Parameters:
  • cluster_grid (numpy.ndarray) – 2D array of cluster IDs assigned to each grid point.

  • X_lin (numpy.ndarray) – 1D array of X-axis coordinates for the grid.

  • Y_lin (numpy.ndarray) – 1D array of Y-axis coordinates for the grid.

  • adata_slice (anndata.AnnData) – The sliced AnnData object for the current FOV.

  • fov_id (str) – The specific Field of View identifier.

  • fov_key (str) – The key in adata.obs for FOVs. Defaults to “fov”.

  • cell_type_col (str) – The column to use for coloring cells in the scatter plot.

  • **kwargs – Additional arguments passed to squidpy.pl.spatial_scatter.

Returns:

-fig (Figure)

The figure object.

-ax (Axes)

The axes object.