Skip to contents

A container inheriting from the ReducedExperiment class, that contains one or more data matrices, to which factor analysis has been applied to identify a reduced set of features. A FactorisedExperiment can be created directly in a similar manner to a SummarizedExperiment. Alternatively, the estimateFactors function can be used to both apply factor analysis and generate a FactorisedExperiment from the results.

Usage

FactorisedExperiment(
  reduced = new("matrix"),
  scale = TRUE,
  center = TRUE,
  loadings = new("matrix"),
  stability = NULL,
  ...
)

Arguments

reduced

A matrix, produced by factor analysis, with rows representing samples and columns representing factors.

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.)

loadings

A matrix, produced by factor analysis, with rows representing features and columns representing factors.

stability

A vector containing some measure of stability or variance explained for each factor. If factor analysis was performed using estimateFactors and use_stability = TRUE, this slot will indicate the stability of the factors across multiple runs of ICA.

...

Additional arguments to be passed to ReducedExperiment.

Value

Constructor method returns a FactorisedExperiment object.

Author

Jack Gisby

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, reduced and loadings data, but in
# practice these will likely be the result of applying some kind of factor
# analysis 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", "factor")
rand_loadings <- ReducedExperiment:::.makeRandomData(i, k, "gene", "factor")

fe <- FactorisedExperiment(
    assays = list("normal" = rand_assay_data),
    reduced = rand_reduced_data,
    loadings = rand_loadings
)

fe
#> class: FactorisedExperiment 
#> 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