I have several lists of genes, say A, B, C. I want to test if the overlap between A and B; A and C are significant or not. I am planning on doing a hypergeometric test using R.
Please help me to verify if this is correct or no:
phyper(q, m, n, k, lower.tail = FALSE, log.p = FALSE)
q: # of overlap between A and B/C - 1
m: # of genes in A
n: total # of genes in sample - # of genes in A
k: # of genes in B/C
Also, what if there is no overlap? Do I still do the same thing but with q=0 or q=-1?
Thanks a lot for the help!