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.
dDAGreverse(g)
gr
: a graph being reversed, an object of class "igraph" or
"graphNEL"
none
# 1) load HPPA as igraph object ig.HPPA <-dRDataLoader(RData='ig.HPPA')'ig.HPPA' (from package 'dnet' version 1.1.2) has been loaded into the working environment (at 2018-01-19 12:35:01)g <- ig.HPPA # 2) the graph with reverse edge direction gr <- dDAGreverse(g) grIGRAPH 740fba8 DN-- 11389 15221 -- + attr: name (v/c), term_id (v/c), term_name (v/c), term_distance | (v/n), relation (e/c) + edges from 740fba8 (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