ReducedExperiment: A container for dimensionally-reduced representations
Source:R/AllClasses.R
, R/methods-ReducedExperiment.R
reduced_experiment.Rd
Inherits from SummarizedExperiment, a
container for one or more matrices with features as rows (e.g., genes) and
columns as samples. Additional information on features and samples are
contained in DataFrame tables. The
ReducedExperiment
extends SummarizedExperiment
by additionally providing access to a "reduced" data matrix, in which rows
represent samples and columns represent a second set of dimensionally-reduced
features.
The methods available for SummarizedExperiment
objects are also available for ReducedExperiment
and its children, which
include FactorisedExperiment and
ModularExperiment.
Typically, ReducedExperiment
objects contain two main assays. The first is,
by default, named "normal" and contains some type of normalised assay data,
such as gene expression. The second is "transformed", which is typically
the result of applying scaling and/or centering to the normalised data
matrix.
Usage
ReducedExperiment(reduced = new("matrix"), scale = TRUE, center = TRUE, ...)
Arguments
- reduced
A
matrix
, usually the result of some type of dimensionality-reduction, with rows representing samples and columns representing a new set of features.- scale
Either a boolean, representing whether or not the original data has been scaled to unit variance, or a numeric vector indicating the standard deviations of the original features (as produced by scale.)
- center
Either a boolean, representing whether or not the original data has been centered to have a mean of 0, or a numeric vector indicating the means of the original features (as produced by scale.)
- ...
Additional arguments to be passed to SummarizedExperiment.
Examples
# Create randomised data with the following dimensions
i <- 300 # Number of features
j <- 100 # Number of samples
k <- 10 # Number of factors
# In this case we use random assay and reduced data, but in
# practice these will likely be the result of applying some kind of
# dimensionality-reduction method to the assay data (e.g., gene
# expression data) from some study.
rand_assay_data <- ReducedExperiment:::.makeRandomData(i, j, "gene", "sample")
rand_reduced_data <- ReducedExperiment:::.makeRandomData(j, k, "sample", "component")
re <- ReducedExperiment(
assays = list("normal" = rand_assay_data),
reduced = rand_reduced_data
)
re
#> class: ReducedExperiment
#> dim: 300 100 10
#> metadata(0):
#> assays(1): normal
#> rownames(300): gene_1 gene_2 ... gene_299 gene_300
#> rowData names(0):
#> colnames(100): sample_1 sample_2 ... sample_99 sample_100
#> colData names(0):
#> 10 components