summarize: summarize the rows of a deepTools matrix

Description Usage Arguments Details Value Methods (by class) Examples

Description

summarize the rows of a deepTools matrix

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
summarize(
  object = "profileplyr",
  fun = "function",
  output = "character",
  keep_all_mcols = "logical",
  sampleData_columns_for_longPlot = "character"
)

## S4 method for signature 'profileplyr'
summarize(
  object = "profileplyr",
  fun = "function",
  output = "character",
  keep_all_mcols = FALSE,
  sampleData_columns_for_longPlot = NULL
)

Arguments

object

A profileplyr object

fun

the function used to summarize the ranges (e.g. rowMeans or rowMax)

output

Must be either "matrix", "long", or "object".

keep_all_mcols

if output is 'long' and this is set to TRUE, then all metadata columns in the rowRanges will be included in the output. If FALSE (default value), then only the column indicated in the 'rowGroupsInUse' slot of the metadata will be included in the output dataframe.

sampleData_columns_for_longPlot

If output is set to 'long', then this argument can be used to add information stored in sampleData(object) to the summarized data frame. This needs to be a character vector with elements matching coumn names in sampleData(object).

Details

Takes a SE object and outputs a summarized experiment object with a matrix containing ranges as rows and each sample having one column with summary statistic

Value

If output="matrix" returns a matrix, if output="long" returns a data.frame in long format, if output="object" returns a SummarizedExperiment object with the summarized matrix.

Methods (by class)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
example <- system.file("extdata", "example_deepTools_MAT", package = "profileplyr") 
object <- import_deepToolsMat(example)

# output matrix (can be used to make a heatmap)

object_sumMat <- summarize(object, fun = rowMeans, output = "matrix") 

# output long dataframe for ggplot

object_long <- summarize(object, fun = rowMeans, output = "long") 
object_long[1:3, ]

library(ggplot2)
ggplot(object_long, aes(x = Sample, y = log(Signal))) + geom_boxplot()

# output profileplyr object containing summarized matrix

summarize(object, fun = rowMeans, output = "object")

profileplyr documentation built on Nov. 8, 2020, 8:12 p.m.