The function voom of the limma package returns a EList object with, among others:
- matrix of normalized eset, corrected for library size, zero counts and log2 transformed
- matrix of inverse weights (for each combination of features and samples)
There is an example p.70 of the vignette of the limma package in which the entire object is given to limma, which makes use and combines both items to correct for mean-variance relationship:
v <- voom(counts,design,plot=TRUE,normalize="quantile") fit <- lmFit(v,design) fit <- eBayes(fit)
Is there a logical way to obtain the pre-processed data with mean-variance correction, e.g. product of the normalized expression matrix and inverse weights?
Our interest is to visualize the data after mean-variance correction but before differential analysis, e.g. with principal component analysis.
To add to Steve's answer, it doesn't make sense to multiply the observations with the precision weights, as you can't really interpret the weights that way. Otherwise there'd be no need to have separate functions for linear modelling with and without weights (i.e.,
lm.fit
andlm.wfit
, respectively). Also, if you're usingprcomp
withscale=TRUE
to make your PCA plot, then you don't really need to consider the mean-variance relationship as all genes will be scaled to unit variance anyway.