combine_se_objects: Merge SummarizedExperiments objects

View source: R/combine_se_objects.R

combine_se_objectsR Documentation

Merge SummarizedExperiments objects

Description

Combine several SummarizedExperiments objects into a single SummarizedExperiments object based on common genes and common colnames in colData.

Usage

combine_se_objects(se.l, info = NULL, merge.metadata = TRUE)

Arguments

se.l

list of RangedSummarizedExperiment-class objects

info

Vector of same length as se.l. Contains additional information about each SE object (e.g. study name) which will be replicated for each sample in the corresponding SE object and stored in a column named info.

merge.metadata

Logical. Should information in metadata be merged? (default: TRUE).

Value

RangedSummarizedExperiment-class object with all samples but no rowData() information

Examples

library(SummarizedExperiment)
data("se.gene")

## split SE object into two SE objects (for illustration only)
## and store in list
se.l = list(part.1 = se.gene[, 1:10],
            part.2 = se.gene[, 11:26])

se.combined = combine_se_objects(se.l = se.l)
all.equal(dim(se.gene), dim(se.combined))

## add information about parts
se.combined = combine_se_objects(se.l = se.l,
                                 info = c("part.1", "part.2"))
table(se.combined$info)

szymczak-lab/QCnormSE documentation built on March 25, 2023, 1:05 p.m.