Description Usage Arguments Details Value Author(s) See Also Examples
Gets or sets the size factors for all cells in a SingleCellExperiment object.
1 2 3 4 5 | ## S4 method for signature 'SingleCellExperiment'
sizeFactors(object, onAbsence = "none")
## S4 replacement method for signature 'SingleCellExperiment'
sizeFactors(object, ...) <- value
|
object |
A SingleCellExperiment object. |
onAbsence |
String indicating an additional action to take when size factors are absent:
nothing ( |
... |
Additional arguments, currently ignored. |
value |
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.
The 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 sizeFactors
field.
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.
For developers, 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.
For 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 onAbsence
).
For sizeFactors<-
, a modified object
is returned with size factors in its colData
.
Aaron Lun
SingleCellExperiment, for the underlying class definition.
librarySizeFactors
from the scater package
or computeSumFactors
from the scran package,
as examples of functions that compute the size factors.
1 2 3 | 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.