BSmooth {bsseq} | R Documentation |
This implements the BSsmooth smoothing algorithm for bisulfite sequencing data.
BSmooth(BSseq, ns = 70, h = 1000, maxGap = 10^8, parallelBy = c("sample", "chromosome"), mc.preschedule = FALSE, mc.cores = 1, keep.se = FALSE, verbose = TRUE)
BSseq |
An object of class |
ns |
The minimum number of methylation loci in a smoothing window. |
h |
The minimum smoothing window, in bases. |
maxGap |
The maximum gap between two methylation loci, before the smoothing is broken across the gap. The default smoothes each chromosome separately. |
parallelBy |
Should the computation be parallel by chromosome or sample, see details. |
mc.preschedule |
Passed to |
mc.cores |
Passed to |
keep.se |
Should the estimated standard errors from the smoothing algorithm be kept. This will make the return object roughly 30 percent bigger and may not be used for anything. |
verbose |
Should the function be verbose. |
ns
and h
are passed to the locfit
function. The
bandwidth used is the maximum (in genomic distance) of the h
and a width big enough to contain ns
number of methylation
loci.
The function uses the parallel package to do parallel computations. In order to use this, make sure your system have enough RAM, these are typically big objects. The computation can either be split by chromosome or by sample, which is better depends on the number of samples and how many concurrent smoothings may be done.
An object of class BSseq
, containing smoothed values and
optionally standard errors for these.
Kasper Daniel Hansen khansen@jhsph.edu
KD Hansen, B Langmead, and RA Irizarry. BSmooth: from whole genome bisulfite sequencing reads to differentially methylated regions. Genome Biology (2012) 13:R83. doi:10.1186/gb-2012-13-10-r83.
locfit
in the locfit package, as well as BSseq
.
## Not run: data(BS.chr22) BS.fit <- BSmooth(BS.chr22, verbose = TRUE) BS.fit #------------------------------------------------------------------------------- # An example using a HDF5Array-backed BSseq object # library(HDF5Array) # See ?SummarizedExperiment::saveHDF5SummarizedExperiment for details hdf5_BS.chr22 <- saveHDF5SummarizedExperiment(x = BS.chr22, dir = tempfile()) hdf5_BS.fit <- BSmooth(hdf5_BS.chr22, verbose = TRUE) hdf5_BS.fit ## End(Not run)