Description Usage Arguments Details Value Examples
Calculates posterior LFC and ranks on expectation value of rank of true LFC.
1 2 |
fit |
A fit object generated from limma and voom. |
coefs |
The columns of the fit object to be analysed. Defaults to 0 which means all columns. |
keepPosterior |
Logical. Whether to store the numerical posterior distributions for each gene. By default a 100 column matrix, so can take some space. If stored, it allows for plots of the posterior distributions by gene. |
verbose |
Logical. Whether a few rows of output are generated to track progress. |
plot |
Logical. Whether a plot is generated at the end of analysis. |
cpus |
Integer. The number of parallel cpus to use. |
Calculates a posterior PDF on the LFC based on an empirical prior. The median of this PDF is stored as the 'best.guess' and has been shown to correlate better with the true LFC than 'coefficients'. The posterior PDF on LFC is transformed into a PDF on rank by true absolute LFC. The expectation value of this PDF is stored as XRank, and is intended to be used for ranking DE genes in way to put the largest true absolute LFCs on the top of the list, as opposed to 'p.values' or 'lods' that rank the most strongly refused null hypothesis.
The fit
object, with new columns:
'best.guess': The posterior LFC estimate.
'XRank': The expectation value of the posterior on rank on true absolute LFC.
Ranking by this statistic generally outperforms other stats.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #Set up a (highly artificial) count matrix.
counts = matrix(rpois(1000*6, 100), ncol=6,
dimnames=list(paste0('gene', 1:1000), c('a', 'b', 'c', 'D', 'E', 'F')))
#set up experimental design
group = c(rep('lower', 3), rep('upper', 3))
design = model.matrix(~0+group)
colnames(design) = gsub('^group', '', colnames(design))
contrasts = limma::makeContrasts('upper-lower', levels=colnames(design))
#run voom and limma
fit = limma::voom(counts, design, plot=T)
fit = limma::lmFit(fit, design=design)
fit = limma::contrasts.fit(fit, contrasts)
fit = limma::eBayes(fit)
fit = XRank(fit, plot=F)
plotVolcano(fit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.