Loads a single Gene Ontology (GO) sub-ontology (BP, MF, or CC) from the Bioconductor annotation package GO.db and constructs an in-memory directed acyclic graph (DAG) representation.
The returned GO object contains GO term metadata together with
the parent–child relationships required for graph traversal and
downstream restriction operations. The ontology snapshot corresponds
to the installed version of GO.db, which is recorded in the
returned object for reproducibility.
Usage
load_go(ont = c("BP", "MF", "CC"), include_obsolete = FALSE, version = NULL)Arguments
- ont
character(1)GO sub-ontology to load. One of"BP","MF", or"CC".- include_obsolete
logical(1)Whether obsolete GO terms should be included. IfFALSE(default), obsolete terms are removed from the graph.- version
Optional
character(1)specifying the expectedGO.dbversion. If provided, the installed version must match.
Value
A GO S4 object representing the requested GO sub-ontology.
The object contains:
GO term metadata
parent–child relationships defining the ontology DAG
adjacency lists for efficient graph traversal
an empty GO-to-gene mapping table to be populated with
attach_org()the GO.db version used to construct the graph
Details
The ontology graph loaded by load_go() serves as the starting
point for GO restriction workflows implemented in this package.
Organism-specific mappings can be attached using
attach_org(), and the graph can subsequently be restricted
using functions such as filter_mapped() or subset_go().
Examples
go_cc <- load_go("CC")
#>
class(go_cc)
#> [1] "GO"
#> attr(,"package")
#> [1] "GOcontext"