# load the methylation data
data(methylationDataList)
# the region where to compute the profile
region <- GRanges(seqnames = Rle("Chr3"), ranges = IRanges(1,1E6))
# compute low resolution profile in 20 Kb windows
lowResProfileWTCG <- computeMethylationProfile(methylationDataList[["WT"]],
region, windowSize = 20000, context = "CG")
lowResProfilsCG <- GRangesList("WT" = lowResProfileWTCG)
#plot the low resolution profile
par(mar=c(4, 4, 3, 1)+0.1)
par(mfrow=c(1,1))
plotMethylationProfile(lowResProfilsCG, autoscale = FALSE,
title="CG methylation on Chromosome 3",
col=c("#D55E00","#E69F00"), pch = c(1,0),
lty = c(4,1))
## Not run:
# # compute low resolution profile in 10 Kb windows in CG context
# lowResProfileWTCG <- computeMethylationProfile(methylationDataList[["WT"]],
# region, windowSize = 10000, context = "CG")
#
# lowResProfileMet13CG <- computeMethylationProfile(
# methylationDataList[["met1-3"]], region,
# windowSize = 10000, context = "CG")
#
# lowResProfileCG <- GRangesList("WT" = lowResProfileWTCG,
# "met1-3" = lowResProfileMet13CG)
#
# # compute low resolution profile in 10 Kb windows in CHG context
# lowResProfileWTCHG <- computeMethylationProfile(methylationDataList[["WT"]],
# region, windowSize = 10000, context = "CHG")
#
# lowResProfileMet13CHG <- computeMethylationProfile(
# methylationDataList[["met1-3"]], region,
# windowSize = 10000, context = "CHG")
#
# lowResProfileCHG <- GRangesList("WT" = lowResProfileWTCHG,
# "met1-3" = lowResProfileMet13CHG)
#
# # plot the low resolution profile
# par(mar=c(4, 4, 3, 1)+0.1)
# par(mfrow=c(2,1))
# plotMethylationProfile(lowResProfileCG, autoscale = FALSE,
# labels = LETTERS[1],
# title="CG methylation on Chromosome 3",
# col=c("#D55E00","#E69F00"), pch = c(1,0),
# lty = c(4,1))
# plotMethylationProfile(lowResProfileCHG, autoscale = FALSE,
# labels = LETTERS[2],
# title="CHG methylation on Chromosome 3",
# col=c("#0072B2", "#56B4E9"), pch = c(16,2),
# lty = c(3,2))
# ## End(Not run)
Run the code above in your browser using DataLab