Gets or sets the size factors for all cells in a SingleCellExperiment object.
## S4 method for signature 'SingleCellExperiment' sizeFactors(object, onAbsence = "none") ## S4 replacement method for signature 'SingleCellExperiment' sizeFactors(object, ...) <- value
A SingleCellExperiment object.
String indicating an additional action to take when size factors are absent:
Additional arguments, currently ignored.
A numeric vector of length equal to
A size factor is a scaling factor used to divide the raw counts of a particular cell to obtain normalized expression values,
thus allowing downstream comparisons between cells that are not affected by differences in library size or total RNA content.
sizeFactors methods can be used to get or set size factors for all cells in a SingleCellExperiment object.
When setting size factors, the values are stored in the
colData as the
This name is chosen for general consistency with other packages (e.g., DESeq2)
and to allow the size factors to be easily extracted from the
colData for use as covariates.
onAbsence is provided to make it easier to mandate that
object has size factors.
This avoids silent
NULL values that flow to the rest of the function and make debugging difficult.
sizeFactors, a numeric vector is returned containing size factors for all cells.
If no size factors are available, a
NULL is returned (and/or a warning or error, depending on
sizeFactors<-, a modified
object is returned with size factors in its
SingleCellExperiment, for the underlying class definition.
librarySizeFactors from the scater package
computeSumFactors from the scran package,
as examples of functions that compute the size factors.
example(SingleCellExperiment, echo=FALSE) # Using the class example sizeFactors(sce) <- runif(ncol(sce)) sizeFactors(sce)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.