segmentUMRsLMRs: Identify UMRs and LMRs

Description Usage Arguments Value Author(s) Examples

View source: R/segmentUMRsLMRs.R

Description

This function identifies hypomethylated regions and classifies them into UMRs and LMRs.

Usage

1
2
3
segmentUMRsLMRs(m, meth.cutoff = 0.5, nCpG.cutoff = 3, PMDs = NA,
pdfFilename, num.cores = 1, myGenomeSeq, seqLengths, nCpG.smoothing = 3,
minCover = 5)

Arguments

m

GRanges object containing the methylation data.

meth.cutoff

Cut-off on methylation for calling hypomethylated regions.

nCpG.cutoff

Cut-off on the minimal number of CpGs for calling hypomethylated regions.

PMDs

GRanges object of PMDs. Set to either the return value of the function segmentPMDs (see example) or to NA if there are no PMDs (default).

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.

num.cores

Number of cores used for the calculations.

myGenomeSeq

Genome sequence as BSgenome object.

seqLengths

A named vector indicating the chromosome lengths of the genome used.

nCpG.smoothing

The number of consecutive CpGs that the methylation levels are averaged over.

minCover

Only CpGs with a coverage of at least minCover reads will be used.

Value

Returns a GRanges object containing all UMRs and LMRs with the following metadata values: the number of CpGs with a coverage of at least minCover per region (nCG.segmentation), the number of CpGs in the DNA sequence (nCG), the total number of reads that map to CpGs in the region (T), the total number of read that map to CpGs without conversion of the C (M), the mean methylation of the segment (pmeth), the median methylation of the segment (median.meth) and the type (UMR/LMR) of region (type). The function creates a figure showing the classification of regions into UMRs and LMRs based on the number of CpGs they contain. The figure is either printed to the screen (default) or saved as a pdf if a filename is provided.

Author(s)

Lukas Burger lukas.burger@fmi.ch

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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)

FDR.cutoff <- 5 
m.sel <- 0.5 
n.sel <- 3

#segment UMRs and LMRs, assuming no PMDs
UMRLMRsegments.gr <- segmentUMRsLMRs(m=meth.gr, meth.cutoff=m.sel,
nCpG.cutoff=n.sel, myGenomeSeq=Hsapiens, seqLengths=sLengths)

MethylSeekR documentation built on Nov. 8, 2020, 6:57 p.m.