
Normalize data with custom scale factors
custom_scale_region.RdNormalize data with custom scale factors
Arguments
- region
A Region object, or concatenated data generated by .smapply.
- to
Which data slot to assign the normalized data to.
- from
Which data slot to pull data from.
- MARGIN
Whether to apply the function within each biomarker (1) or across all biomarkers in each cell (2).
- ...
Arguments passed on to
custom_scalesweep.functionThe function passed to
sweepthat will be used to sweep out the scale factors. Defaults to'/'.scale.factorsA vector of scale factors. Expects the same length as the axis chosen in
MARGINor a single value. Passed to thesweepargumentSTATSallow.negativesIf
FALSE, scaling that introduces negative values will have those values corrected to zero.
Value
An updated Region object with normalized data added to the slot specified in to. Metadata recording
information about the normalization is added to the featureInfo if MARGIN = 1, and to the cellMetadata if
MARGIN = 2.