normalizeCounts {scater} | R Documentation

## Divide columns of a count matrix by the size factors

### Description

Compute (log-)normalized expression values by dividing counts for each cell by the corresponding size factor.

### Usage

    normalizeCounts(x, size_factors, return_log = TRUE,
      log_exprs_offset = 1, centre_size_factors = FALSE,
      subset_row = NULL)

### Arguments

`x` | A count matrix, with cells in the columns and genes in the rows.
`size_factors` | A numeric vector of size factors for all cells.
`return_log` | Logical scalar, should normalized values be returned on the log2 scale?
`log_exprs_offset` | Numeric scalar specifying the offset to add when log-transforming expression values.
`centre_size_factors` | Logical scalar indicating whether size fators should be centred.
`subset_row` | A vector specifying the subset of rows of `x` for which to return a result.

### Details

This function will compute log-normalized expression values from `x`. It will endeavour to return an object of the same class as `x`, with particular focus on DelayedMatrix inputs/outputs.

Note that the default `centre_size_factors` differs from that in `normalizeSCE`. Users of this function are assumed to know what they're doing with respect to normalization.

### Value

A matrix-like object of (log-)normalized expression values.

### Author(s)

Aaron Lun

### Examples

    data("sc_example_counts")
    normed <- normalizeCounts(sc_example_counts,
        librarySizeFactors(sc_example_counts))

[Package scater version 1.12.2 Index]