Last chance! 50% off unlimited learning
Sale ends in
"estimateTrendedDisp"(y, method="bin.spline", df=5, span=2/3, ...)
"estimateTrendedDisp"(y, group=NULL, lib.size=NULL, AveLogCPM=NULL, method="bin.spline", df=5, span=2/3, ...)
DGEList
object."bin.spline"
, and "bin.loess"
."bin.spline"
method is used, see ns
in the splines package. Default is 5.loess
to determine the amount of smoothing for the loess fit when "loess"
method is used. Default is 2/3
.DGEList
with the same components as for estimateCommonDisp
plus the trended dispersion estimates for each gene.
estimateCommonDisp
estimates a common value for the dispersion parameter for all genes - should generally be run before estimateTrendedDisp
.
ngenes <- 1000
nlib <- 4
log2cpm <- seq(from=0,to=16,length=ngenes)
lib.size <- 1e7
mu <- 2^log2cpm * lib.size * 1e-6
dispersion <- 1/sqrt(mu) + 0.1
counts <- rnbinom(ngenes*nlib, mu=mu, size=1/dispersion)
counts <- matrix(counts,ngenes,nlib)
y <- DGEList(counts,lib.size=rep(lib.size,nlib))
y <- estimateCommonDisp(y)
y <- estimateTrendedDisp(y)
Run the code above in your browser using DataLab