View source: R/SummarizedExperiment2MultiBlock.R
| SummarizedExperiment2MultiBlock | R Documentation |
Converts a SummarizedExperiment into a MultiBlock. Each assay in the
SummarizedExperiment becomes one block (rows = samples, columns = features).
SummarizedExperiment2MultiBlock(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 |
Each assay is transposed so that samples are in rows and features in columns. Sample order
is aligned to colData(se) row names; samples not present in colData are
removed. If an assay has no name, the block is labelled "X". Metadata from
colData (excluding the Batch column if specified) is stored only for the first block;
subsequent assays are appended as additional blocks with no extra metadata.
A MultiBlock object with one block per assay in se.
MultiBlock, MultiAssayExperiment2MultiBlock,
MultiBlock2MultiAssayExperiment
if (requireNamespace("SummarizedExperiment", quietly = TRUE)) {
library(SummarizedExperiment)
nrows <- 20; ncols <- 6
counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
rownames(counts) <- paste0("feature", seq_len(nrows))
colnames(counts) <- paste0("sample", seq_len(ncols))
se <- SummarizedExperiment(assays = list(counts = counts))
mb <- SummarizedExperiment2MultiBlock(se)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.