relations_list_to_table: Table from a nested list of ontology relations

View source: R/ontology.R

relations_list_to_tableR Documentation

Table from a nested list of ontology relations

Description

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.

Usage

relations_list_to_table(relations, direction = NULL)

Arguments

relations

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

direction

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".

Value

The relations converted to a data frame (tibble).

See Also

  • swap_relations

  • relations_table_to_list

  • obo_parser

Examples

goslim_url <-
    "http://current.geneontology.org/ontology/subsets/goslim_generic.obo"
path <- tempfile()
httr::GET(goslim_url, httr::write_disk(path, overwrite = TRUE))
obo <- obo_parser(path, tables = FALSE)
unlink(path)
rel_tbl <- relations_list_to_table(obo$relations)


saezlab/OmnipathR documentation built on May 3, 2024, 5:32 a.m.