For a given list of terms, it returns a subset of terms which have no ancestor relations to each other.
dag_distinct_ancestors(
dag,
terms,
in_labels = TRUE,
verbose = simona_opt$verbose
)
An ontology_DAG
object.
A vector of term names.
Whether the terms are represented in their names or as integer indices?
Whether to print messages.
Consider a subgraph that contains terms
and their offspring terms, induced from the complete DAG.
the returned subset of terms are those with zero in-degree, or have no finite directional distance
from others in the subgraph.
An integer vector or a character vector depending on the value of in_labels
.
parents = c("a", "a", "b", "b", "c", "d")
children = c("b", "c", "c", "d", "e", "f")
dag = create_ontology_DAG(parents, children)
dag_distinct_ancestors(dag, c("c", "d", "e", "f"))
#> collecting all ancestors of input terms ...
#>
#> going through 0 / 4 nodes ...
#>
#> going through 4 / 4 nodes ... Done.
#> [1] "c" "d"