This class defines the DAG structure of an ontology.
An ontology_DAG object.
termsA character vector of length n of all term names. Other slots that store term-level information use the integer indices of terms.
n_termsAn integer scalar of the total number of terms in the DAG.
n_relationsAn integer scalar of the total number of relations in the DAG.
lt_parentsA list of length n. Each element in the list is an integer index vector of the parent terms of the i^th term.
lt_childrenA list of length n. Each element in the list is an integer index vector of the child terms of the i^th term.
lt_children_relationsA list of length n. Each element is a vector of the semantic relations between the i^th term and its child terms, e.g. a child "is_a" parent.
The relations are represented as integers. The character name of the relations is in attr(dag@lt_children_relations, "levels").
relations_DAGA simple ontology_DAG object but constructed for relation types.
sourceThe source of the ontology. A character scalar only used as a mark of the returned object.
rootAn integer scalar of the root term.
leavesAn integer vector of the indicies of leaf terms.
alternative_termsA named character vector of mappings between alternative terms to DAG terms.
tpl_sortedAn integer vector of reordered term indices which has been topologically sorted in the DAG. Terms are sorted first by the depth (maximal distance from root), then the number of child terms, then the number of parent terms, and last the term names.
tpl_posThe position of the original term in the topologically sorted path (similar as the rank), e.g. the value of the first element in the vector is the position of term 1 in the topologically sorted path.
annotationA list of two elements: list and names. The dag@annotation$list element contains a list of length n and each element
is a vector of integer indices of annotated items. The full list of annotated items is in dag@annotation$names.
term_envAn environment which contains various term-level statistics. It is mainly for cache purpose.
aspect_ratioA numeric vector of length two. The aspect ratio is calculated as w/h. For each term, there is a distance to root,
h is the maximal distance of all terms, w is the maximal number of items with the same distance. The two values in the aspect_ratio slot
use maximal distance to root (the height) and the shortest distance to root as the distance measure.
elementMetadataAn additional data frame with the same number of rows as the number of terms in DAG. Order of rows should be the same as order of terms in dag@terms.
1
#> [1] 1
# This function should not be used directly.