segmentPMDs {MethylSeekR} | R Documentation

## PMD segmenter

### Description

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

### Usage

    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

    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)

[Package MethylSeekR version 1.24.0 Index]