averagePerBinBSseqLike: Find the average values of x in provided bins

View source: R/utils.R

averagePerBinBSseqLikeR Documentation

Find the average values of x in provided bins

Description

Uses a method similar to BSseq::getMeth(bsseq, regions=bins, what="perRegion"). Note, this method may not return the same results as averagePerBin().

Usage

averagePerBinBSseqLike(x, bins)

Arguments

x

GRanges with values to find average of

bins

GRanges with bins to average over

Value

matrix

Examples


gr1 <- GRanges(seqnames = "chr2", ranges = IRanges(103, 106), strand = "+", score = 5L, GC = 0.45)
gr2 <- GRanges(
    seqnames = c("chr1", "chr2"),
    ranges = IRanges(c(107, 113), width = 3),
    strand = c("+", "-"),
    score = 3:4, GC = c(0.3, 0.5))
gr3 <- mergeMCols(gr1, gr2)

bins <- GRanges(seqnames=c("chr1","chr2", "chr3"), ranges=IRanges(c(100, 100, 100), width=15))

averagePerBinBSseqLike(gr3, bins)


huishenlab/bisplotti documentation built on Sept. 20, 2023, 10:13 p.m.