Description Usage Arguments Details Value Author(s) Examples
View source: R/rctutils.R View source: R/DGE_Tools.R
If you use the following function in place of eBayes for single contrasts, you can actually use the B-statistic from the results of topTable. The B-statistic is the log-odds of differential expression, so a zero means a 50-50 chance of DE, positive means more likely DE than not, and negative means more likely non-DE. (Note that this statistic uses the natural logarithm, not base 10 or base 2 logs.) However, this statistic is only accurate if you supply a prior estimate of the fraction of genes that are DE. The default proportion is 1 which should give conservative values as long as at least 1 genes are DE.
Variant of 'limma::eBayes()' that sets the 'proportion' argument automatically.
1 2 3 | eBayes_autoprop(..., prop.method = "lfdr")
eBayes_autoprop(..., prop.method = "lfdr")
|
... |
All other arguments are passed to [limma::eBayes()]. |
prop.method |
The method by which to calculate the proportion of true null hypotheses (i.e. non-differentially expressed genes). This can be a string to be used as the 'method' argument to [limma::propTrueNull()], or a function that accepts a vector of p-values and returns a single value between 0 and 1. This argument can only be passed by name. |
The function below uses limma propTrueNull to determine this prior, which means that the B-statistics should be reliable as long as propTrueNull returns a reasonable-looking value, which you can verify by looking at the p-value distribution.
Limma's [limma::eBayes()] function can calculate log-odds scores (a.k.a. B statistics), which depend on an estimated proportion of differentially expressed genes that the user specifies *a priori*. Limma also provides methods for calculating this proportion via [limma::propTrueNull()], and other packages also provide similar functions. This function combines the two in order to set the proportion automatically.
The B statistics produced when running 'limma::topTable()' on the value returned by this function should be directly interpretable as estimated log odds, as long as the distribituion of p-values is well-behaved.
Note that if the p-value distribution is highly atypical, a proportion that is not between 0 and 1 could be estimated. If this happens, an error will be thrown.
A fit is returned
See [limma::eBayes()].
Ryan Thompson, rct@thompsonclan.org
Ryan Thompson, rct@thompsonclan.org
1 2 3 4 | MyFit = eBayes_autoprop (MyFit)
#see ?limma::eBayes
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.