Get or set meta columns on DAG

# S4 method for ontology_DAG
mcols(x, use.names = TRUE, ...)

# S4 method for ontology_DAG
mcols(x, ...) <- value

Arguments

x

An ontology_DAG object.

use.names

Please ignore.

...

Other argument. For mcols(), it can be a vector of column names in the meta data frame.

value

A data frame or a matrix where rows should correspond to terms in x@terms.

Value

A data frame.

Examples

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)
#> DataFrame with 6 rows and 2 columns
#>            id         v
#>   <character> <integer>
#> a           a         1
#> b           b         2
#> c           c         3
#> d           d         4
#> e           e         5
#> f           f         6
mcols(dag, "id")
#> DataFrame with 6 rows and 2 columns
#>            id         v
#>   <character> <integer>
#> a           a         1
#> b           b         2
#> c           c         3
#> d           d         4
#> e           e         5
#> f           f         6
dag
#> An ontology_DAG object:
#>   Source: Ontology 
#>   6 terms / 6 relations
#>   Root: a 
#>   Terms: a, b, c, d, ...
#>   Max depth: 3 
#>   Avg number of parents: 1.20
#>   Avg number of children: 1.00
#>   Aspect ratio: 0.67:1 (based on the longest distance from root)
#>                 0.68:1 (based on the shortest distance from root)
#> 
#> With the following columns in the metadata data frame:
#>   id, v