inducedGraph: The subgraph induced by a set of nodes.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/topGOgraph.R

Description

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

Usage

1
2
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

topONTdata-class, reverseArch,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(ONTdata)

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

hxin/topOnto documentation built on May 17, 2019, 9:15 p.m.