inducedGraph {topGO} | R Documentation |
Given a set of nodes (GO terms) this function is returning the subgraph containing these nodes and their ancestors.
inducedGraph(dag, startNodes) nodesInInducedGraph(dag, startNodes)
dag |
An object of class |
startNodes |
A character vector giving the starting nodes. |
An object of class graphNEL-class
is returned.
Adrian Alexa
data(GOdata) ## the GO graph g <- graph(GOdata) g ## select 10 random nodes sn <- sample(nodes(g), 10) ## the subgraph induced by these nodes sg <- inducedGraph(g, sn) sg