segmentPMDs: PMD segmenter

Description Usage Arguments Value Author(s) Examples

View source: R/segmentPMDs.R

Description

This function trains a Hidden Markov Model (HMM) to detect partially methylated domains (PMDs) in Bis-seq data.

Usage

1
segmentPMDs(m, chr.sel, pdfFilename = NULL, seqLengths, num.cores = 1, nCGbin = 101)

Arguments

m

GRanges object containing the methylation data.

chr.sel

Chromosome on which HMM should be trained. Must be one of the sequence levels of m.

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.

seqLengths

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

num.cores

The number of cores used for the calculations (default 1).

nCGbin

The number of CpGs in each sliding window used to calculate alpha (default 101). The default is highly recommended.

Value

A GRanges object containing segments that partition the genome into PMDs and regions outside of PMDs. The object contains two metadata columns indicating the type of region (PMD/notPMD) and the number of covered (by at least 5 reads) CpGs (nCG) in the region. The function also creates a figure showing the inferred emission distributions of the HMM that 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
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)

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