Greetings,
I have found Adrian's previous answers (topGO enrichment using ensembl gene list) to performing the under-representation test using the code below. The function works great for identifying the under represented GO terms, but I would like to get a table in a similar fashion to the GenTable() function within the topGO package. I've extracted the GO IDs, p-values, and significant terms from the resFisher.weight object made using getSigGroups(). Again, it would be preferable to get something like the GenTable() output that would also include the GO term definitions, Annotated terms and Expected terms, which I have been unable to locate in the topGOresult object (resFisher.weight) created below. I'm guessing this information is only included in the topGOdata object, which GenTable() uses, but GenTable() cannot use the topGOresult object.
if(!isGeneric("GOFisherUnder")) setGeneric("GOFisherUnder", function(object) standardGeneric("GOFisherUnder")) setMethod("GOFisherUnder", "classicCount", function(object) { contMat <- contTable(object) if(all(contMat == 0)) p.value <- 1 else p.value <- fisher.test(contMat, alternative = "less")$p.value return(p.value) }) test.stat <- new("weightCount", testStatistic = GOFisherUnder, name="Weight with Fisher's exact test for underrepresentation") resFisher.weight <- getSigGroups(GOdata, test.stat)
Any help or advice would be greatly appreciated!
Thank you!