| cpm {edgeR} | R Documentation |
Computes counts per million (CPM) or reads per kilobase per million (RPKM) values.
## S3 method for class 'DGEList' cpm(x, normalized.lib.sizes=TRUE, log=FALSE, prior.count=0.25, ...) ## Default S3 method: cpm(x, lib.size=NULL, log=FALSE, prior.count=0.25, ...) rpkm(x, gene.length, normalized.lib.sizes=TRUE, log=FALSE, prior.count=0.25)
x |
matrix of counts or a |
normalized.lib.sizes |
logical, use normalized library sizes? |
lib.size |
library size, defaults to |
log |
logical, if |
prior.count |
average count to be added to each observation to avoid taking log of zero. Used only if |
gene.length |
vector of length |
... |
other arguments are not currently used |
CPM or RPKM values are useful descriptive measures for the expression level of a gene or transcript.
By default, the normalized library sizes are used in the computation for DGEList objects but simple column sums for matrices.
If log-values are computed, then a small count, given by prior.count but scaled to be proportional to the library size, is added to x to avoid taking the log of zero.
numeric matrix of CPM or RPKM values.
aveLogCPM(x), rowMeans(cpm(x,log=TRUE)) and log2(rowMeans(cpm(x)) all give slightly different results.
Davis McCarthy, Gordon Smyth
y <- matrix(rnbinom(20,size=1,mu=10),5,4) cpm(y) d <- DGEList(counts=y, lib.size=1001:1004) cpm(d) cpm(d,log=TRUE)