centreSizeFactors {scater} | R Documentation |
Scales all size factors so that the average size factor across cells is equal to 1.
centreSizeFactors(object, centre = 1, grouping = NULL)
object |
A SingleCellExperiment object containing any number (or zero) sets of size factors. |
centre |
A numeric scalar, the value around which all sets of size factors should be centred. |
grouping |
A factor specifying the grouping of cells, where size factors are centred to unity within each group. |
Centering of size factors at unity ensures that division by size factors yields values on the same scale as the raw counts. This is important for the interpretation of the normalized values, as well as comaprisons between features normalized with different size factors (e.g., spike-ins).
Specification of grouping
centres the size factors within each level of the provided factor.
This is useful if different batches are sequenced at different depth, by preserving the scale of counts within each batch.
A SingleCellExperiment with modified size factors that are centred at unity.
Aaron Lun
data("sc_example_counts") data("sc_example_cell_info") example_sce <- SingleCellExperiment( assays = list(counts = sc_example_counts), colData = sc_example_cell_info ) sizeFactors(example_sce) <- runif(ncol(example_sce)) sizeFactors(example_sce, "ERCC") <- runif(ncol(example_sce)) example_sce <- centreSizeFactors(example_sce) mean(sizeFactors(example_sce)) mean(sizeFactors(example_sce, "ERCC"))