logNormCounts | R Documentation |
Compute log-transformed normalized expression values from a count matrix in a SingleCellExperiment object.
logNormCounts(x, ...)
## S4 method for signature 'SummarizedExperiment'
logNormCounts(
x,
size.factors = NULL,
log = NULL,
transform = c("log", "none", "asinh"),
pseudo.count = 1,
center.size.factors = TRUE,
...,
subset.row = NULL,
normalize.all = FALSE,
assay.type = "counts",
name = NULL,
BPPARAM = SerialParam(),
size_factors = NULL,
pseudo_count = NULL,
center_size_factors = NULL,
exprs_values = NULL
)
## S4 method for signature 'SingleCellExperiment'
logNormCounts(
x,
size.factors = sizeFactors(x),
log = NULL,
transform = c("log", "none", "asinh"),
pseudo.count = 1,
center.size.factors = TRUE,
...,
subset.row = NULL,
normalize.all = FALSE,
assay.type = "counts",
use.altexps = FALSE,
name = NULL,
BPPARAM = SerialParam(),
size_factors = NULL,
pseudo_count = NULL,
center_size_factors = NULL,
exprs_values = NULL,
use_altexps = NULL
)
x |
A SingleCellExperiment or SummarizedExperiment object containing a count matrix. |
... |
For the generic, additional arguments passed to specific methods. For the methods, additional arguments passed to |
size.factors |
A numeric vector of cell-specific size factors.
Alternatively |
log |
Logical scalar indicating whether normalized values should be log2-transformed.
This is retained for back-compatibility and will override any setting of |
transform |
String specifying the transformation (if any) to apply to the normalized expression values. |
pseudo.count |
Numeric scalar specifying the pseudo-count to add when |
center.size.factors |
Logical scalar indicating whether size factors should be centered at unity before being used. |
subset.row |
A vector specifying the subset of rows of |
normalize.all |
Logical scalar indicating whether to return normalized values for all genes.
If |
assay.type |
A string or integer scalar specifying the assay of |
name |
String containing an assay name for storing the output normalized values.
Defaults to |
BPPARAM |
A BiocParallelParam object specifying how library size factor calculations should be parallelized.
Only used if |
size_factors , pseudo_count , center_size_factors , exprs_values |
Deprecated. |
use.altexps , use_altexps |
Deprecated, use |
This function is a convenience wrapper around normalizeCounts
.
It returns a SingleCellExperiment or SummarizedExperiment containing the normalized values in a separate assay.
This makes it easier to perform normalization by avoiding book-keeping errors during a long analysis workflow.
If NULL
, size factors are determined as described in normalizeCounts
.
subset.row
and normalize.all
have the same interpretation as for normalizeCounts
.
If x
is a SingleCellExperiment, normalization is not applied to any alternative Experiments.
Users can call applySCE
to perform the normalization on each alternative Experiment - see Examples.
Any Experiment-specific size factors will be automatically used, otherwise library size-based factors will be derived from the column sums.
x
is returned containing the (log-)normalized expression values in an additional assay named as name
.
If x
is a SingleCellExperiment, the size factors used for normalization are stored in sizeFactors
.
These are centered if center.size.factors=TRUE
.
Aaron Lun, based on code by Davis McCarthy
normalizeCounts
, which is used to compute the normalized expression values.
example_sce <- mockSCE()
# Standard library size normalization:
example_sce2 <- logNormCounts(example_sce)
assayNames(example_sce2)
logcounts(example_sce2)[1:5,1:5]
# Without logging, the assay is 'normcounts':
example_sce2 <- logNormCounts(example_sce, log=FALSE)
assayNames(example_sce2)
normcounts(example_sce2)[1:5,1:5]
# Pre-loading with size factors:
example_sce2 <- computeMedianFactors(example_sce)
example_sce2 <- logNormCounts(example_sce2)
logcounts(example_sce2)[1:5,1:5]
# Also normalizing the alternative experiments:
example_sce2 <- applySCE(example_sce, logNormCounts)
logcounts(altExp(example_sce2))[1:5,1:5]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.