plotOverlapProfile: Plot overlap profile

Description Usage Arguments Value Author(s) See Also Examples

View source: R/profile.R

Description

This function plots the distribution of a set of subregions on a large region.

Usage

1
2
3
plotOverlapProfile(overlapsProfiles1, overlapsProfiles2 = NULL,
  names = NULL, labels = NULL, col = NULL, title = "",
  logscale = FALSE, maxValue = NULL)

Arguments

overlapsProfiles1

a GRanges object with the overlaps profile; see computeOverlapProfile.

overlapsProfiles2

a GRanges object with the overlaps profile; see computeOverlapProfile. This is optional. For example, one can be use overlapsProfiles1 to display hypomethylated regions and overlapsProfiles2 the hypermethylated regions.

names

a vector of character to add labels for the two overlapsProfiles. This is an optinal parameter.

labels

a vector of character used to add a subfigure character to the plot. If NULL nothing is added.

col

a character vector with the colours. It needs to contain 2 colours. If not or if NULL, the defalut colours will be used.

title

the title of the plot.

logscale

a logical value indicating if the colours are on logscale or not.

maxValue

a maximum value in a region. Used for the colour scheme.

Value

Invisibly returns NULL.

Author(s)

Nicolae Radu Zabet

See Also

computeOverlapProfile, filterDMRs, computeDMRs and mergeDMRsIteratively

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# load the methylation data
data(methylationDataList)

# load the DMRs in CG context
data(DMRsNoiseFilterCG)

# the coordinates of the area to be plotted
largeRegion <- GRanges(seqnames = Rle("Chr3"), ranges = IRanges(1,1E5))

# compute overlaps distribution
hotspotsHypo <- computeOverlapProfile(DMRsNoiseFilterCG, largeRegion,
                 windowSize = 10000, binary = FALSE)

plotOverlapProfile(GRangesList("Chr3"=hotspotsHypo),
                   names = c("hypomethylated"), title = "CG methylation")

## Not run: 

largeRegion <- GRanges(seqnames = Rle("Chr3"), ranges = IRanges(1,1E6))

hotspotsHypo <- computeOverlapProfile(
               DMRsNoiseFilterCG[(DMRsNoiseFilterCG$regionType == "loss")],
               largeRegion, windowSize=2000, binary=TRUE, cores=1)

hotspotsHyper <- computeOverlapProfile(
               DMRsNoiseFilterCG[(DMRsNoiseFilterCG$regionType == "gain")],
               largeRegion, windowSize=2000, binary=TRUE, cores=1)

plotOverlapProfile(GRangesList("Chr3"=hotspotsHypo),
                   GRangesList("Chr3"=hotspotsHyper),
                   names=c("loss", "gain"), title="CG methylation")

## End(Not run)

nrzabet/DMRcaller documentation built on May 23, 2019, 2:50 p.m.