Normalises marker intensities and stores the result in the data slot.
Raw counts remain unchanged. Z-scores use the sample standard deviation.
When direct finite-input arithmetic overflows, underflows, or yields a
subnormal variance, calculations retry in bounded power-of-two units with the same
definitions; ordinary finite calculations are unchanged.
Usage
NormaliseData(
object,
method = c("zscore", "minmax", "quantile"),
markers = NULL
)Arguments
- object
An
SpatialCellData-classobject.- method
Character.
"zscore"(default),"minmax", or"quantile". Missing values are preserved. Quantile normalisation scales average ranks to[0, 1]; a sole observed value is assigned 0.5, as for a constant marker with several observations.- markers
Character vector or
NULL. Markers to normalise. IfNULL, all markers are normalised.
Value
An SpatialCellData-class with updated data slot.
Examples
counts <- matrix(rnorm(40, 500, 100), nrow = 20,
dimnames = list(NULL, c("CD3", "CD8")))
coords <- data.frame(x = runif(20), y = runif(20))
obj <- CreateSpatialObject(counts, coords)
obj <- NormaliseData(obj, method = "zscore")