Given a PBMExperiment containing probe intensity data with array coordinates
specified in rowData as "Column"
and "Row"
, this function
computes the local intensity bias for each probe, and returns the
same PBMExperiment object with an additional array containing spatially
corrected (scaled) probe intensities. Optionally, the per-probe bias is also
returned as an array in the bias corrected PBMExperiment object.
The spatial bias at each probe is computed as the ratio between the median
intensity in a k
by k
region surrounding the probe and the median intensity of all probes
across the array. This approach is taken directly from the Universal PBM
Analysis Suite described in Berger and Bulyk (Nature Protocols, 2008).
Only probes passing all probeFilter
rules defined in the original PBMExperiment
object are spatially adjusted and included in the returned object.
spatiallyAdjust( pe, assay = SummarizedExperiment::assayNames(pe)[1], k = 15L, returnBias = TRUE, verbose = FALSE )
pe | a PBMExperiment object containing PBM intensity data. |
---|---|
assay | a string name of the assay to adjust. (default = |
k | an integer specifying the size of the region to use to for computing local bias. Must be odd. (default = 15L) |
returnBias | a logical whether to include the spatial bias as an additional 'assay' (called 'spatialbias') in the returned PBMExperiment object. (default = TRUE) |
verbose | a logical value whether to print verbose output during analysis. (default = FALSE) |
Original PBMExperiment object with assay containing spatially adjusted intensities
("normalized"
) and a new column added to the colData,
"spatialMedian"
, containing the global median intensity of the original
probe-level data used to compute spatial bias for each sample.
If specified, the estimated spatial bias will also be included in an additional
assay ("spatialbias"
). If assays with the same name are already included
in the object, they will be overwritten.
Berger, M. F., & Bulyk, M. L. (2009). Universal protein-binding microarrays for the comprehensive characterization of the DNA-binding specificities of transcription factors. Nature Protocols, 4(3), 393-411.