summarize {profileplyr} | R Documentation |
summarize the rows of a deepTools matrix
summarize(object = "profileplyr", fun = "function", output = "character", keep_all_mcols = "logical") ## S4 method for signature 'profileplyr' summarize(object = "profileplyr", fun = "function", output = "character", keep_all_mcols = FALSE)
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. |
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
If output="matrix" returns a matrix, if output="long" returns a data.frame in long format, if output="long" returns a SummarizedExperiment object
profileplyr
: summarize the rows of a deepTools matrix
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")