% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllClasses.R, R/spicy.R
\docType{class}
\name{SpicyResults-class}
\alias{SpicyResults-class}
\alias{SpicyResults,list,ANY-method}
\alias{spicy}
\alias{spicy,spicy-method}
\title{Performs spatial tests on spatial cytometry data.}
\usage{
spicy(
  cells,
  condition = NULL,
  subject = NULL,
  covariates = NULL,
  from = NULL,
  to = NULL,
  alternateResult = NULL,
  verbose = TRUE,
  weights = TRUE,
  weightsByPair = FALSE,
  weightFactor = 1,
  window = "convex",
  window.length = NULL,
  BPPARAM = BiocParallel::SerialParam(),
  sigma = NULL,
  Rs = NULL,
  minLambda = 0.05,
  edgeCorrect = TRUE,
  includeZeroCells = FALSE,
  imageID = "imageID",
  cellType = "cellType",
  spatialCoords = c("x", "y"),
  ...
)
}
\arguments{
\item{cells}{A SegmentedCells or data frame that contains at least the  variables x and
y, giving the location coordinates of each cell, and cellType.}

\item{condition}{Vector of conditions to be tested corresponding to each image if cells is
a data frame.}

\item{subject}{Vector of subject IDs corresponding to each image if cells is
a data frame.}

\item{covariates}{Vector of covariate names that should be included in the
mixed effects model as fixed effects.}

\item{from}{vector of cell types which you would like to compare to the to vector}

\item{to}{vector of cell types which you would like to compare to the from vector}

\item{alternateResult}{An pairwise association statistic between each combination of celltypes in each image.}

\item{verbose}{logical indicating whether to output messages.}

\item{weights}{logical indicating whether to include weights based on cell counts.}

\item{weightsByPair}{logical indicating whether weights should be calculated for each cell type
pair.}

\item{weightFactor}{numeric that controls the convexity of the weight function.}

\item{window}{Should the window around the regions be 'square', 'convex' or 'concave'.}

\item{window.length}{A tuning parameter for controlling the level of concavity when estimating
concave windows.}

\item{BPPARAM}{A BiocParallelParam object.}

\item{sigma}{A numeric variable used for scaling when fitting inhomogeneous L-curves.}

\item{Rs}{A vector of radii that the measures of association should be calculated.}

\item{minLambda}{Minimum value for density for scaling when fitting inhomogeneous L-curves.}

\item{edgeCorrect}{A logical indicating whether to perform edge correction.}

\item{includeZeroCells}{A logical indicating whether to include cells with zero counts in the
pairwise association calculation.}

\item{imageID}{The image ID if using SingleCellExperiment.}

\item{cellType}{The cell type if using SingleCellExperiment.}

\item{spatialCoords}{The spatial coordinates if using a SingleCellExperiment.}

\item{...}{Other options.}
}
\value{
Data frame of p-values.
}
\description{
Performs spatial tests on spatial cytometry data.
}
\examples{
data("diabetesData")

# Test with random effect for patient on a pairwise combination of cell
# types.
spicy(diabetesData,
  condition = "stage", subject = "case",
  from = "Tc", to = "Th"
)

# Test all pairwise combinations of cell types without random effect of
# patient.
# spicyTest <- spicy(diabetesData, condition = "stage", subject = "case")

# Test all pairwise combination of cell types with random effect of patient.
# spicy(diabetesData, condition = "condition", subject = "subject")

}
