Question: Hypergeometric Test On Gene Set
6
5.2 years ago by
ChIP490
Netherlands
ChIP490 wrote:

Hi!

This is not the first time this question is being asked, but I am confused from the previous post.

I have say two lists. List1 has 598 genes and List2 has 5500 genes and the total genes available in the pool from which these two are drawn is of size 23000 (say).

Now, if I have to make compute whether the overlap between the two list which is of 89 genes is significant or not.

I have two formulas:

method 1

``````phyper=(overlap-1,list1,PopSize-list1,list2,lower.tail = FALSE, log.p = FALSE)

phyper=(88,598,23000-598,5500,lower.tail = FALSE, log.p = FALSE)
``````

method 2

``````phyper=(overlap,list1,PopSize,list2,lower.tail = FALSE, log.p = FALSE)

phyper=(89,598,23000,5500,lower.tail = FALSE, log.p = FALSE)
``````

Now which method shall I use and why?

I am really confused.

Thank you

bioinformatics statistics R • 15k views
modified 2.9 years ago by Alejandro Jimenez Sanchez120 • written 5.2 years ago by ChIP490
4

and remember that the p-value is the probability of obtaining a result at least as extreme as the one that was randomly observed

2
5.2 years ago by
Sudeep1.6k
.
Sudeep1.6k wrote:

Your method1 looks like the correct one. AFAIK, in `phyper=(q,m,n,k)`

`n` should be `PopSize-list1`

you can check this stackoverflow thread as well

Can anyone explain about the q-1, why or why not?

2

phyper(x, m, n, k) gives the probability of getting x or fewer, so phyper(x, m, n, k) is the same as sum(dhyper(0:x, m, n, k)).

The lower.tail=FALSE is a bit confusing. phyper(x, m, n, k, lower.tail=FALSE) is the same as 1-phyper(x, m, n, k), and so is the probability of x+1 or more

0
2.9 years ago by
Cancer Research UK Cambridge Institute, University of Cambridge, Cambridge, UK

I think method 1 is the correct one, because.

Method 1 gives the same result as this site: https://www.geneprof.org/GeneProf/tools/hypergeometric.jsp

Method 2 gives a different result.