Last data update: 2014.03.03

R: Consolidating Differentially Methylated Regions (DMRs)
consolidateDMRsR Documentation

Consolidating Differentially Methylated Regions (DMRs)

Description

Joins differentially methylated regions according to their proximity to each other, statistical significance and methylation difference

Usage

consolidateDMRs(DmrGR, pvThr=0.05, MethDiff_Thr=NULL, log2Er_Thr =NULL, GAP=0, type=NULL, correct=FALSE)

Arguments

DmrGR

the GRanges object resulting from the findDMR function

pvThr

numeric; the minimum pvalue for a DMR to be selected

MethDiff_Thr

numeric; the absolute value of minimum methylation difference percentage (for both hyper- and hypo-methyaltion) cutoff for the selection of a DMR

log2Er_Thr

numeric; the absolute value of minimum log2Enrichment (for both hyper- and hypo-methyaltion) cutoff for the selection of a DMR

GAP

numeric; the minimum distance between two adjacent DMRs; DMRs closer than that will be joined, resulting DMRs will be updated mean methylation difference and Pvalues combined using the Fisher's Method

type

character; one of the "hyper" or "hypo", specifies the type of differentially menthylated regions selected

correct

logical; whether to correct the pvalues using the Benjamini-Hochberg muliple testing correction method

Details

After the DMRs are identified by findDMR method, a consolidation can be applied on them. This functions allows to select hyper/hypo differentially methylated regions based on P-value and absolute methylation change thresholds. Moreover, DMRs closer than a given distance can be joined. The final GRanges object with the set of final DMRs will be provided with updated mean methylation difference and Pvalues combined using the Fisher's Method.

Value

Either NULL or a GRanges object containing the differential methylated regions satisfying the criteria.

Author(s)

Kamal Kishore

See Also

findDMR

Examples

DMRs_file <- system.file('extdata', 'DMRs.Rdata', package='methylPipe')
load(DMRs_file)
hyper.DMRs.conso <- consolidateDMRs(DmrGR=DMRs, pvThr=0.05, GAP=100, type="hyper", correct=TRUE)
hyper.DMRs.conso

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(methylPipe)
Loading required package: GenomicRanges
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: Rsamtools
Loading required package: Biostrings
Loading required package: XVector
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/methylPipe/consolidateDMRs.Rd_%03d_medium.png", width=480, height=480)
> ### Name: consolidateDMRs
> ### Title: Consolidating Differentially Methylated Regions (DMRs)
> ### Aliases: consolidateDMRs
> 
> ### ** Examples
> 
> DMRs_file <- system.file('extdata', 'DMRs.Rdata', package='methylPipe')
> load(DMRs_file)
> hyper.DMRs.conso <- consolidateDMRs(DmrGR=DMRs, pvThr=0.05, GAP=100, type="hyper", correct=TRUE)
> hyper.DMRs.conso
GRanges object with 12 ranges and 3 metadata columns:
       seqnames           ranges strand |    pValue MethDiff_Perc
          <Rle>        <IRanges>  <Rle> | <numeric>     <numeric>
   [1]    chr20 [116757, 118582]      * |     0.001        32.307
   [2]    chr20 [119181, 119573]      * |     0.022         34.83
   [3]    chr20 [153996, 154735]      * |     0.025         31.17
   [4]    chr20 [155803, 157758]      * |     0.001        45.717
   [5]    chr20 [185301, 186170]      * |     0.004        35.945
   ...      ...              ...    ... .       ...           ...
   [8]    chr20 [220178, 220847]      * |     0.022         58.74
   [9]    chr20 [225517, 225703]      * |     0.023         42.32
  [10]    chr20 [274341, 274507]      * |     0.022         27.35
  [11]    chr20 [337651, 338101]      * |     0.022         51.62
  [12]    chr20 [390913, 391660]      * |     0.005        28.625
       log2Enrichment
            <numeric>
   [1]          0.916
   [2]           0.72
   [3]          0.944
   [4]          1.307
   [5]           0.95
   ...            ...
   [8]          1.944
   [9]           1.39
  [10]          0.514
  [11]          2.268
  [12]           2.95
  -------
  seqinfo: 1 sequence from an unspecified genome; no seqlengths
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>