metagene_aggregate: Metagene Aggregate

Description Usage Arguments Details Value Examples

Description

Metagene aggregate from an S3 metagene object.

Usage

1
metagene_aggregate(m, aggregate_fun = "mean", transform_fun = NULL, ...)

Arguments

m

the object to create the metagene aggregate for

aggregate_fun

the function name to aggregate values such as 'events', 'sum', 'mean', 'ttest' (default is 'mean')

transform_fun

a function to be applied to vlues before aggregate function is applied.

...

other arguments passed to fun

Details

Aggregates values. transform_fun takes a matrix as input and returns a similar sized matrix. ie log2p1 <- function(m)log2(m+1) aggreagate_fun can be mean, sum, events or t.test or vector containing several of those.

Value

a tibble with column, rel_pos, sample, group, and aggregate values where column name is mean, sum, events or estimate+conf.low+conf.high for ttest

Examples

1
2
3
4
5
6
7
 fname <- system.file("extdata", "matrix_grouped.gz", package = "RMetaTools")
 m <- load_deeptoolsmatrix3_new(fname)
 metagene_aggregate(m)
 metagene_aggregate(m, aggregate_fun = 'events')
 metagene_aggregate(m, aggregate_fun = 'ttest')
 log2p1 <- function(m){log2(m+1)}
 metagene_aggregate(m, aggregate_fun = 'mean', transform_fun = log2p1)

manschmi/RMetaTools documentation built on Dec. 14, 2021, 4:33 a.m.