Computes expression-weighted centered scaled ranks for a sparse or dense
expression matrix, calculated per column (cell).
Usage
ewcsr.sparse(mat, num_threads = -1L)
Arguments
- mat
A matrix with features (genes) as rows and cells or samples as columns.
- num_threads
Integer; number of threads to use. The default is -1 which uses all available cores.
Value
A matrix of EWCSR-transformed values with the same dimensions as mat.
Details
EWCSR transformation emphasizes relatively high and low expression features
within each cell while accounting for expression magnitude. The output matrix
retains the same dimensions as the input.
Examples
utils::data("pbmc_small", package = "SeuratObject")
mat <- SeuratObject::LayerData(
pbmc_small,
assay = "RNA",
layer = "counts"
)
ewcsr_mat <- ewcsr.sparse(mat, num_threads = 1)