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) / sqrt(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 density.
NormalizeChiSquared(object, ...)# S3 method for default
NormalizeChiSquared(object = NULL, verbose = TRUE, ...)
# S3 method for Assay
NormalizeChiSquared(object, verbose = TRUE, ...)
# S3 method for StdAssay
NormalizeChiSquared(
object,
layer = "counts",
save = "data",
verbose = TRUE,
...
)
# S3 method for Seurat
NormalizeChiSquared(object, assay = NULL, verbose = TRUE, ...)
Normalized object of the same class as input
a count matrix (a landmark-sample density matrix), Assay, StdAssay, or Seurat object. Values must be raw counts (non-negative whole numbers)
Additional arguments
display progress bar for normalization procedure
Layer to use (for StdAssay objects, and passed on by the Seurat method). It must
resolve to a single layer whose name starts with "counts"; for split layers, run
JoinLayers first or name one layer
Layer to save results to (for StdAssay objects, and passed on by the Seurat method). Its name cannot start with "counts"
Name of assay to use (for Seurat objects)
if (FALSE) {
# Normalize a sample-level Seurat object
sample_obj <- NormalizeChiSquared(sample_obj)
}
Run the code above in your browser using DataLab