Description Usage Arguments Details Value Author(s) Examples
View source: R/normalisation.R
Compute normalised expression values from an SCESet object and return the object with the normalised expression values added.
1 2 3 4 | normaliseExprs(object, method = "none", design = NULL, feature_set = NULL,
exprs_values = NULL, return_norm_as_exprs = TRUE, ...)
normalizeExprs(...)
|
object |
an |
method |
character string specified the method of calculating
normalisation factors. Passed to |
design |
design matrix defining the linear model to be fitted to the
normalised expression values. If not |
feature_set |
character, numeric or logical vector indicating a set of
features to use for calculating normalisation factors. If character, entries
must all be in |
exprs_values |
character string indicating which slot of the
assayData from the |
return_norm_as_exprs |
logical, should the normalised expression values
be returned to the |
... |
arguments passed to |
This function allows the user to compute normalised expression
values from an SCESet object. The 'raw' values used can be the values in the
'counts'
(default), 'tpm'
, 'cpm'
or 'fpkm'
slot
of the SCESet. Normalised expression values are computed through
normalize.SCESet
and are on the log2-scale, with an offset
defined by the logExprsOffset
slot of the SCESet object. These are
dded to the 'norm_exprs'
slot of the returned object. If
'exprs_values'
argument is 'counts'
, a 'norm_cpm'
slot
is also added, containing normalised counts-per-million values.
If the raw values are counts, this function will compute size factors using
methods in calcNormFactors
. Library sizes are multiplied
by size factors to obtain an "effective library size" before calculation of
the aforementioned normalized expression values. If feature_set
is
specified, only the specified features will be used to calculate the
size factors.
If the user wishes to remove the effects of certain explanatory variables,
then the 'design'
argument can be defined. The design
argument
must be a valid design matrix, for example as produced by
model.matrix
, with the relevant variables. A linear
model is then fitted using lmFit
on expression values
after any size-factor and library size normalisation as descrived above. The
returned values in 'norm_exprs'
are the residuals from the linear
model fit.
After normalisation, normalised expression values can be accessed with the
norm_exprs
function (with corresponding accessor functions for
counts, tpm, fpkm, cpm). These functions can also be used to assign normalised
expression values produced with external tools to an SCESet object.
normalizeExprs
is exactly the same as normaliseExprs
, provided
for those who prefer North American spelling.
an SCESet object
Davis McCarthy
1 2 3 4 5 6 7 8 9 10 11 12 | data("sc_example_counts")
data("sc_example_cell_info")
pd <- new("AnnotatedDataFrame", data = sc_example_cell_info)
example_sceset <- newSCESet(countData = sc_example_counts, phenoData = pd)
keep_gene <- rowSums(counts(example_sceset)) > 0
example_sceset <- example_sceset[keep_gene,]
## Apply TMM normalisation taking into account all genes
example_sceset <- normaliseExprs(example_sceset, method = "TMM")
## Scale counts relative to a set of control features (here the first 100 features)
example_sceset <- normaliseExprs(example_sceset, method = "none",
feature_set = 1:100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.