Description Usage Arguments Value Author(s) Examples
View source: R/plotPMDSegmentation.R
This function generates a figure showing the PMD segmentation in a randomly chosen region.
1 | plotPMDSegmentation(m, segs, numRegions = 1, pdfFilename=NULL, minCover = 5)
|
m |
GRanges object containing the methylation data. |
segs |
GRanges object containing the PMD segmentation. Return value of the segmentPMDs function (see example). |
numRegions |
The number of randomly chosen regions to be plotted. The default (1) can only be changed if a pdfFilename is provided (see below). |
pdfFilename |
Name of the pdf file in which the figure is saved. If no name is provided (default), the figure is printed to the screen. |
minCover |
Only CpGs with a coverage of at least minCover reads will be used for plotting. |
No return value. The function creates a figure showing the inferred segmentation for a randomly chosen region. The figure is either printed to the screen (default) or saved as a pdf if a filename is provided. If a filename (pdfFilename) is provided, several regions (set via the numRegions argument) can be plotted and saved in a multi-page pdf file. The randomly chosen region that is displayed is broken up into 6 panels and in each panel, the raw (ie unsmoothed) methylation levels of all CpGs with a minimal coverage of 5 reads are shown. PMDs are indicated as green bars, extending over the entire PMD.
Lukas Burger lukas.burger@fmi.ch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(MethylSeekR)
# get chromosome lengths
library("BSgenome.Hsapiens.UCSC.hg18")
sLengths=seqlengths(Hsapiens)
# read methylation data
methFname <- system.file("extdata", "Lister2009_imr90_hg18_chr22.tab",
package="MethylSeekR")
meth.gr <- readMethylome(FileName=methFname, seqLengths=sLengths)
#segment PMDs
PMDsegments.gr <- segmentPMDs(m=meth.gr, chr.sel="chr22", seqLengths=sLengths)
#plot PMD segmentation examples
plotPMDSegmentation(m=meth.gr, segs=PMDsegments.gr, numRegions=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.