Divides the counts of each cell by its size factor and takes
\(\log_2(x + 1)\). By default the size factors are the library sizes,
centred to mean 1. This gives the same values as the defaults of
scuttle::logNormCounts(), which Bioconductor 3.24 deprecates.
logNormTransf(
sce,
assayName = "counts",
targetAssay = "logcounts",
sizeFactors = NULL
)sce with the log-normalised assay targetAssay and the size
factors, centred to mean 1, in colData(sce)$sizeFactor. A sparse or
DelayedArray count matrix gives a dgCMatrix, a dense one a dense
matrix.
scranTransf() for pooled size factors, logTransf() for
log1p() of counts or relative counts.
sce <- scuttle::mockSCE(ncells = 20, ngenes = 10)
sce <- logNormTransf(sce)
assay(sce, "logcounts")[1:3, 1:3]