tile_by_regions: Group cytosine / CpG level data into regions based on genomic...

View source: R/tile_by_regions.R

tile_by_regionsR Documentation

Group cytosine / CpG level data into regions based on genomic regions

Description

An optional function to aggregate cytosine / CpG level data into regions based on a GRanges set of genomic regions.

Usage

tile_by_regions(bs, gr)

Arguments

bs

a BSseq object.

gr

a GRanges object.

Value

A BSseq object with loci of regions matching gr. Coverage and methylation read count matrices are aggregated by the sums of the cytosines / CpGs in the regions per sample.

Examples

data(bsseq_stranded, package = 'methylSig')
regions = GenomicRanges::GRanges(
    seqnames = c('chr1','chr1','chr1'),
    ranges = IRanges::IRanges(
        start = c(5,35,75),
        end = c(30,70,80)
    )
)
tiled = tile_by_regions(bs = bsseq_stranded, gr = regions)


sartorlab/methylSig documentation built on March 26, 2023, 10:04 a.m.