counts: Extracts counts of a TCA object.

Description Usage Arguments Details Value Author(s) References Examples

Description

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

Usage

1
2
3
4
5
6
## 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

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. a small count is set proportional to the library size, the average value of such small counts of all libraries counts 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

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

TCseq documentation built on Nov. 8, 2020, 5:46 p.m.