if(require(BSgenome.Hsapiens.UCSC.hg18)){
windows <- genomeBlocks(Hsapiens, chrs="chr21", width=100, spacing=100)
cpgdens <- cpgDensityCalc(windows, organism=Hsapiens,
w.function="linear", window=700)
co <- matrix(rnbinom(length(windows), mu=10, size=2), ncol=1)
sI <- matrix(rnbinom(2*length(windows), mu=5, size=2), ncol=2)
bm <- BayMethList(windows=windows, control=co,
sampleInterest=sI, cpgDens=cpgdens)
bm <- determineOffset(bm)
# should take about 3 minutes for both samples of interests with 2 CPUs.
bm <- empBayes(bm)
bm <- methylEst(bm, controlCI = list(compute = FALSE, method = "Wald",
level = 0.95, nmarg = 512, ncpu = NULL))
}
Run the code above in your browser using DataLab