plotCCIspatial: Spatial map of dominant sender-receiver cell-type pairs at...

View source: R/plotCCIspatial.R

plotCCIspatialR Documentation

Spatial map of dominant sender-receiver cell-type pairs at BLISA hotspots

Description

For a selected ligand-receptor pair, identifies the dominant interacting cell-type pair at each significant hotspot bin and draws a spatial map of the tissue coloured by those pairs. Receiver cells are those inside hotspot bins; sender cells are drawn from the neighbouring bins defined by the LR pair's signalling mode.

Usage

plotCCIspatial(
  x,
  counts_by_group,
  index = 1,
  ligand = NULL,
  receptor = NULL,
  top_pairs = 30,
  weighted = TRUE
)

Arguments

x

A blisa object as returned by blisa.

counts_by_group

Named list of gene-by-bin count matrices, one per cell type. Typically the counts_by_group element returned by hexBinCells. Names must match the cell-type levels.

index

Integer. Row index into x$LR_results selecting the ligand-receptor pair to visualise. Ignored when both ligand and receptor are supplied. Default 1 (top-ranked pair).

ligand

Character. Ligand gene symbol. When both ligand and receptor are provided the matching LR pair is located automatically and index is ignored. Must be supplied together with receptor.

receptor

Character. Receptor gene symbol. Must be supplied together with ligand.

top_pairs

Integer. Maximum number of distinct cell-type pairs to show in the legend; remaining pairs are grouped as "rare pairs". Default 30.

weighted

Logical. If TRUE (default), the ligand contribution of each sender cell type at hotspot h is \sum_{j \in N(h)} w_{hj} L_j, using the same neighbours and row-standardised spatial weights as the bivariate Moran's I test (the hotspot bin itself is excluded). If FALSE, ligand counts are summed without weights over the hotspot bin and its neighbours.

Value

A ggplot object.

See Also

plotHotspots for a significance-based spatial map of hotspot bins.

Examples

## Not run: 
# Continuing from the blisa() example:
# result <- blisa(spe, bin_size = 50, group = "cell_type")
binned <- hexBinCells(
  as.data.frame(SpatialExperiment::spatialCoords(spe)),
  SummarizedExperiment::assay(spe, "counts"),
  bin_size = 50, group = spe$cell_type
)
plotCCIspatial(result, binned$counts_by_group, index = 1)

## End(Not run)

blisa documentation built on Oct. 30, 2026, 9:10 a.m.