All ancestors in the ontology treeSource:
Starting from the selected nodes, recursively walks the ontology tree until it reaches the root. Collects all visited nodes, which are the ancestors (parents) of the starting nodes.
ancestors( terms, db_key = "go_basic", ids = TRUE, relations = c("is_a", "part_of", "occurs_in", "regulates", "positively_regulates", "negatively_regulates") )
Character vector of ontology term IDs or names. A mixture of IDs and names can be provided.
Character: key to identify the ontology database. For the available keys see
Logical: whether to return IDs or term names.
Character vector of ontology relation types. Only these relations will be used.
Character vector of ontology IDs. If the input terms are all
NULL is returned. The starting nodes won't be
included in the result unless some of them are ancestors of other
Note: this function relies on the database manager, the first call might
take long because of the database load process. Subsequent calls within
a short period should be faster. See
ancestors('GO:0005035', ids = FALSE) #>  "molecular_function" #>  "transmembrane signaling receptor activity" #>  "death receptor activity" #>  "signaling receptor activity" #>  "molecular transducer activity" #  "molecular_function" #  "transmembrane signaling receptor activity" #  "signaling receptor activity" #  "molecular transducer activity"