DMR.plot: Plotting DMRs

DMR.plotR Documentation

Plotting DMRs

Description

Plots an individual DMR (in context of possibly other DMRs) as found by dmrcate. Heatmaps are shown as well as proximal coding regions, smoothed methylation values (with an option for smoothed group means) and chromosome ideogram.

Usage

DMR.plot(ranges, dmr, CpGs, what = c("Beta", "M"), 
         arraytype = c("EPICv2", "EPICv1", "450K"), phen.col, 
         genome = c("hg19", "hg38", "mm10"), labels = names(ranges), 
         group.means = FALSE, extra.ranges = NULL, 
         extra.title = names(extra.ranges))

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 GenomicRatioSet, annotated with the appropriate array and data types

- A BSseq object containing per-CpG methylation and coverage counts for the samples to be plotted

what

Does CpGs (if a matrix) contain Beta or M-values? Not needed if object is a GenomicRatioSet or BSseq object.

arraytype

Is CpGs (if a matrix) sourced from EPIC or 450K data? Not needed if object is a GenomicRatioSet or BSseq 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"

labels

Vector of DMR names to be displayed. Defaults to names(ranges).

group.means

Whether to plot smoothed methylation by individual sample (FALSE) or by groups defined in phen.col (TRUE).

extra.ranges

Optional GRanges object. Will plot any range overlapping a DMR..

extra.title

Vector of names for ranges from extra.ranges. Defaults to names(extra.ranges).

Value

A plot to the current device.

Author(s)

Tim J. Peters <t.peters@garvan.org.au>, Aaron Statham <a.statham@garvan.org.au>

Examples

library(GenomicRanges)
library(AnnotationHub)
ah <- AnnotationHub()
EPICv2manifest <- ah[["AH116484"]]
dmrranges <- GRanges("chr2:86787856-86793994")
probes <- EPICv2manifest$IlmnID[EPICv2manifest$CHR=="chr2" & 
                                EPICv2manifest$MAPINFO > 86770000 &
                                EPICv2manifest$MAPINFO < 86810000]
probes <- probes[order(EPICv2manifest[probes, "MAPINFO"])]
object <- minfi::logit2(matrix(rbeta(length(probes)*10, 3, 1), 
                               length(probes), 10))
rownames(object) <- probes
object[9:35, 6:10] <- minfi::logit2(matrix(rbeta(135, 1, 3), 27, 5))
cols <- c(rep("forestgreen", 5), rep("magenta", 5))
names(cols) <- rep(c("Ctrl", "Treat"), each=5)
DMR.plot(dmrranges, dmr = 1, CpGs=object, what = "M", arraytype="EPICv2", 
         phen.col=cols, genome="hg38", group.means = TRUE)

timpeters82/DMRcate-devel documentation built on April 5, 2024, 9:23 a.m.