centreSizeFactors {scater} | R Documentation |
Scales all size factors so that the average size factor across cells is equal to 1.
centreSizeFactors(object, centre = 1)
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. |
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).
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"))