regionCounts: Get regional counts for given GRanges or GRangesList object

Description Usage Arguments Value Examples

Description

Convert methylRaw, methylRawList or methylBase object into regional counts for a given GRanges or GRangesList object.

Usage

1
  regionCounts(object,regions,cov.bases=0,strand.aware=FALSE)

Arguments

object

a methylRaw or methlRawList object

regions

a GRanges or GRangesList object.

cov.bases

number minimum bases covered per region (Default:0). Only regions with base coverage above this threshold are returned.

strand.aware

if set to TRUE only CpGs that match the strand of the region will be summarized. (default:FALSE)

Value

a new methylRaw,methylBase or methylRawList object. If strand.aware is set to FALSE (default). Even though the resulting object will have the strand information of regions it will still contain methylation information from both strands.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(methylKit)

# get the windows of interest as a GRanges object, this can be any set
# of genomic locations
library(GenomicRanges)
my.win=GRanges(seqnames="chr21",
ranges=IRanges(start=seq(from=9764513,by=10000,length.out=20),width=5000) )

# getting counts per region
regional.methylRaw=regionCounts(object=methylRawList.obj, regions=my.win,
cov.bases=0,strand.aware=FALSE)

fortunatobianconi/methylkit documentation built on May 16, 2019, 1:51 p.m.