Skip to contents

Normalize spatial proteomic data in a SpatialMap. This wrapper function dispatches various helper functions (see Details) to perform normalization.

Usage

Normalize(
  object,
  method = NULL,
  from = "Data",
  to = "NormalizedData",
  ...,
  python = F,
  analyze = NULL
)

Arguments

object

A SpatialMap object

method

The method for normalization. See Details below for a full list of the options.

from

Which data slot to pull data from.

to

Which data slot to assign the normalized data to.

...

Additional arguments passed to normalization functions. See Details below for links to the arguments supported for each method.

python

Whether or not a Python environment needs to be initialized to run the specified FUN (...).

analyze

What to analyze (and how). The options are "regions", NULL (activeAnalysis), the name of a currently existing formal analysis, or the name of a column in object's projectMetadata (an "informal" analysis).

Value

A SpatialMap object with normalized data written to the slot specified in to. Additional info may be added depending on the method selected--see the links in Details for more info.

Details

See vignette("AnalysisGuide3_Unsupervised_clustering") for a basic workflow that uses this function.

Various methods are provided for data normalization and dispatched through the Normalize function using .smapply(). The documentation for each method is described below.

For many of these functions, additional arguments are expected. Follow the links to see specific documentation for each method. Some functions also allow computing summaries and sweeps across cells, rather than features (default). For example, to z-scale cells, simply call Normalize() with method = 'scale' and MARGIN = 2.

Note

Normalization can be done a few different ways across your data.

  • You can normalize within each biomarker's expression patterns across one of three different groupings of your data using the analyze parameter or by changing the activeAnalysis:

    • Normalize on a region-by-region basis when analyze = "regions" or the activeAnalysis is "regions". This is probably the most common use-case, helping to reduce the effect of region-to-region variability.

    • Normalize on a batch-by-batch basis using an informal analysis (e.g. analyze = "experiment_label").

    • Normalize on a subset or full dataset basis using a formal analysis (e.g. when analyze = "combined" or the activeAnalysis is "combined").

  • You can also normalize across all biomarker expressions within each cell when MARGIN = 2. Not all normalization functions support this option--see the docs linked in Details. total_norm_region defaults to this.

Scroll to top