inducedGraph {topGO} | R Documentation

## 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.

### Author(s)

Adrian Alexa

### See Also

`topGOdata-class`, `reverseArch`,

### Examples

    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

[Package topGO version 2.40.0 Index]