merge-methods | R Documentation |
SummarizedExperiment
mergeRows
/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, ...)
mergeFeatures(x, f, archetype = 1L, ...)
mergeSamples(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 'SummarizedExperiment'
mergeFeatures(x, f, archetype = 1L, ...)
## S4 method for signature 'SummarizedExperiment'
mergeSamples(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, ...)
## S4 method for signature 'TreeSummarizedExperiment'
mergeFeatures(
x,
f,
archetype = 1L,
mergeTree = FALSE,
mergeRefSeq = FALSE,
...
)
## S4 method for signature 'TreeSummarizedExperiment'
mergeSamples(x, f, archetype = 1L, mergeTree = FALSE, ...)
x |
a |
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. If the assay contains values other than counts
or absolute values, this can lead to meaningless values being produced.
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 of the same class as x
with the specified entries
merged into one entry in all relevant components.
sumCountsAcrossFeatures
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, mergeTree = TRUE)
plot(rowTree(merged))
#
data(GlobalPatterns)
GlobalPatterns
merged <- mergeCols(GlobalPatterns,colData(GlobalPatterns)$SampleType)
merged
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.