Spatial map of dominant sender-receiver cell-type pairs at BLISA hotspots
Source:R/plotCCIspatial.R
plotCCIspatial.RdFor 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 immediate neighbourhood.
Usage
plotCCIspatial(
x,
counts_by_group,
index = 1,
ligand = NULL,
receptor = NULL,
top_pairs = 30
)Arguments
- x
A
blisaobject as returned byblisa.- counts_by_group
Named list of gene-by-bin count matrices, one per cell type. Typically the
counts_by_groupelement returned byhexBinCells. Names must match the cell-type levels.- index
Integer. Row index into
x$LR_resultsselecting the ligand-receptor pair to visualise. Ignored when bothligandandreceptorare supplied. Default1(top-ranked pair).- ligand
Character. Ligand gene symbol. When both
ligandandreceptorare provided the matching LR pair is located automatically andindexis ignored. Must be supplied together withreceptor.- 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". Default30.
See also
plotHotspots for a significance-based spatial map of
hotspot bins.
Examples
if (FALSE) { # \dontrun{
# 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)
} # }