Learn R Programming

methylPipe (version 1.6.2)

mCsmoothing: Smoothing and plotting methylation data

Description

Smoothing and plotting methylation data, even chromosome wide.

Usage

## S3 method for class '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

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).

Details

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

Examples

Run this code
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)

Run the code above in your browser using DataLab