| mergeDMRsIteratively {DMRcaller} | R Documentation |
This function takes a list of DMRs and attempts to merge DMRs while keeping the new DMRs statistically significant.
mergeDMRsIteratively(DMRs, minGap, respectSigns = TRUE, methylationData1, methylationData2, context = "CG", minProportionDifference = 0.4, minReadsPerCytosine = 4, pValueThreshold = 0.01, test = "fisher", alternative = "two.sided", cores = 1)
DMRs |
the list of DMRs as a |
minGap |
DMRs separated by a gap of at least |
respectSigns |
logical value indicating whether to respect the sign when joining DMRs. |
methylationData1 |
the methylation data in condition 1
(see |
methylationData2 |
the methylation data in condition 2
(see |
context |
the context in which the DMRs are computed ( |
minProportionDifference |
two adjacent DMRs are merged only if the
difference in methylation proportion of the new DMR is higher than
|
minReadsPerCytosine |
two adjacent DMRs are merged only if the number of
reads per cytosine of the new DMR is higher than |
pValueThreshold |
two adjacent DMRs are merged only if the p-value of
the new DMR (see |
test |
the statistical test used to call DMRs ( |
alternative |
indicates the alternative hypothesis and must be one of
|
cores |
the number of cores used to compute the DMRs. |
the reduced list of DMRs as a GRanges object;
e.g. see computeDMRs
Nicolae Radu Zabet
filterDMRs, computeDMRs,
analyseReadsInsideRegionsForCondition and
DMRsNoiseFilterCG
# load the methylation data
data(methylationDataList)
#load the DMRs in CG context they were computed with minGap = 200
data(DMRsNoiseFilterCG)
#merge the DMRs
DMRsNoiseFilterCGLarger <- mergeDMRsIteratively(DMRsNoiseFilterCG[1:100],
minGap = 500, respectSigns = TRUE,
methylationDataList[["WT"]],
methylationDataList[["met1-3"]],
context = "CG", minProportionDifference=0.4,
minReadsPerCytosine = 1, pValueThreshold=0.01,
test="score",alternative = "two.sided")
## Not run:
#set genomic coordinates where to compute DMRs
regions <- GRanges(seqnames = Rle("Chr3"), ranges = IRanges(1,1E5))
# compute DMRs and remove gaps smaller than 200 bp
DMRsNoiseFilterCG200 <- computeDMRs(methylationDataList[["WT"]],
methylationDataList[["met1-3"]], regions = regions,
context = "CG", method = "noise_filter",
windowSize = 100, kernelFunction = "triangular",
test = "score", pValueThreshold = 0.01,
minCytosinesCount = 1, minProportionDifference = 0.4,
minGap = 200, minSize = 0, minReadsPerCytosine = 1,
cores = 1)
DMRsNoiseFilterCG0 <- computeDMRs(methylationDataList[["WT"]],
methylationDataList[["met1-3"]], regions = regions,
context = "CG", method = "noise_filter",
windowSize = 100, kernelFunction = "triangular",
test = "score", pValueThreshold = 0.01,
minCytosinesCount = 1, minProportionDifference = 0.4,
minGap = 0, minSize = 0, minReadsPerCytosine = 1,
cores = 1)
DMRsNoiseFilterCG0Merged200 <- mergeDMRsIteratively(DMRsNoiseFilterCG0,
minGap = 200, respectSigns = TRUE,
methylationDataList[["WT"]],
methylationDataList[["met1-3"]],
context = "CG", minProportionDifference=0.4,
minReadsPerCytosine = 1, pValueThreshold=0.01,
test="score",alternative = "two.sided")
#check that all newley computed DMRs are identical
print(all(DMRsNoiseFilterCG200 == DMRsNoiseFilterCG0Merged200))
## End(Not run)