| smoothSds {bsseq} | R Documentation |
Smooth the standard deviations using a thresholded running mean based on smoothed whole-genome bisulfite sequencing data.
smoothSds(BSseqStat, k = 101, qSd = 0.75, mc.cores = 1, maxGap = 10^8,
verbose = TRUE)
BSseqStat |
An object of class |
k |
A positive scalar, see details. |
qSd |
A scalar between 0 and 1, see details. |
mc.cores |
The number of cores used. Note that setting
|
maxGap |
A scalar greater than 0, see details. |
verbose |
Should the function be verbose? |
The standard deviation estimates are smoothed using a running mean with a
width of k and thresholded using qSd which sets the minimum
standard deviation to be the qSd-quantile.
An object of class BSseqStat. More speciically, the input
BSseqStat object with the computed statistics added to the
stats slot (accessible with getStats).
Kasper Daniel Hansen khansen@jhsph.edu
BSmooth.fstat for the function to create the appropriate
BSseqStat input object.
BSseqStat also describes the return class. This
function is likely to be followed by the use of computeStat.
if(require(bsseqData)) {
# library(limma) required for makeContrasts()
library(limma)
data(keepLoci.ex)
data(BS.cancer.ex.fit)
BS.cancer.ex.fit <- updateObject(BS.cancer.ex.fit)
## Remember to subset the BSseq object, see vignette for explanation
## TODO: Kind of a forced example
design <- model.matrix(~0 + BS.cancer.ex.fit$Type)
colnames(design) <- gsub("BS\\.cancer\\.ex\\.fit\\$Type", "",
colnames(design))
contrasts <- makeContrasts(
cancer_vs_normal = cancer - normal,
levels = design
)
BS.stat <- BSmooth.fstat(BS.cancer.ex.fit[keepLoci.ex,],
design,
contrasts)
BS.stat <- smoothSds(BS.stat)
## Comparing the raw standard deviations to the smoothed standard
## deviations
summary(getStats(BS.stat, what = "rawSds"))
summary(getStats(BS.stat, what = "smoothSds"))
}