DMR.plot: Plotting DMRs

Description Usage Arguments Value Author(s) Examples

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

1
2
3
4
DMR.plot(ranges, dmr, CpGs, what=c("Beta", "M"), 
         arraytype=c("EPIC", "450K"), phen.col, 
         genome = c("hg19", "hg38", "mm10"), 
         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 GenomicRatioSet, annotated with the appropriate array and data types

- 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.

what

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

arraytype

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

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.

Author(s)

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 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, what="M", arraytype = "450K",
                             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, what="Beta", arraytype = "450K", 
         phen.col=cols, genome="hg19", samps=samps)

## End(Not run)

rcavalcante/DMRcate documentation built on May 21, 2019, 10:13 a.m.