Convert a matrix of raw counts to a matrix of log2(Counts per Million + 1) values
log2CPM_byRow.Rd
The input can be a base R matrix or a sparse matrix from the Matrix package.
Arguments
- counts
A matrix, dgCMatrix, or dgTMatrix of count values
- sf
vector of numeric values representing the total number of reads. If count matrix includes all genes, value calulated by default (sf=NULL) will be accurate; however, if count matrix represents only a small fraction of genes, we recommend also providing this value.
- denom
Denominator that all counts will be scaled to. The default (1 million) is commonly used, but 10000 is also common for sparser droplet-based sequencing methods.
- offset
The constant offset to add to each cpm value prior to taking log2 (default = 1)