cpmWithOffset: Version of 'edgeR::cpm()' that uses offsets

View source: R/edgeR_utils.R

cpmWithOffsetR Documentation

Version of edgeR::cpm() that uses offsets

Description

This is the same as edgeR::cpm(), except that when called on a edgeR::DGEList() object that contains an offset matrix, that matrix will be used by default for normalization instead of the library sizes and normalization factors. If called on a matrix of counts, the offset must be supplied manually.

Usage

cpmWithOffset(y, offset, ...)

Arguments

y, log, prior.count, ...

These arguments have the same meaning as in edgeR::cpm(), except that if y is a edgeR::DGEList(), the offset matrix will be used in favor of the sample normalized library sizes. Note that lib.size is not an accepted argument.

offset

The offset matrix to use. If y is a DGEList, this is determined automatically.

...

Additional arguments are passed to edgeR::cpm().

preserve.mean

If TRUE (the default), scale each row of offset such that the average CPM is the same as it would be without the offset.

Value

A numeric matrix of CPM values, normalized using the provided offset matrix.

If y is a DGEList with no offset matrix, offset is generated from the normalized library sizes.

See Also

edgeR::getOffset(), edgeR::scaleOffset(), edgeR::cpm()

Examples


# TODO Steal from cpm and maybe scaleOffset


DarwinAwardWinner/rctutils documentation built on July 22, 2022, 5:19 a.m.