join_vars_to_ontol {eHDPrep} | R Documentation |
This function creates new nodes representing dataset variables and joins them
to an input ontology network using a mapping file. Prior to joining, the
information content of all nodes is calculated using node_IC_zhou
.
join_vars_to_ontol(ontol_graph, var2entity_tbl, mode = "in", root, k = 0.5)
ontol_graph |
Graph containing the chosen ontology. Must be in
|
var2entity_tbl |
Edge table containing dataset variable names in first column and entities in ontologies to which they are mapped in the second column. |
mode |
Character constant specifying the directionality of the edges. One of "in" or "out". |
root |
name of root node identifier in column 1 to calculate node depth from. |
k |
numeric value to adjust the weight of the two items of information content equation (relative number of hyponyms/descendants and relative node depth). Default = 0.5 |
The user-defined mappings between variables in a dataset and
entities/terms in an ontology are provided in an edge table
(var2entity_tbl
).
A node attribute column, node_category
is
generated to describe if a node is one of "Dataset Variable", "Annotation", or
"Annotation Ancestor".
A tidygraph
resulting from the joining of var2entity_tbl
and ontol_graph
.
node_IC_zhou
Other semantic enrichment functions:
metavariable_agg()
,
metavariable_info()
,
metavariable_variable_descendants()
data(example_ontology)
join_vars_to_ontol(example_ontology, example_mapping_file, root = "root", mode = "in")