calcAverage {scater} | R Documentation

## Calculate average counts, adjusting for size factors or library size

### Description

Calculate average counts per feature, adjusting them as appropriate to take into account for size factors for normalization or library sizes (total counts).

### Usage

    calcAverage(object, size.factors = NULL)

### Arguments

`object` | a `SingleCellExperiment` object or a matrix of counts
`size.factors` | numeric(), vector of size factors to use to scale library size in computation of counts-per-million. Extracted from the object if it is a `SingleCellExperiment` object; if object is a matrix, then if non-NULL, the provided size factors are used. Default is `NULL`, in which case size factors are all set to 1 (i.e. library size adjustment only).

### Value

Vector of average count values with same length as number of features.

### Examples

    data("sc_example_counts")
    data("sc_example_cell_info")
    example_sce <- SingleCellExperiment(
    assays = list(counts = sc_example_counts), colData = sc_example_cell_info)

    ## calculate average counts
    ave_counts <- calcAverage(example_sce)

[Package scater version 1.6.3 Index]