Skip to contents

Converting the nested list to a table is a more costly operation, it takes a few seconds. Best to do it only once, or pass tables = TRUE to obo_parser, and convert the data frame to list, if you also need it in list format.


relations_list_to_table(relations, direction = NULL)



A nested list of ontology relations (the "relations" element of the list returned by obo_parser in case its argument `tables` is FALSE).


Override the direction (i.e. child -> parents or parent -> children). The nested lists produced by functions in the current package add an attribute "direction" thus no need to pass this value. If the attribute and the argument are both missing, the column will be named simply "side2" and it won't be clear whether the relations point from "term" to "side2" or the other way around. The direction should be a character vector of length 2 with the values "parents" and "children".


The relations converted to a data frame (tibble).


goslim_url <-
path <- tempfile()
httr::GET(goslim_url, httr::write_disk(path, overwrite = TRUE))
#> Response []
#>   Date: 2023-07-31 12:47
#>   Status: 200
#>   Content-Type: text/obo
#>   Size: 114 kB
#> <ON DISK>  /tmp/RtmpztLmFt/file895a1508df85
obo <- obo_parser(path, tables = FALSE)
rel_tbl <- relations_list_to_table(obo$relations)