swap_relations {OmnipathR} | R Documentation |
Reverse the direction of ontology relations
swap_relations(relations)
relations |
The 'relations' component of the data returned by
|
Same type as the input, but the relations swapped: if in the input these pointed from each child to the parents, in the output they point from each parent to their children, and vice versa.
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) unlink(path) rel_swapped <- swap_relations(obo$relations)