I have a list of 20,000 genes with an associated p-value (the total number of balls in the urn).
I also have a list of specific genes that are "targets" of interest (these are the white balls in the urn).
I want to do a hypergeometric test to see if there's an over-representation of targets among the genes I call significant (i.e., overabundance of white balls from the balls I draw from the urn).
Easy so far with
phyper in R. But I can change the number of significant genes (number of balls I draw) by varying the p-value threshold I'm using to call something significant (.001, .01, .05, etc).
What I'm wondering - is there an alternative test that examines an overabundance of "targets" (white balls) at the top of the list of genes ranked by p-value? That is, can I do this test without specifying a p-value cutoff? That is, something like a more generalized hypergeometric test where I don't have to specify the number of balls I draw, that computes a result for all possible number of balls drawn (genes selected)?