% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/estPis.R
\name{estPis}
\alias{estPis}
\title{Estimate probabilistic indices for single-molecule localization patterns}
\usage{
estPis(
  hypFrame,
  pis = c("nn", "nnPair", "edge", "centroid", "nnCell", "nnPairCell"),
  verbose = TRUE,
  null = c("background", "CSR"),
  nPointsAll = switch(null, background = 20000, CSR = 1000),
  nPointsAllWithinCell = switch(null, background = 2000, CSR = 500),
  nPointsAllWin = 1000,
  minDiff = 20,
  minObsNN = 1L,
  features = getFeatures(hypFrame),
  ...
)
}
\arguments{
\item{hypFrame}{A hyperframe}

\item{pis}{The probabilistic indices to be estimated}

\item{verbose}{A boolean, whether to report on progress of the fitting process.}

\item{null}{A character vector, indicating how the null distribution is
defined. See details.}

\item{nPointsAll, nPointsAllWithinCell}{How many points to subsample or simulate to calculate the
overall distance distribution under the null hypothesis.
The second argument (nPointsAllWithinCell) applies to within cell calculations, where a lower number usually suffises.}

\item{nPointsAllWin}{How many points to subsample or simulate
to calculate distance to cell edge or centroid distribution}

\item{minDiff}{An integer, the minimum number of events from other genes
needed for calculation of background distribution of distances}

\item{minObsNN}{An integer, the minimum number of events before a gene is analysed before. See details.}

\item{features}{A character vector, for which features should the
probabilistic indices be calculated?}

\item{...}{additional arguments, passed on to \link{estPisSingle}.}
}
\value{
The hyperframe with the estimated PIs present in it
}
\description{
Estimate different probabilistic indices for localization
on all point patterns of a hyperframe, and integrate the results in the same hyperframe
}
\details{
The null distribution used to calculate the PIs can be either 'background' or 'null'.
For 'background', the observed distributions of all genes is used. Alternatively,
for null = 'CSR', Monte-Carlo simulation under complete spatial randomness
is performed within the given window to find the null distribution of the distance under study.

The 'nn' prefix indicates that nearest neighbour distances are being used,
either univariately or bivariately.
The suffix 'Pair' indicates that bivariate probabilistic indices,
testing for co- and antilocalization are being used.
'edge' and 'centroid' calculate the distance to the edge respectively
 the centroid of the windows added using the \link{addCell} function.
The suffix 'Cell' indicates distances are being calculated within cells only.

It can be useful to set the minObsNN higher than 1 for calculations within cells when the number of events is low,
not to waste computation time on gene (pairs) with very little power.
}
\examples{
data(Yang)
hypYang <- buildHyperFrame(Yang,
    coordVars = c("x", "y"),
    imageVars = c("day", "root", "section")
)
yangPims <- estPis(hypYang[c(seq_len(6), seq(25, 29)), ], pis = "nn",
    nPointsAll = 5e2)
# Univariate nearest neighbour distances
}
\seealso{
\link{estPisSingle}
}
