Set meta columns on DAG
# S4 method for ontology_DAG
mcols(x, ...) <- valueAn ontology_DAG object.
Other argument. For mcols(), it can be a vector of column names in the meta data frame.
A data frame or a matrix where rows should correspond to terms in x@terms.
parents = c("a", "a", "b", "b", "c", "d")
children = c("b", "c", "c", "d", "e", "f")
dag = create_ontology_DAG(parents, children)
mcols(dag) = data.frame(id = letters[1:6], v = 1:6)
mcols(dag)
#> id v
#> 1 a 1
#> 2 b 2
#> 3 c 3
#> 4 d 4
#> 5 e 5
#> 6 f 6
mcols(dag, "id")
#> id v
#> 1 a 1
#> 2 b 2
#> 3 c 3
#> 4 d 4
#> 5 e 5
#> 6 f 6
dag
#> An ontology_DAG object:
#> Source: Ontology
#> 6 terms / 6 relations
#> Root: a
#> Terms: a, b, c, d, ...
#> Max depth: 3
#> Aspect ratio: 0.67:1 (based on the longest distance to root)
#> 0.68:1 (based on the shortest distance to root)
#>
#> With the following columns in the metadata data frame:
#> id, v