dDAGancestor: Function to find common ancestors of two terms/nodes from a...

Description Usage Arguments Value Note See Also Examples

Description

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.

Usage

1
dDAGancestor(g, term1 = NULL, term2 = NULL, verbose = T)

Arguments

g

an object of class "igraph" or "graphNEL"

term1

the first term/node as input

term2

the second term/node as input

verbose

logical to indicate whether the messages will be displayed in the screen. By default, it sets to true for display

Value

Note

none

See Also

dDAGinduce

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 1) load HPPA as igraph object
ig.HPPA <-dRDataLoader(RData='ig.HPPA')
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)

Example output

Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

Loading required package: supraHex
Loading required package: hexbin
'ig.HPPA' (from package 'dnet' version 1.1.4) has been loaded into the working environment (at 2020-01-13 14:28:15)
Find common ancestors shared by HP:0011991 and HP:0008421 (2020-01-13 14:28:15)...
[1] "HP:0000118"

dnet documentation built on Feb. 20, 2020, 3:01 p.m.

Related to dDAGancestor in dnet...