determineOffset {Repitools} | R Documentation |
The composition of a library influences the resulting read densities. To adjust the modelled mean (in the Poisson model) for these composition effects, we estimate a normalising factor f that accounts simultaneously for overall sequencing depth and composition. The derivation of this offset is motivated by the M (log ratio) versus A (average-log-count) plot.
determineOffset(x, quantile = 0.998, controlPlot = list(show = FALSE, nsamp = 50000, mfrow=c(1,1), xlim=NULL, ylim=NULL, main=NULL, ask=FALSE))
x |
|
quantile |
quantile q to restrict values of A = log2(sampleInterest*control)/2 |
controlPlot |
list defining whether a MA plot should be shown.
|
A BayMethList
object given as input, where the slot fOffset
is filled accordingly.
Andrea Riebler
maPlot, plotSmear
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, controlPlot=list(show=TRUE, mfrow=c(1,2))) }