colNormalize {CytoSimplex} | R Documentation |
Normalize each column of the input matrix by the column sum
Description
Normalize each column of the input matrix by the column sum
Usage
colNormalize(x, scaleFactor = NULL, log = FALSE, ...)
## Default S3 method:
colNormalize(x, scaleFactor = NULL, log = FALSE, ...)
## S3 method for class 'dgCMatrix'
colNormalize(x, scaleFactor = NULL, log = FALSE, ...)
## S3 method for class 'Seurat'
colNormalize(
x,
scaleFactor = NULL,
log = FALSE,
assay = NULL,
layer = "counts",
...
)
## S3 method for class 'SingleCellExperiment'
colNormalize(x, scaleFactor = NULL, log = FALSE, assay.type = "counts", ...)
Arguments
x |
Feature by observation matrix. Alternatively, |
scaleFactor |
Multiplier on normalized data. Default |
log |
Logical. Whether to take log1p transformation after scaling.
Default |
... |
Additional arguments passed to methods |
assay |
For "Seurat" method, the specific assay to get data from.
Default |
layer |
For "Seurat" method, which layer of the assay to be used.
Default |
assay.type |
For "SingleCellExperiment" method, the assay type to get
data from. Default |
Value
Normalized matrix of the same size
A Seurat object with normalized data in the specified slot of the specified assay.
A SingleCellExperiment object with normalized data in the specified
assay. "normcounts"
if log = FALSE
and "logcounts"
if
log = TRUE
.
Examples
rnaNorm <- colNormalize(rnaRaw)
# Seurat example
library(Seurat)
srt <- CreateSeuratObject(rnaRaw)
srt <- colNormalize(srt)
# SingleCellExperiment example
library(SingleCellExperiment)
sce <- SingleCellExperiment(assays = list(counts = rnaRaw))
sce <- colNormalize(sce)