binMatrix-methods: Bins the columns of a matrix using a user provided function

Description Usage Arguments Value Examples

Description

Bins the columns of a matrix using a user provided function

Usage

1
2
3
4
5
6
7
binMatrix(x, bin.num = NULL, fun = "mean")

## S4 method for signature 'ScoreMatrix'
binMatrix(x, bin.num = NULL, fun = "mean")

## S4 method for signature 'ScoreMatrixList'
binMatrix(x, bin.num = NULL, fun = "mean")

Arguments

x

ScoreMatrix or a ScoreMatrixList object

bin.num

integer number of bins in the final matrix

fun

character vector or an anonymous function that will be used for binning

Value

ScoreMatrix or ScoreMatrixList object

Examples

1
2
3
4
5
6
7
8
9
# binning the columns in a ScoreMatrix object
library(GenomicRanges)
target = GRanges(rep(c(1,2),each=7), IRanges(rep(c(1,1,2,3,7,8,9), times=2), width=5), 
weight = rep(c(1,2),each=7), 
strand=c('-', '-', '-', '-', '+', '-', '+', '-', '-', '-', '-', '-', '-', '+'))
windows = GRanges(rep(c(1,2),each=2), IRanges(rep(c(1,2), times=2), width=5), 
strand=c('-','+','-','+'))
sm = ScoreMatrix(target, windows)
bin = binMatrix(sm, bin.num=2)

BIMSBbioinfo/genomation documentation built on March 13, 2020, 5:28 a.m.