Skip to contents

This function applies Chi-squared normalization to a (sample-level) Seurat object. It calculates the expected density (count of cells) for each landmark-sample pair assuming random distribution, then normalizes observed counts using: (observed - expected) / √(expected). The resulting values show how much each landmark's density deviates from the expected baseline—density values. Positive values indicate higher-than-expected density, negative values indicate lower-than-expected expression.

Usage

NormalizeChiSquared(object, ...)

# Default S3 method
NormalizeChiSquared(object = NULL, verbose = TRUE, ...)

# S3 method for class 'Assay'
NormalizeChiSquared(object, verbose = TRUE, ...)

# S3 method for class 'StdAssay'
NormalizeChiSquared(
  object,
  layer = "counts",
  save = "data",
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
NormalizeChiSquared(object, assay = NULL, verbose = TRUE, ...)

Arguments

object

a count matrix (a landmark-sample density matrix), Assay, StdAssay, or Seurat object

...

Additional arguments

verbose

display progress bar for normalization procedure

layer

Layer to use (for StdAssay objects)

save

Layer to save results to (for StdAssay objects)

assay

Name of assay to use (for Seurat objects)

Value

Normalized object of the same class as input

Examples

if (FALSE) { # \dontrun{
# Normalize a sample-level Seurat object
sample_obj <- NormalizeChiSquared(sample_obj)
} # }