Technical Variance Estimation
Estimate technical variance by using voom-trend. The code is derived from voom function in limma package
tecVarEstim(counts, design = NULL, lib.size = NULL, span = 0.5, ...)
counts
: a DGEList objectdesign
: design matrix with samples in row and coefficient(s) to be estimated in columnlib.size
: numeric vector containing total library sizes for each samplespan
: width of the lowess smoothing window as a proportion...
: other arguments are passed to lmFit.an TecVarList object with the following components: - targets: matrix containing covariables, library sizes and normalization foctors of each sample
design: design matrix with samples in row and covariable(s) to be estimated in column
logcpm: logcpm values of each gene and each sample
tecVar: estimated techical variance of each gene and each sample
expr <- data.frame(t(sapply(1:1000,function(x)rnbinom(20,mu=500,size=50)))) group <- c(rep("A",10),rep("B",10)) design <- model.matrix(~group, data = expr) dge <- DGEList(counts=expr, group=group) dge <- calcNormFactors(dge) tecVarEstim(dge,design)
Useful links