combine-SummarizedExperiment-SummarizedExperiment-method: Combining SummarizedExperiment/RangedSummarizedExperiment...

Description Usage Arguments Details Value Note for Developers Author(s) Examples

Description

Combine multiple SummarizedExperiment or RangedSummarizedExperiment objects using a union strategy.

Usage

1
2
## S4 method for signature 'SummarizedExperiment,SummarizedExperiment'
combine(x, y, ...)

Arguments

x

A DataFrame object.

y

A DataFrame object.

...

One or more DataFrame objects.

Details

SummarizedExperiment objects are combined based on the names of x, y, and ..., while RangedSummarizedExperiment are combined based on finding matching rowRanges() of x, y, and .... WARNING: Does not currently work if the rowRanges slot of x, y, or ... is a GRangesList objects.

Value

A DataFrame object.

Note for Developers

Any class that extends the SummarizedExperiment or RangedSummarizedExperiment class by adding additional slots will need to be careful when defining a combine() method for the new class if it wants to call combine,SummarizedExperiment-method by inheritance through callNextMethod(). Specifically, the combine() method will need to first update these additional slots, update the corresponding slots in x (thus likely making x an invalid object), and then calling callNextMethod(). An alternative would be to set check = FALSE when replacing the slots in the combine,SummarizedExperiment,SummarizedExperiment-method, but this would require that the validity of each slot was checked in some other way to guard against generally returning of unvalidated SummarizedExperiment or RangedSummarizedExperiment objects.

Author(s)

Peter Hickey, peter.hickey@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
nrows <- 200; ncols <- 6
counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
colData <- DataFrame(Treatment = rep(c("ChIP", "Input"), 3),
                     row.names = LETTERS[1:6])
se <- SummarizedExperiment(assays = SimpleList(counts = counts),
                            colData = colData)
names(se) <- paste0("f", 1:200)
x <- se[1:150, 1:4]
y <- se[30:170, 2:6]
combine(x, y)
rowRanges <- GRanges(rep(c("chr1", "chr2"), c(50, 150)),
                     IRanges(floor(runif(200, 1e5, 1e6)), width = 100),
                     strand = sample(c("+", "-"), 200, TRUE),
                     feature_id = sprintf("ID%03d", 1:200))
rse <- se
rownames(rse) <- NULL
rowRanges(rse) <- rowRanges
x <- rse[1:150, 1:4]
y <- rse[30:170, 2:6]
combine(x, y)

PeteHaitch/SparseSummarizedExperiment documentation built on May 8, 2019, 1:31 a.m.