# NOT RUN {
# 1) load HPPA as igraph object
ig.HPPA <-dRDataLoader(RData='ig.HPPA')
g <- ig.HPPA
# 2) randomly select vertices as the query nodes
nodes_query <- sample(V(g),5)$name
# 3) obtain the complete subgraph induced
subg <- dDAGinduce(g, nodes_query)
# 4) calculate the node levels
# 4a) definition based on the longest path
dDAGlevel(subg, level.mode="longest_path")
# 4b) definition based on the shortest path
dDAGlevel(subg, level.mode="shortest_path")
# 4c) definition based on the longest path, and return nodes for each level
dDAGlevel(subg, level.mode="longest_path", return.mode="level2node")
# }
Run the code above in your browser using DataLab