Function to reverse the edge direction of a direct acyclic graph (DAG)

Description

dDAGreverse is supposed to reverse the edge direction of a direct acyclic graph (DAG; an ontology). The return graph remains all attributes associated on nodes and edges.

Usage

dDAGreverse(g)

Arguments

g
an object of class "igraph" or "graphNEL"

Value

  • gr: a graph being reversed, an object of class "igraph" or "graphNEL"

Note

none

Examples

# 1) load HPPA as igraph object ig.HPPA <-dRDataLoader(RData='ig.HPPA')
'ig.HPPA' (from package 'dnet' version 1.0.11) has been loaded into the working environment (at 2017-03-27 19:54:16)
g <- ig.HPPA # 2) the graph with reverse edge direction gr <- dDAGreverse(g) gr
IGRAPH DN-- 11389 15221 -- + attr: name (v/c), term_id (v/c), term_name (v/c), term_distance | (v/n), relation (e/c) + edges (vertex names): [1] HP:0000098->HP:0000002 HP:0004322->HP:0000002 HP:0012772->HP:0000002 [4] HP:0000130->HP:0000008 HP:0000137->HP:0000008 HP:0000140->HP:0000008 [7] HP:0000142->HP:0000008 HP:0011027->HP:0000008 HP:0000011->HP:0000009 [10] HP:0000012->HP:0000009 HP:0000016->HP:0000009 HP:0000017->HP:0000009 [13] HP:0000019->HP:0000009 HP:0000020->HP:0000009 HP:0000076->HP:0000009 [16] HP:0000805->HP:0000009 HP:0002839->HP:0000009 HP:0005340->HP:0000009 [19] HP:0100515->HP:0000009 HP:0100518->HP:0000009 HP:0012786->HP:0000010 + ... omitted several edges

Source code

dDAGreverse.r

Source man

dDAGreverse.Rd dDAGreverse.pdf

See also

dDAGreverse