View source: R/MultiBlock2MultiAssayExperiment.R
| MultiBlock2MultiAssayExperiment | R Documentation |
Converts a MultiBlock into a MultiAssayExperiment. Each block becomes one experiment; sample
names, batch information, and metadata are carried over into the colData of the result.
MultiBlock2MultiAssayExperiment(MB, MSEmetadata = NULL)
MB |
A |
MSEmetadata |
An optional list of unstructured metadata describing the overall content of
the MultiAssayExperiment (stored in its |
Each block in MB is transposed (features x samples) and stored as a named matrix in
the ExperimentList. Row names are set to the variable names and column names to the
sample names of the MultiBlock. The colData is constructed from MB@Samples;
any Metadata and Batch information present in the MultiBlock is appended as
additional columns. A sampleMap is generated mapping every sample to every experiment
using the same primary and column names.
A MultiAssayExperiment object with one experiment per block in MB.
MultiBlock, MultiAssayExperiment2MultiBlock
if (requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
library(MultiAssayExperiment)
b1 <- matrix(rnorm(50), 5, 10, dimnames = list(paste0("s", 1:5), paste0("v", 1:10)))
b2 <- matrix(rnorm(30), 5, 6, dimnames = list(paste0("s", 1:5), paste0("w", 1:6)))
mb <- MultiBlock(Data = list(block1 = b1, block2 = b2))
mae <- MultiBlock2MultiAssayExperiment(mb)
mae <- MultiBlock2MultiAssayExperiment(mb, MSEmetadata = list(study = "example"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.