mCsmoothing {methylPipe} | R Documentation

## Smoothing and plotting methylation data

### Description

Smoothing and plotting methylation data, even chromosome wide.

### Usage

    ## S4 method for signature 'methylPipe,BSdata'
    mCsmoothing(Object, refgr, Scorefun='sum', Nbins=20,
    Context="CG", plot=TRUE)

### Arguments

`Object` | An object of class BSdata
`refgr` | GRanges; Genomic Ranges to plot the data
`Scorefun` | character; either sum or mean for smoothing
`Nbins` | numeric; the number of interval each range is divided
`Context` | character; either all or a combination of CG, CHG, and CHH
`plot` | logical; whether the smoothed profile has to be plotted

### Details

The sum or the mean methylation level is determined on each window of size Binsize and smoothed with the smooth.spline function.

### Value

A list with three components: pos (the left most point of each window), score (either the sum or the mean methylation levels), smoothed (the smoothed methylation levels).

### Author(s)

Mattia Pelizzola

### Examples

    require(BSgenome.Hsapiens.UCSC.hg18)
    uncov_GR <- GRanges(Rle('chr20'), IRanges(c(14350,69251,84185), c(18349,73250,88184)))
    H1data <- system.file('extdata', 'H1_chr20_CG_10k_tabix_out.txt.gz', package='methylPipe')
    H1.db <- BSdata(file=H1data, uncov=uncov_GR, org=Hsapiens)
    gr <- GRanges("chr20",IRanges(1,5e5))
    sres <- mCsmoothing(H1.db, gr, Scorefun='sum', Nbins=50, Context="CG", plot=TRUE)

[Package methylPipe version 1.26.0 Index]