% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/panoramic-spatialstats.R
\name{.one_pair_one_sample}
\alias{.one_pair_one_sample}
\title{Internal: compute spatial stats for one pair in one sample}
\usage{
.one_pair_one_sample(
  meta,
  ct1,
  ct2,
  stat = "local_comp_enrichment",
  nsim = 100,
  correction = "translate",
  radii_um,
  verbose = FALSE,
  boot = c("approx", "block"),
  tile_size = NULL,
  nx = NULL,
  ny = NULL,
  local_comp_cache = NULL
)
}
\arguments{
\item{meta}{The \code{metadata$panoramic} list for one sample, containing at least a spatstat \code{ppp} object and a \code{marks_tab} table.}

\item{ct1, ct2}{Character. Cell-type labels.}

\item{stat}{Character. Summary statistic. Default is
\code{"local_comp_enrichment"}. Other options are \code{"Lcross"},
\code{"Kcross"}, \code{"Lest"}, and \code{"Kest"}.}

\item{nsim}{Integer. Number of Loh bootstrap simulations.}

\item{correction}{Character. Edge correction passed to spatstat.}

\item{radii_um}{Numeric vector of radii (microns) on which to summarize.}

\item{boot}{Character. Bootstrap mode: \code{"approx"} (no tiling) or
\code{"block"} (tiled Loh bootstrap).}

\item{tile_size}{Optional numeric scalar giving tile size in the same units
as spatial coordinates. Used only when \code{boot = "block"}.}

\item{nx, ny}{Optional integers giving the number of tiles in x/y directions
when \code{boot = "block"}.}

\item{local_comp_cache}{Optional cache object from
\code{.precompute_local_comp_cache()} to avoid repeated neighbor searches
when \code{stat = "local_comp_enrichment"}.}
}
\value{
A data.frame with columns \code{radius_um}, \code{yi}, and \code{vi}, filled with \code{NA} if insufficient cells of either type are present.
}
\description{
Compute a spatial summary curve and bootstrap variance for a single
cell-type pair within a single prepared sample, evaluated on a common
radius grid.
}
\keyword{internal}
