hint
is an R
package for performing
hypothesis testing based on Hypergeometric Intersection distributions.
For example if you had three gene sets arising from three separate
experiments with x
genes shared between the three, you
could determine the probability of arriving at this intersection size by
chance. See the companion paper for more
information.
install.packages("hint")
library(hint)
## The probability of an intersection of size 5 or greater
## when sampling 15, 8, and 7 balls from three urns
## each with 1 ball in each of 29 categories.
phint(29, c(15, 8, 7), vals = 5)
v cum.p1 5 0.0002289938
## Formalising a hypothesis test using 'hint.test'.
# Categories given in the first column.
# Numbers of balls in each category given in subsequent columns: each column representing an urn.
<- data.frame(categories = letters[1:20],
dd urn1_count = rep(1,20),
urn2_count = rep(1,20))
<- hint.test(dd, letters[1:9],
tt 4:15], alternative = "greater")
letters[print(tt)
Hypergeometric intersection test
:
Parameters
n a b q v 20 9 12 0 6
P(X >= v) = 0.4649917
plot(tt)
## Allow duplicates in the second urn.
<- data.frame(letters[1:20],
dd rep(1,20),
c(rep(1,4), rep(2,16)))
<- hint.test(dd, letters[1:9],
tt 9:14], alternative = "less")
letters[print(tt)
Hypergeometric intersection test
:
Parameters
n a b q v 20 9 6 16 1
P(X <= v) = 0.1596769
Kalinka (2013). The probability of drawing intersections: extending the hypergeometric distribution. arXiv.1305.0717