probMap: Calculate molecular probablity maps

View source: R/probMap.R

probMapR Documentation

Calculate molecular probablity maps

Description

This function creates molecular probability maps from a given spatial point pattern representation.

Usage

probMap(
  sppMoi,
  reference = NULL,
  bw = seq(0.5, 10),
  edgeCorrection = FALSE,
  bwMethod = "spAutoCor",
  csrMoi = NULL,
  pvalThreshold = 0.05,
  pvalCorrection = "BH",
  diagPlots = FALSE,
  seed = NULL,
  verbose = TRUE,
  ...
)

Arguments

sppMoi

The spatial point pattern.

reference

An sppMoi object that is designated as the "control" or "null" alternative of sppMoi. If supplied the csrMoi model will be generated from the intensities of this object.

bw

The Gaussian bandwidth used for Kernel density estimation. If a single numeric value is supplied then it will be used for the computation of KDE. If a vector is supplied (in increasing order), then these values will be passed to internal method 'spAutoCor' for computing the bandwidth based on cross validation, see '?moleculaR::.bw.spAutoCorr'.

edgeCorrection

a logical. Whether to apply edge correction through erosion by calling 'spatstat.geom::erosion'. This could be beneficial for removing edge artifacts which might otherwise impact the result.

bwMethod

The method used for computing the Gaussian bandwidth, c("spAutoCor", "scott").

csrMoi

Pre-computed wighted csrMoi model corresponding to the given sppMoi. This could be useful when generating hotspot-bw curves. For internal use only.

pvalThreshold

The p-value threshold to be used for the hypothesis testing.

pvalCorrection

The method used for p-values correction, see '?p.adjust' for more details.

diagPlots

whether to plot the Gaussian bw selection procedure, ignored when bwMethod = "scott".

seed

a single value, interpreted as integer or 'NULL' (default) controlling the process of random number generation. If set, ensures that the same CSR model is generated at different runs for the same input 'sppMoi'

verbose

whether to output progress.

csrIntensities

How the intensities for the csrMoi model are generated, c("resample", "Poisson", "Gaussian").

...:

arguments passed to 'plot' for bandwidth plotting when 'bwMethod="spAutoCor"'.

Value

#' An S3 object of type molProbMap with the following entries

  • bw: calculated Gaussian bandwidth.

  • sppMoi: the input spp with intensities sqrt-transformed if 'sqrtTransform == TRUE'.

  • csrMoi: calculated complete spatial randomness model for the input sppMoi.

  • rhoMoi: density image of the input point pattern sppMoi.

  • rhoCsr: density image of the computed csrMoi pattern.

  • hotspotpp: the remaining points (type 'ppp') which lie within the hotspot mask as a spatial point pattern.

  • hotspotIm: the hotspot image of type 'im'.

  • hotspotMask: the hotspot mask of type 'owin'.

  • coldspotpp: the remaining points (type 'ppp') which lie within the coldspot mask as a spatial point pattern.

  • coldspotIm: the coldspot image of type 'im'.

  • coldspotMask: the hotspot mask of type 'owin'.


CeMOS-Mannheim/moleculaR documentation built on April 14, 2025, 8:27 a.m.