mHG.pval.calc: Calculate the p-value of a minimum-hypergeometric (mHG) statistic.
Description
Calculates the p-value associated with the (minimum-hypergeometric) mHG statistic.
Usage
mHG.pval.calc(p, N, B, n_max = N)
Arguments
p
the mHG statistic. It is marked as p as it represents an "uncorrected" p-value.
N
total number of white and black balls (according to the hypergeometric problem definition).
B
number of black balls.
n_max
the algorithm will calculate the p-value under the assumption that only the
first \(n_{max}\) partitions were taken into account in determining the mHG statistic.
Value
the p-value of the test.
Details
\(O(NB)\) running time, \(O(NB)\) space.
References
Eden, E. (2007). Discovering Motifs in Ranked Lists of DNA Sequences. Haifa.
Retrieved from http://bioinfo.cs.technion.ac.il/people/zohar/thesis/eran.pdf
(pages 11-12, 19-20)
# NOT RUN {N <- 50
B <- 15
lambdas <- numeric(50)
lambdas[sample(N, B)] <- 1p <- mHG.statistic.calc(lambdas)@mHG
p.corrected <- mHG.pval.calc(p, N, B) # Could have used mHG.test directly# }