plotMethylationDataSpatialCorrelation: Plot methylation data spatial correlation

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/spatialCorrelation.R

Description

This function plots the correlation of methylation levels for Cytosines located at a certain distance apart.

Usage

1
2
3
4
5
plotMethylationDataSpatialCorrelation(methylationData1,
  methylationData2 = NULL, distances, regions = NULL,
  conditionsNames = NULL, context = "CG", labels = NULL, col = NULL,
  pch = c(1, 0, 16, 2, 15, 17), lty = c(4, 1, 3, 2, 6, 5),
  contextPerRow = FALSE, log = "")

Arguments

methylationData1

the methylation data in condition 1 (see methylationDataList).

methylationData2

the methylation data in condition 2 (see methylationDataList). This is optional.

distances

a numeric vector specifing the different values for the distances when computing the correlation.

regions

a GRanges object with the regions where to compute the correlation. If NULL, the coverage is computed genome-wide.

conditionsNames

a vector of character with the names of the conditions for methylationData1 and methylationData2.

context

the context in which the DMRs are computed ("CG", "CHG" or "CHH").

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 colors. It needs to contain a minimum of 2 colors per condition. If not or if NULL, the defalut colors will be used.

pch

the R symbols used to plot the data. It needs to contain a minimum of 2 symbols per condition. If not or if NULL, the defalut symbols will be used.

lty

the line types used to plot the data. It needs to contain a minimum of 2 line types per condition. If not or if NULL, the defalut line types will be used.

contextPerRow

a logical value indicating if the each row represents an individual context. If FALSE, each column will represent an individual context.

log

a character indicating if any of the axes will be displayed on log scale. This argument will be passed to plot function.

Details

This function plots the proportion of cytosines in a specific context that have at least a certain number of reads (x-axis)

Value

Invisibly returns NULL

Author(s)

Nicolae Radu Zabet

See Also

computeMethylationDataSpatialCorrelation, methylationDataList

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
## Not run: 
# load the methylation data
data(methylationDataList)

# plot the spatial correlation in CG context
par(mar=c(4, 4, 3, 1)+0.1)
plotMethylationDataSpatialCorrelation(methylationDataList[["WT"]],
                           distances = c(1,5,10,15), regions = NULL,
                           conditionsNames = c("WT","met1-3"),
                           context = c("CG"),
                           labels = LETTERS, col = NULL,
                           pch = c(1,0,16,2,15,17), lty = c(4,1,3,2,6,5),
                           contextPerRow = FALSE)

# plot the spatial correlation in all three contexts
plotMethylationDataSpatialCorrelation(methylationDataList[["WT"]],
                           methylationDataList[["met1-3"]],
                           distances = c(1,5,10,15,20,50,100,150,200,500,1000),
                           regions = NULL, conditionsNames = c("WT","met1-3"),
                           context = c("CG", "CHG", "CHH"),
                           labels = LETTERS, col = NULL,
                           pch = c(1,0,16,2,15,17), lty = c(4,1,3,2,6,5),
                           contextPerRow = FALSE, log="x")

## End(Not run)

DMRcaller documentation built on Nov. 8, 2020, 5:26 p.m.