Learn R Programming

MultiDataSet (version 1.0.2)

add_rse: Method to add a RangedSummarizedExperiment to MultiDataSet.

Description

This method adds or overwrites a slot of a MultiDataSet with the content of the given RangedSummarizedExperiment.

Usage

add_rse(object, set, dataset.type, dataset.name = NULL, warnings = TRUE, overwrite = FALSE)

Arguments

object
MultiDataSet that will be filled.
set
Object derived from RangedSummarizedExperiment to be used to fill the slot.
dataset.type
Character with the type of data of the omic set (e.g. expression, methylation...)
dataset.name
Character with the specific name for this set (NULL by default). It is useful when there are several sets of the same type (e.g. multiple expression assays)
warnings
Logical to indicate if warnings will be displayed.
overwrite
Logical to indicate if the set stored in the slot will be overwritten.

Value

A new MultiDataSet with a slot filled.

Examples

Run this code
if (require(GenomicRanges) & require(SummarizedExperiment)){
multi <- createMultiDataSet()
counts <- matrix(runif(200 * 6, 1, 1e4), 200)
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))
colData <- DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
                    row.names=LETTERS[1:6], id = LETTERS[1:6])
names(rowRanges) <- 1:200
rse <- SummarizedExperiment(assays=SimpleList(counts=counts),
                            rowRanges=rowRanges, colData=colData)
multi <- add_rse(multi, rse, "rseEx")
}

Run the code above in your browser using DataLab