Learn R Programming

DMRcate (version 1.8.6)

DMR.plot: Plotting DMRs

Description

Plots an individual DMR (in context of possibly other DMRs) as found by dmrcate. Heatmap and mean methylation plots are shown as well as genomic coordinates and proximal coding regions.

Usage

DMR.plot(ranges, dmr, CpGs, phen.col, genome = c("hg19", "hg38", "mm10"), array.annotation = c(array = "IlluminaHumanMethylation450k", annotation = "ilmn12.hg19"), samps = NULL, ...)

Arguments

ranges
A GRanges object (ostensibly created by extractRanges() describing DMR coordinates.
dmr
Index of ranges (one integer only) indicating which DMR to be plotted.
CpGs
Either: - A matrix of beta values for plotting, with unique Illumina probe IDs as rownames. - A GRanges object describing individual CpGs to be plotted, containing methylated reads and total coverage for each sample. Please see the worked example in the vignette for the correct structure of this object.
phen.col
Vector of colors denoting phenotypes of all samples described in CpGs. See vignette for worked example.
genome
Reference genome for annotating DMRs. Can be one of "hg19", "hg38" or "mm10"
array.annotation
A vector describing the type of annotation from which plots are derived. Identical context to minfi, i.e. annotation <- annotation(minfiobject) where minfiobject is a [Genomic](Methyl|Ratio)Set). Argument for 450K arrays: c(array = "IlluminaHumanMethylation450k", annotation = "ilmn12.hg19"). Argument for EPIC arrays: c(array = "IlluminaHumanMethylationEPIC", annotation = "ilm10b2.hg19"). An error will be thrown if you attempt one on CpGs with rownames on the other, due to non-overlapping probes on both platforms. Only applicable when datatype="array".
samps
Vector of samples to be plotted, corresponding to indices of phen.col. Default is all samples plotted.
...
Extra arguments passed to Gviz:::plotTracks().

Value

A plot to the current device.

Examples

Run this code
## Not run: 
# data(dmrcatedata)
# myMs <- logit2(myBetas)
# myMs.noSNPs <- rmSNPandCH(myMs, dist=2, mafcut=0.05)
# patient <- factor(sub("-.*", "", colnames(myMs)))
# type <- factor(sub(".*-", "", colnames(myMs)))
# design <- model.matrix(~patient + type) 
# myannotation <- cpg.annotate("array", myMs.noSNPs, analysis.type="differential",
#     design=design, coef=39)
# dmrcoutput <- dmrcate(myannotation, lambda=1000, C=2)
# results.ranges <- extractRanges(dmrcoutput, genome = "hg19")
# groups <- c(Tumour="magenta", Normal="forestgreen")
# cols <- groups[as.character(type)]
# samps <- c(1:6, 38+(1:6))
# DMR.plot(ranges=results.ranges, dmr=1, CpGs=myBetas, phen.col=cols, genome="hg19", samps=samps)
# ## End(Not run)

Run the code above in your browser using DataLab