View source: R/MultiAssayExperiment2MultiBlock.R
| MultiAssayExperiment2MultiBlock | R Documentation |
Converts a MultiAssayExperiment into a MultiBlock. Samples are first intersected across all experiments so that only common samples are retained.
MultiAssayExperiment2MultiBlock(se, colData_samplenames = NULL, Batch = NULL)
se |
A |
colData_samplenames |
Character string giving the name of the column in |
Batch |
Character string giving the name of the column in |
Columns (samples) are intersected across all experiments via intersectColumns before
conversion. Each experiment in the MultiAssayExperiment becomes one block in the
MultiBlock (rows = samples, columns = features). Sample names are taken from the
colData row names of se. Metadata from colData is stored only for the
first block; subsequent blocks share the same sample order but carry no additional metadata.
If Batch is specified, the corresponding column is extracted from colData,
removed from the metadata, and stored as the Batch slot of the MultiBlock.
A MultiBlock object with one block per experiment in se.
MultiBlock, MultiBlock2MultiAssayExperiment
if (requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
library(MultiAssayExperiment)
mae <- MultiAssayExperiment(
experiments = ExperimentList(
block1 = matrix(rnorm(50), nrow = 5, dimnames = list(paste0("s", 1:5), paste0("v", 1:10))),
block2 = matrix(rnorm(30), nrow = 5, dimnames = list(paste0("s", 1:5), paste0("w", 1:6)))
)
)
mb <- MultiAssayExperiment2MultiBlock(mae)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.