merge-methods: Merge a subset of the rows or columns

Description Usage Arguments Value Examples

Description

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.

Usage

1
2
3
4
5
6
7
8
9
mergeRows(x, f, archetype = 1L, ...)

## S4 method for signature 'SummarizedExperiment'
mergeRows(x, f, archetype = 1L, ...)

mergeCols(x, f, archetype = 1L, ...)

## S4 method for signature 'SummarizedExperiment'
mergeCols(x, f, archetype = 1L, ...)

Arguments

x

SummarizedExperiment

f

A factor for merging. Must be the same length as nrow(x)/ncol(x). Rows/Cols corresponding to the same level will be merged. If length(levels(f)) == nrow(x)/ncol(x), x will be returned unchanged.

archetype

Of each level of f, which element should be regarded as the archetype and metadata in the columns or rows kept, while merging? This can be single interger value or an integer vector of the same length as levels(f). (Default: archetype = 1L, which means the first element encountered per factor level will be kept)

...

optional arguments passed onto sumCountsAcrossFeatures, except subset_row, subset_col

Value

an object with the same class x with the specified entries merged into one entry in all relevant components.

Examples

1
2
3
4
example_sce <- scater::mockSCE()
ids <- sample(LETTERS, nrow(example_sce), replace=TRUE)
out <- mergeRows(example_sce, ids)
out

FelixErnst/SEtup documentation built on Oct. 27, 2020, 11:35 p.m.