Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/get_child_parent_nodes.R
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.
1 | 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.
1 2 3 | ## get the parent nodes (higher level GO-categories) of two random GO-IDs
parents = get_parent_nodes(c('GO:0051082', 'GO:0042254'))
parents
|
Loading required package: vioplot
Loading required package: sm
Package 'sm', version 2.2-5.6: type help(sm) for summary information
Loading required package: zoo
Attaching package: ‘zoo’
The following objects are masked from ‘package:base’:
as.Date, as.Date.numeric
Warning message:
no DISPLAY variable so Tk is not available
child_go_id parent_go_id parent_name
1 GO:0042254 GO:0042254 ribosome biogenesis
2 GO:0042254 GO:0022613 ribonucleoprotein complex biogenesis
3 GO:0042254 GO:0044085 cellular component biogenesis
4 GO:0042254 GO:0071840 cellular component organization or biogenesis
5 GO:0042254 GO:0009987 cellular process
6 GO:0042254 GO:0008150 biological_process
7 GO:0051082 GO:0051082 unfolded protein binding
8 GO:0051082 GO:0005515 protein binding
9 GO:0051082 GO:0005488 binding
10 GO:0051082 GO:0003674 molecular_function
distance
1 0
2 1
3 2
4 3
5 4
6 5
7 0
8 1
9 2
10 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.