| merge-methods {mia} | R Documentation |
SummarizedExperimentmergeRows/mergeCols merge data on rows or columns of a
SummarizedExperiment as defined by a factor alongside the
chosen dimension. Metadata from the rowData or colData are
retained as defined by archetype.
mergeRows(x, f, archetype = 1L, ...) mergeCols(x, f, archetype = 1L, ...) ## S4 method for signature 'SummarizedExperiment' mergeRows(x, f, archetype = 1L, ...) ## S4 method for signature 'SummarizedExperiment' mergeCols(x, f, archetype = 1L, ...) ## S4 method for signature 'TreeSummarizedExperiment' mergeRows(x, f, archetype = 1L, mergeTree = FALSE, mergeRefSeq = FALSE, ...) ## S4 method for signature 'TreeSummarizedExperiment' mergeCols(x, f, archetype = 1L, mergeTree = FALSE, ...)
x |
|
f |
A factor for merging. Must be the same length as
|
archetype |
Of each level of |
... |
optional arguments:
|
mergeTree |
|
mergeRefSeq |
|
assay are
agglomerated, i.e.. summed up. Other than counts / absolute values might lead
to meaningless values.
These functions are similar to
sumCountsAcrossFeatures.
However, additional support for TreeSummarizedExperiment was added and
science field agnostic names were used. In addition the archetype
argument lets the user select how to preserve row or column data.
For merge data of assays the function from scuttle are used.
an object with the same class x with the specified entries
merged into one entry in all relevant components.
data(esophagus)
esophagus
plot(rowTree(esophagus))
# get a factor for merging
f <- factor(regmatches(rownames(esophagus),
regexpr("^[0-9]*_[0-9]*",rownames(esophagus))))
merged <- mergeRows(esophagus,f)
plot(rowTree(merged))
#
data(GlobalPatterns)
GlobalPatterns
merged <- mergeCols(GlobalPatterns,colData(GlobalPatterns)$SampleType)
merged