NormalizeSP: Normalization of an 'SPData' object

Description Usage Arguments Details Value

View source: R/normalize.R

Description

This method performs four steps of of normalization:

  1. Normalize by cell size

  2. Normalize by cell concentration

  3. Scale-centre the rows

  4. Regenerate the nearest neighbour data from the scale centred data using the nearest neighbour IDs

Usage

1
2
3
NormalizeSP(sp, by.class = TRUE, norm.size = TRUE,
  norm.concentration = TRUE, norm.centrescale = TRUE,
  norm.regenerateNN = TRUE)

Arguments

sp

The SPData instance to use

by.class

Normalize each class of cells separately

norm.size

Regress out a cell size dependency

norm.concentration

Regress out the cell concentration dependency

norm.centrescale

Scale each column of cells(sp) to have mean 0 and sd 1

norm.regenerateNN

Regenerate nearest neighbour data after normalization

Details

Each step of normalization can be optionally turned on or off using the appropriate flag.

Setting by.class to true means each cell class is normalized separately within a sample, while if set to false all cells are normalized together. Note if there are many cell classes and few cells, normalization may become nonsensical - this is not checked for.

norm.concentration constructs a measure of cell concentration for each channel as the sum across all other channels. It then regresses each channel against the measure of concentration and accepts the residuals as the normalized quantity.

norm.regenerateNN reconstructs the neighbour data from the newly-normalized cell data. The neighbour information is stored separately in an SPData object so each can be manipulated / normalized without affecting the other.

Value

An object of class SPData that has been appropriately normalized.


kieranrcampbell/SpatialStats documentation built on May 20, 2019, 9:24 a.m.