spatialNormalization {cellHTS2} | R Documentation

## Spatial normalization

### Description

Correction of spatial plate effects of data stored in slot `assayData` of a `cellHTS` object by fitting a polynomial surface within each plate using local regression (`loess` or `robust local fit`). Uses a second degree polynomial (local quadratic fit). Only wells containing "sample" are considered to fit the models.

### Usage

    spatialNormalization(object, model="locfit", smoothPar=0.6, save.model=FALSE)

### Arguments

`object` | a `cellHTS` object that has already been configured.
`model` | character indicated whether the polynomial surface should be fitted using robust "locfit" or "loess". The default is "locfit".
`smoothPar` | numeric. The default is `smoothPar=0.6`. The parameter which controls the degree of smoothing (corresponds to 'span' argument of `loess`, or to the parameter 'nn' of `lp` of locfit).
`save.model` | a logical value specifying whether the per-plate spatial effects should be stored in slot `rowcol.effects` of `object`. See details.

### Details

For convenience, this function should be called indireclty from `normalizePlates` function.

The normalization is performed separately for each replicate and channel, in a per-plate fashion using the chosen local regression model. The polynomical surfaces are fitted using the wells containing "sample".

If `save.model=TRUE`, the models row and column offsets are stored in the slot `rowcol.effects` of `object`.

### Value

An object of class `cellHTS` with normalized data stored in slot `assayData`. Furthermore, if `save.model=TRUE`, the row and column estimated offsets are stored in the slot `rowcol.effects`. This slot is a 3D array with the same dimension as `Data(object)`.
Moreover, the processing status of the `cellHTS` object is updated in the slot `state` to `object@state[["normalized"]]=TRUE`.

### Author(s)

Ligia Bras ligia@ebi.ac.uk

### References

### See Also

`medpolish`, `loess`, `locfit`, `plotSpatialEffects`, `normalizePlates`, `summarizeChannels`, `plateEffects`

### Examples

        data(KcViabSmall)
        x <- KcViabSmall
        xs <- spatialNormalization(x, model="loess", save.model = TRUE)
        ## Calling spatialNormalization function from "normalizePlates":
        xopt <- normalizePlates(x, method="loess", varianceAdjust="none", save.model = TRUE)
        all(xs@rowcol.effects == xopt@rowcol.effects, na.rm=TRUE)

[Package cellHTS2 version 2.2.5 Index]