topGO (version 2.24.0)

inducedGraph: The subgraph induced by a set of nodes.

Description

Given a set of nodes (GO terms) this function is returning the subgraph containing these nodes and their ancestors.

Usage

inducedGraph(dag, startNodes) nodesInInducedGraph(dag, startNodes)

Arguments

dag
An object of class graphNEL containing a directed graph.
startNodes
A character vector giving the starting nodes.

Value

An object of class graphNEL-class is returned.

See Also

topGOdata-class, reverseArch,

Examples

Run this code
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

Run the code above in your browser using DataCamp Workspace