Get the descendants of a set of ontology terms.
get_ontology_descendants(ont, terms, include_self = TRUE, ...)
An ontology of class ontology_DAG.
A vector of ontology term IDs.
For dag_offspring()
and dag_ancestors()
, this controls whether to also include the query term itself.
Arguments passed on to simona::dag_offspring
dag
An ontology_DAG
object.
term
The value can be a vector of multiple term names. If it is a vector, it returns
union of the upstream/downstream terms of the selected set of terms. For dag_siblings()
,
the value can only be a single term.
in_labels
Whether the terms are represented in their names or as integer indices?
A named list of descendants, where the names are the input terms.
ont <- get_ontology("hp", terms=10)
#> Loading cached ontology: /github/home/.cache/R/KGExplorer/hp.rds
#> Randomly sampling 10 term(s).
d <- get_ontology_descendants(ont, c("HP:0000001","HP:0000002"))
#> Translating ontology terms to ids.
#> Translating ontology terms to ids.
#> WARNING: The term HP:0000002 was not found in the ontology.