% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plotCCIspatial.R
\name{plotCCIspatial}
\alias{plotCCIspatial}
\title{Spatial map of dominant sender-receiver cell-type pairs at BLISA hotspots}
\usage{
plotCCIspatial(
  x,
  counts_by_group,
  index = 1,
  ligand = NULL,
  receptor = NULL,
  top_pairs = 30
)
}
\arguments{
\item{x}{A \code{blisa} object as returned by \code{\link{blisa}}.}

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

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

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

\item{receptor}{Character. Receptor gene symbol. Must be supplied together
with \code{ligand}.}

\item{top_pairs}{Integer. Maximum number of distinct cell-type pairs to show
in the legend; remaining pairs are grouped as \code{"rare pairs"}. Default
\code{30}.}
}
\value{
A \code{ggplot} object.
}
\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 immediate neighbourhood.
}
\seealso{
\code{\link{plotHotspots}} for a significance-based spatial map of
hotspot bins.
}
