| depthStruct {ontoTools} | R Documentation |
return a list of environments giving mapping from node name to rooted DAG depth and from depth to vector of names of nodes at that depth
depthStruct(rg) ontoDepth(rg) DMdepth(g, maxd)
rg |
rg: instance of class rootedDAG |
g |
rg: instance of class depth |
maxd |
maxd: bound on depth to be measured |
depthStruct: a list of two environments (see examples).
ontoDepth is the workhorse for depthStruct. DMdepth is a function that works on a plain graph, creating the 'daughter matrix' and computing depths.
Vince Carey <stvjc@channing.harvard.edu>
data(litOnto)
print(litOnto)
g1 <- new("rootedDAG", DAG=litOnto, root="A")
o1 <- new("ontology", name="demo", version="0.1",
rDAG=g1)
print(ds <- depthStruct(g1))
ds$tag2depth("A")
ds$tag2depth("H")
ds$depth2tag(2)