[BioC] Drawing induced GO graphs -- GOstats package

Seth Falcon seth at userprimary.net
Sat Sep 13 19:34:29 CEST 2008

* Wolfgang:
> > AfaIu, plotGOTermGraph wants to work on elements of the list y,
> > not on y itself. I agree that the documentation in the function's
> > manual page ("g : A graph object as returned by inducedTermGraph
> > or termGraphs") would benefit from clarification/correction.

Yes, it should be something like:

       g: A 'graph' object as returned by 'inducedTermGraph' or
          an element of the list returned by 'termGraphs'.

* On 2008-09-12 at 19:42 -0500 daniel jupiter wrote:
> I'm really looking to see the following.  The induced graph of all
> the nodes declared significant, with those nodes in a different
> color, with counts, and labels that are terms, not IDs.  It seems
> that you've given me yet another piece of the puzzle.... but they
> don't all fit together.  I can get many of these things with the
> various suggestions I've received, I just can't get them all at
> once.  It may just be that without a lot of work R/BioC can't quite
> do what I'd like.

Perhaps the following is what you want?

  ## using the same example data as you posted...
  x = hyperGTest(params)
  tgs = termGraphs(x,use.terms=TRUE , pvalue=.01)
  ## tgs is a list of graph objects that represent the connected
  ## components of the subgraph of the tested GO DAG consisting of
  ## significant nodes.
  g1 = tgs[[1]]
  ## here we add parents and children of a connected graph of
  ## significant nodes.
  bigg = inducedTermGraph(x, id=nodes(g1))
  ## as you noted, inducedTermGraph doesn't add GO term labels, so we'll
  ## add them in the way that plotGOTermGraph is expecting
  # first add a default value for the node attribute named "term"
  nodeDataDefaults(bigg) <- c(nodeDataDefaults(bigg),
  # then add the terms
  theTerms = as.character(sapply(mget(nodes(bigg), GOTERM), Term))
  nodeData(bigg, attr="term") = theTerms
  # the resulting graph has 38 nodes and I find the plot rather
  # unsatisfying.  But if you use pdf, you can zoom in.
  plotGOTermGraph(bigg, x, node.shape="ellipse")

Perhaps that gives you another piece of your puzzle?  Writing
functions to visualize arbitrary GO graphs is difficult because once
the node count grows the resulting plot tends to get difficult to

+ seth

Seth Falcon | http://userprimary.net/user/

More information about the Bioconductor mailing list