meltSignals: meltSignals

View source: R/signalMatrices.R

meltSignalsR Documentation

meltSignals

Description

Aggregates and melts a list of signal matrices, for plotting (with ggplot).

Usage

meltSignals(ml, fun = NULL, splitBy = NULL, trim = 0.98, assay = 1L)

Arguments

ml

A named list of signal matrices or an EnrichmentSE object as produced by signal2Matrix

fun

An optional custom aggregation function (or named list thereof).

splitBy

A vector of values (factor or character of length equal to 'nrow(ml)') by which to split the aggregation. Can also be the name of a column of 'rowData(ml)'.

trim

The quantile above which to trim values. If a numeric vector of length 2, will be used as lower and upper quantiles beyond which to trim.

assay

Assay to use (ignored unless 'ml' is an ESE object), defaults to the first assay.

Value

A data.frame.

Examples

# we first get an EnrichmentSE object:
data(exampleESE)
# we extract the means per position:
d <- meltSignals(exampleESE)
head(d)
## we could then plot for instance using ggplot:
# ggplot(d, aes(position, mean, colour=sample)) + geom_line(size=1.2)

ETHZ-INS/epiwraps documentation built on Dec. 22, 2024, 4:05 a.m.