counts: Extracts counts of a TCA object.

countsR Documentation

Extracts counts of a TCA object.

Description

counts extract raw read counts stored in a TCA object or compute normalized counts from the raw counts.

Usage

## S4 method for signature 'TCA'
counts(object, normalization = "none", lib.norm = TRUE, log = FALSE, ...)

## S4 replacement method for signature 'TCA'
counts(object) <- value

Arguments

object

a TCA object.

normalization

character string giving the normalization method. Options are "none" (original raw counts), "cpm" (counts per million), "rpkm" (reads per kilobase per million).

lib.norm

logical indicating whether or not use effective library size (see Details below) when normalization is "cpm" or "rpkm".

log

logical if TRUE, the returned value will be on a log2 scale.

...

additional arguments passed to cpm or rpkm in the edgeR package.

value

an integer matrix.

Details

when calculating normalized counts, library size can be rescaled to minimize the log-fold changes between samples for most genomic features (e.g. genes, binding sites) by multiplying a scale factor. The rescaled library size is called effective library size. In this function, the scale factor is calculated using the weighted trimmed mean of M-values (TMM, Robinson et al (2010))

If log2 values are computed, a small count would be added to avoid logarithm of zero. The actual added count will be scaled according to the library size, for details see addPriorCount in the edgeR package when not specified, the prior count is set to 0.25 by default.

Value

An integer matrix

Author(s)

Mengjun Wu

References

Robinson, M. D., & Oshlack, A. (2010). A scaling normalization method for differential expression analysis of RNA-seq data. Genome biology, 11(3), 1.

Examples

data(tca_ATAC)
c <- counts(tca_ATAC)
# normalized counts table
c_norm <- counts(tca_ATAC, normalization='rpkm')

MengjunWu/TCseq documentation built on May 15, 2023, 9:47 p.m.