[BioC] GOENTREZID2GO hard-coded in GOstats:makeGOGraph

Paul Shannon pshannon at systemsbiology.org
Tue Dec 19 02:56:03 CET 2006


I use the 'makeGOGraph' function in the GOstats package 
to obtain the induced graph for supplied gene IDs.  I typically
follow with GOHyperG (now just a wrapper around hyperGTest) to
calculate statistics on the nodes of the induced graph, and
then render everything as a Cytoscape network.  This bioc
package is very handy, and popular with many with whom I work.

Occasionally I use the yeast genome and the YEAST 
annotation package... which  works fine with makeGOGraph and
GOHyperG after I made one tiny change to the former function:
I parameterized the environment consulted for GO annotation.

  makeGOGraph <- function (x, Ontology = "MF", 
                           geneName2GO.env = GOENTREZID2GO, removeRoot = TRUE) 
  {
    match.arg(Ontology, c("MF", "BP", "CC"))
    wh <- paste("GO", Ontology, "PARENTS", sep = "")
    dataenv = get(wh, mode = "environment")
    newNodes <- mget(x, env = geneName2GO.env, ifnotfound = NA)
    # newNodes <- mget(x, env = GOENTREZID2GO, ifnotfound = NA)

After this change, I can now call makeGOGraph for yeast:

   library (YEAST)
   makeGOGraph (c ('YAR007C','YNL312W','YJL173C'), 'MF', YEASTGO)
     A graphNEL graph with directed edges
     Number of Nodes = 7 
     Number of Edges = 6 

If I am not completely missing the point here, may I ask if it might
be worthwhile to change the signature of this method slightly, to
something like this?

 makeGOGraph <- function (x, Ontology = "MF", 
                          geneName2GO.env = GOENTREZID2GO, removeRoot = TRUE) 


Regards,

 - Paul



More information about the Bioconductor mailing list