Add per-term metadata to ontology.
add_ontology_metadata(
ont,
lvl = 2,
force_new = FALSE,
add_n_edges = TRUE,
add_ontology_levels = TRUE
)
An ontology of class ontology_DAG.
Depth of the ancestor terms to add. Will get the closest ancestor to this level if none have this exact level.
Add the data again even if the associated column already exists.
Add the number of edges (connections) for each term.
Add the ontology level for each term.
ont <- get_ontology("hp", terms=10)
#> Loading cached ontology: /github/home/.cache/R/KGExplorer/hp.rds
#> Randomly sampling 10 term(s).
ont2 <- add_ontology_metadata(ont)
#> Adding term metadata.
#> IC_method: IC_offspring
#> Adding ancestor metadata.
#> Ancestor metadata already present. Use force_new=TRUE to overwrite.
#> Translating ontology terms to ids.
#> Converted ontology to: adjacency
#> Getting absolute ontology level for 91 IDs.