get_parent_nodes {GOfuncR} | R Documentation |
Returns all parent nodes (higher level categories) of GO-categories given their GO-IDs, e.g. c('GO:0042254', 'GO:0000109'). The output also states the shortest distance to the parent node. Note that a GO-ID itself is also considered as parent with distance 0.
get_parent_nodes(go_ids, term_df = NULL, graph_path_df = NULL, godir = NULL)
go_ids |
a character() vector of GO-IDs, e.g. c('GO:0051082', 'GO:0042254'). |
term_df |
optional data.frame() with an ontology 'term' table.
Alternative to the default integrated GO-graph or |
graph_path_df |
optional data.frame() with an ontology 'graph_path' table.
Alternative to the default integrated GO-graph or |
godir |
optional character() specifying a directory that
contains the ontology tables 'term.txt' and 'graph_path.txt'.
Alternative to the default integrated GO-graph
or |
By default the package's integrated GO-graph is used, but a custom ontology can be defined, too.
For details on how to use a custom ontology with
term_df
+ graph_path_df
or godir
please refer to the
package's vignette. The advantage of term_df
+ graph_path_df
over godir
is that the latter reads the files 'term.txt' and
'graph_path.txt' from disk and therefore takes longer.
a data.frame() with four columns: child GO-ID (character()), parent GO-ID (character()), parent GO-name (character()) and distance (numeric()).
Steffi Grote
[1] Ashburner, M. et al. (2000). Gene Ontology: tool for the unification of biology. Nature Genetics 25, 25-29.
## get the parent nodes (higher level GO-categories) of two random GO-IDs parents = get_parent_nodes(c('GO:0051082', 'GO:0042254')) parents