topGO under-representation table
1
2
Entering edit mode
@beachboarder900-12245
Last seen 6.4 years ago

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!

topGO GO • 1.3k views
ADD COMMENT
3
Entering edit mode
@beachboarder900-12245
Last seen 6.4 years ago

After some trial and error, I've found a solution to my own question!

For anyone interested, use the code above to create the GO under represented function, you can then use

under.GO <- GenTable(GOdata, Fis = resFisher.weight, topNodes = 150, numChar=100)

to get a table similar to the enrichment analysis.

Hope that helps!

 

ADD COMMENT

Login before adding your answer.

Traffic: 918 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6