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, Seurat object or SingleCellExperiment object with raw counts available are also supported.

scaleFactor

Multiplier on normalized data. Default NULL.

log

Logical. Whether to take log1p transformation after scaling. Default FALSE

...

Additional arguments passed to methods

assay

For "Seurat" method, the specific assay to get data from. Default NULL to the default assay.

layer

For "Seurat" method, which layer of the assay to be used. Default "counts".

assay.type

For "SingleCellExperiment" method, the assay type to get data from. Default "counts".

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)


[Package CytoSimplex version 0.1.1 Index]