SpatialQuery.spatial_query.plot_all_center_motif

spatial_query.plot_all_center_motif(ct, ids, figsize=(6, 6), save_path=None)[source]

Plot the cell type distribution of single fov.

Parameters:
  • ct (str) – Center cell type.

  • ids (dict) –

    Dictionary containing cell pairing information for correlations:
    • ’center_neighbor_motif_pair’: array of shape (n_pairs, 2) containing center-neighbor pairs for Correlation 1 (center with motif vs neighboring motif). Each row is [center_cell_idx, neighbor_cell_idx].

    • ’non-neighbor_motif_cells’: array of cell indices for distant motif cells used in Correlation 2 (center with motif vs distant motif). Correlation 2 uses all combinations of center cells (from corr1) × these cells.

    • ’non_motif_center_neighbor_pair’: array of shape (n_pairs, 2) containing center-neighbor pairs for Correlation 3 (center without motif vs neighbors). Each row is [center_cell_idx, neighbor_cell_idx]. Empty if insufficient pairs.

  • figsize (tuple, default=(6, 6)) – Figure size.

  • save_path (str, optional) – Path to save the figure. If None, the figure will not be saved.

Returns:

Displays a figure.

Return type:

None