Description Usage Arguments Value Note See Also Examples

`dBUMscore`

is supposed to take as input a vector of p-values,
which are transformed into scores according to the fitted beta-uniform
mixture model. Also if the FDR threshold is given, it is used to make
sure that p-values below this are considered significant and thus
scored positively. Instead, those p-values above the given FDR are
considered insigificant and thus scored negatively.

1 |

`fit` |
an object of class "BUM" |

`method` |
the method used for the transformation. It can be either "pdf" for the method based on the probability density function of the fitted model, or "cdf" for the method based on the cumulative distribution function of the fitted model |

`fdr` |
the given FDR threshold. By default, it is set to NULL, meaning there is no constraint. If given, those p-values with the FDR below this are considered significant and thus scored positively. Instead, those p-values with the FDR above this given FDR are considered insigificant and thus scored negatively |

`scatter.bum` |
logical to indicate whether the scatter graph of scores against p-values should be drawn. Also indicated is the p-value (called tau) corresponding to the given FDR threshold (if any) |

`scores`

: a vector of scores

The transformation from the input p-value *x* to the score
*S(x)* is based on the fitted beta-uniform mixture model with two
parameters *λ* and *a*: *f(x|λ,a) = λ +
(1-λ)*a*x^{a-1}*. Specifically, it considers the log-likelyhood
ratio between the signal and noise compoment of the model. The
probability density function (pdf) of the signal component and the
noise component are *(1-λ)*a*(x^{a-1}-1)* and *λ +
(1-λ)*a*, respectively. Accordingly, the cumulative distribution
function (cdf) of the signal component and the noise component are
*\int_0^x (1-λ)*a*(x^{a-1}-1) \, \mathrm{d}x* and
*\int_0^x λ+(1-λ)*a \, \mathrm{d}x*. In order to take
into account the significance of the p-value, the *fdr* threshold
is also used for down-weighting the score. According to how to measure
both components, there are two methods implemented for deriving the
score *S(x)*:

The method "pdf":

*S(x) = log_2\frac{(1-λ)*a*(x^{a-1}-1)}{λ+(1-λ)*a} - log_2\frac{(1-λ)*a*(τ^{a-1}-1)}{λ+(1-λ)*a} = log_2\big(\frac{x^{a-1}-1}{τ^{a-1}-1}\big)*. For the purpose of down-weighting scores, it must ensure*log_2\frac{(1-λ)*a*(τ^{a-1}-1)}{λ+(1-λ)*a} ≥q 0*, that is, the constraint via*τ ≤q \big(\frac{λ+2*a*(1-λ)}{a*(1-λ)}\big)^{\frac{1}{a-1}}*The method "cdf":

*S(x) = log_2\frac{\int_0^x (1-λ)*a*(x^{a-1}-1) \, \mathrm{d}x}{\int_0^x λ+(1-λ)*a \, \mathrm{d}x} - log_2\frac{\int_0^τ (1-λ)*a*(τ^{a-1}-1) \, \mathrm{d}x}{\int_0^τ λ+(1-λ)*a \, \mathrm{d}x} = log_2\frac{(1-λ)*(x^{a-1}-a)}{λ+(1-λ)*a} - log_2\frac{(1-λ)*(τ^{a-1}-a)}{λ+(1-λ)*a} = log_2\big(\frac{x^{a-1}-a}{τ^{a-1}-a}\big)*. For the purpose of down-weighting scores, it must ensure*log_2\frac{(1-λ)*(τ^{a-1}-a)}{λ+(1-λ)*a} ≥q 0*, that is, the constraint via*τ ≤q \big(\frac{λ+2*a*(1-λ)}{1-λ}\big)^{\frac{1}{a-1}}*Where

*τ =\big[\frac{λ+(1-λ)*a-fdr*λ}{fdr*(1-λ)}\big]^{\frac{1}{a-1}}*, i.e. the p-value corresponding to the exact*fdr*threshold. It can be deduced from the definition of the false discovery rate:*fdr \doteq \frac{\int_0^τ λ+(1-λ)*a \, \mathrm{d}x}{\int_0^τ λ+(1-λ)*a*x^{a-1} \, \mathrm{d}x}*. Notably, if the calculated*τ*exceeds the contraint, it will be reset to the maximum end of that constraint

1 2 3 4 5 6 7 8 9 10 11 | ```
# 1) generate an vector consisting of random values from beta distribution
x <- rbeta(1000, shape1=0.5, shape2=1)
# 2) fit a p-value distribution under beta-uniform mixture model
fit <- dBUMfit(x)
# 3) calculate the scores according to the fitted BUM and fdr=0.01
# using "pdf" method
scores <- dBUMscore(fit, method="pdf", fdr=0.01)
# using "cdf" method
scores <- dBUMscore(fit, method="cdf", fdr=0.01)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.