Using a chromDictMeth() output object, quickly calculate the mean methylation difference across set of regions.

MethyDiff_Set(chromDictMeth, regions)

Arguments

chromDictMeth

chromDictMeth() output object

regions

data.frame of regions, where column 1 = chromosome, column 2 = region start, and column 3 = region end

Value

Returns the regions object with a mean percent methylation column.

Examples

chromDictMethylDiff <- chromDictMeth(eigen, c("trt", "ctl"))
#> Removing low depth sites...
#> Calculating mean methylation differences...
#> Splitting by chromosome...
regions <- data.frame(chr=c("chr3", "chr3", "chr1"),
                      s=c(4920450, 3961576, 300000),
                      e=c(4923267, 3963805, 302900),
                      ID=c("Hypo-DMR", "partial Hyper-DMR", "random"))

MethyDiff_Set(chromDictMethylDiff, regions)
#>    chr       s       e                ID mean_methylDiff
#> 1 chr3 4920450 4923267          Hypo-DMR     -0.54937676
#> 2 chr3 3961576 3963805 partial Hyper-DMR      0.21200740
#> 3 chr1  300000  302900            random     -0.09435562