Compute per-sample library-size offsets
Source:R/AllGenerics.R, R/sizeFactors.R
computeSizeFactors.RdDerives a per-sample library-size offset (LS) by computing, for each
(sample, cell type), a log size factor from total counts over total area,
centring these per cell type, and taking the median across cell types for
each sample. The offset is written to a per-cell colData column so it
can enter the model design as a nuisance covariate.
Usage
computeSizeFactors(spe, ...)
# S4 method for class 'ANY'
computeSizeFactors(
spe,
cell_type = "cell_type",
sample_id = "sample_id",
count = "nCount",
area = "Area",
name = "LS",
...
)Arguments
- spe
a SpatialExperiment.
- ...
ignored.
- cell_type
a character, the colData column of cell type labels.
- sample_id
a character, the colData column of sample identifiers.
- count
a character, the colData column of per-cell total counts (e.g. total UMI or negative-probe counts).
- area
a character, the colData column of per-cell area.
- name
a character, the colData column to write the LS offset to (default "LS").