get_parent_nodes {GOfuncR}R Documentation

Get all parent nodes of gene ontology categories

Description

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.

Usage

get_parent_nodes(go_ids, term_df = NULL, graph_path_df = NULL, godir = NULL)

Arguments

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 godir. Also needs graph_path_df.

graph_path_df

optional data.frame() with an ontology 'graph_path' table. Alternative to the default integrated GO-graph or godir. Also needs term_df.

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 term_df + graph_path_df.

Details

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.

Value

a data.frame() with four columns: child GO-ID (character()), parent GO-ID (character()), parent GO-name (character()) and distance (numeric()).

Author(s)

Steffi Grote

References

[1] Ashburner, M. et al. (2000). Gene Ontology: tool for the unification of biology. Nature Genetics 25, 25-29.

See Also

get_names
get_child_nodes

Examples

## get the parent nodes (higher level GO-categories) of two random GO-IDs
parents = get_parent_nodes(c('GO:0051082', 'GO:0042254'))
parents

[Package GOfuncR version 1.0.0 Index]