dDAGancestor is supposed to find a list of common ancestors
shared by two terms/nodes, given a direct acyclic graph (DAG; an
ontology). If two terms are given as NULL, then a sparse matrix of
children x ancestors is built for all terms. If one of them is null,
then a sparse matrix of children x ancestors is built but only for
non-null input terms.
dDAGancestor(g, term1 = NULL, term2 = NULL, verbose = T)
# 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:53:33)g <- ig.HPPA # 2) randomly give two terms term1 <- sample(V(g)$name,1) term2 <- sample(V(g)$name,1) # 3) find common ancestors dDAGancestor(g, term1, term2)Find common ancestors shared by HP:0012705 and HP:0011428 (2017-03-27 19:53:33)... "HP:0000118"