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.1.2) has been loaded into the working environment (at 2018-01-19 12:34: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:0002152 and HP:0009523 (2018-01-19 12:34:33)... "HP:0000118"