I have performed the "elim" (It happens the same with the weight01 algorithm) test in the same gene universe selecting different genes. However the p-values are the same even if different number of genes are indicated as significant for the same GO.ID. Here is a reproducible example:
library("topGO") data(GOdata) geneSelectionFun(GOdata) <- function(x) {x == 1L} GOdata resultKS.elim <- runTest(GOdata, algorithm = "elim", statistic = "ks") allRes1 <- GenTable(GOdata, resultKS.elim) geneSelectionFun(GOdata) <- function(x) {x > 0.5} GOdata resultKS.elim2 <- runTest(GOdata, algorithm = "elim", statistic = "ks") allRes2 <- GenTable(GOdata, resultKS.elim2)
In this case the GO terms with ID GO:0007067, GO:0051301, GO:0000087, GO:0022403, GO:0000226 have different number of "Significant" genes annotated, thus I expect to have a different p-value but it isn't reported different in each result table. Which makes me think if the elim algorithm is independent of the selected genes. Could the maintainer (or anyone else) explain it to me?
Probably related if I set another ontology the same GO terms (they should be different!!) and p-values are used when retrieving scores: