computeDMRsReplicates {DMRcaller} | R Documentation

## Compute DMRs

### Description

This function computes the differentially methylated regions between replicates with two conditions.

### Usage

    computeDMRsReplicates(methylationData, condition = NULL, regions = NULL,
      context = "CG", method = "neighbourhood", binSize = 100,
      test = "betareg", pseudocountM = 1, pseudocountN = 2,
      pValueThreshold = 0.01, minCytosinesCount = 4,
      minProportionDifference = 0.4, minGap = 200, minSize = 50,
      minReadsPerCytosine = 4, cores = 1)

### Arguments

`methylationData` | the methylation data containing all the conditions for all the replicates.
`condition` | a vector of strings indicating the conditions for each sample in `methylationData`. Two different values are allowed (for the two conditions).
`regions` | a `GRanges` object with the regions where to compute the DMRs. If `NULL`, the DMRs are computed genome-wide.
`context` | the context in which the DMRs are computed (`"CG"`, `"CHG"` or `"CHH"`).
`method` | the method used to compute the DMRs `"neighbourhood"` or `"bins"`). The `"neighbourhood"` method computates differentially methylated cytosines. Finally, the `"bins"` method partiones the genome into equal sized tilling bins and performs the statistical test between the two conditions in each bin. For all three methods, the cytosines or bins are then merged into DMRs without affecting the inital parameters used when calling the differentiall methylated cytosines/bins (p-value, difference in methylation levels, minimum number of reads per cytosine).
`binSize` | the size of the tiling bins in nucleotides. This parameter is required only if the selected method is `"bins"`.
`test` | the statistical test used to call DMRs (`"betareg"` for Beta regression).
`pseudocountM` | numerical value to be added to the methylated reads before modelling beta regression.
`pseudocountN` | numerical value to be added to the total reads before modelling beta regression.
`pValueThreshold` | DMRs with p-values (when performing the statistical test; see `test`) higher or equal than `pValueThreshold` are discarded. Note that we adjust the p-values using the Benjamini and Hochberg's method to control the false discovery rate.
`minCytosinesCount` | DMRs with less cytosines in the specified context than `minCytosinesCount` will be discarded.
`minProportionDifference` | DMRs where the difference in methylation proportion between the two conditions is lower than `minProportionDifference` are discarded.
`minGap` | DMRs separated by a gap of at least `minGap` are not merged. Note that only DMRs where the change in methylation is in the same direction are joined.
`minSize` | DMRs with a size smaller than `minSize` are discarded.
`minReadsPerCytosine` | DMRs with the average number of reads lower than `minReadsPerCytosine` are discarded.
`cores` | the number of cores used to compute the DMRs.

### Value

the DMRs stored as a `GRanges` object with the following metadata columns:

direction

  a number indicating whether the region lost (-1) or gain (+1) methylation in condition 2 compared to condition 1.

context

  the context in which the DMRs was computed (`"CG"`, `"CHG"` or `"CHH"`).

sumReadsM1

  the number of methylated reads in condition 1.

sumReadsN1

  the total number of reads in condition 1.

proportion1

  the proportion methylated reads in condition 1.

sumReadsM2

  the number of methylated reads in condition 2.

sumReadsN2

  the total number reads in condition 2.

proportion2

  the proportion methylated reads in condition 2.

cytosinesCount

  the number of cytosines in the DMR.

regionType

  a string indicating whether the region lost (`"loss"`) or gained (`"gain"`) methylation in condition 2 compared to condition 1.

pValue

  the p-value (adjusted to control the false discovery rate with the Benjamini and Hochberg's method) of the statistical test when the DMR was called.

### Author(s)

Alessandro Pio Greco and Nicolae Radu Zabet

### Examples

    ## Not run:
    # starting with data joined using joinReplicates
    data("syntheticDataReplicates")

    # compute the DMRs in CG context with neighbourhood method

    # creating condition vector
    condition <- c("a", "a", "b", "b")

    # computing DMRs using the neighbourhood method
    DMRsReplicatesNeighbourhood <- computeDMRsReplicates(methylationData = methylationData,
                                                         condition = condition,
                                                         regions = NULL,
                                                         context = "CHH",
                                                         method = "neighbourhood",
                                                         test = "betareg",
                                                         pseudocountM = 1,
                                                         pseudocountN = 2,
                                                         pValueThreshold = 0.01,
                                                         minCytosinesCount = 4,
                                                         minProportionDifference = 0.4,
                                                         minGap = 200,
                                                         minSize = 50,
                                                         minReadsPerCytosine = 4,
                                                         cores = 1)

    ## End(Not run)

[Package DMRcaller version 1.24.0 Index]