obtain childless descendents of a term (including query)

getLeavesFromTerm(x, ont)

Arguments

x

a character(1) id element for ontology_index instance

ont

an ontology_index instance as defined in ontologyIndex package

Value

character vector of 'leaves' of ontology tree

Examples

ch = getOnto("chebi_lite")
#> loading from cache
alldr = getLeavesFromTerm("CHEBI:23888", ch)
head(ch$name[alldr[1:15]])
#>               CHEBI:86327               CHEBI:35705               CHEBI:50847 
#>         "antifungal drug" "immunosuppressive agent"  "immunological adjuvant" 
#>               CHEBI:88188               CHEBI:35481               CHEBI:35482 
#>           "drug allergen"  "non-narcotic analgesic"        "opioid analgesic"