Hierarchical Orthologous Groups (HOGs) are sets of genes that have descended from a single common ancestral gene within a taxonomic range of interest (Altenhoff et al. 2013). Each HOG is defined with respect to a taxonomic level; going towards more recent levels, a HOG can split into several sub-HOGs if the ancestral gene was duplicated. HOGs thus capture the full history of gene duplications and losses of a gene family, and they correspond to the genes of ancestral genomes.
This vignette shows how to explore HOGs, ancestral genomes and their
synteny with OmaDB. See the vignette “Get started with
OmaDB” for an introduction to the package.
HOGs can be retrieved by their HOG ID or by one of their member
proteins. Without a level, the most specific HOG of a protein is
returned, with level = "root" the HOG at its deepest
level.
hog <- getHOG("YEAST00001")
hog[, c("hog_id", "level", "description")]
#> hog_id level
#> 1 HOG:F0411479.1b Saccharomyces cerevisiae
#> description
#> 1 that arose from the whole genome duplication
root <- getHOG("YEAST00001", level = "root")
root[, c("hog_id", "level")]
#> hog_id level
#> 1 HOG:F0411479 SaccharomycetaceaeThe HOG ID encodes the duplications: HOG:F0411479 is the root HOG,
HOG:F0411479.1b one of its sub-HOGs. The sub-HOGs of the root HOG can be
found in its children_hogs attribute:
The root HOG at the level of the Saccharomycetaceae thus split into two sub-HOGs, due to a duplication of the ancestral gene. These are the paralogs that arose from the whole genome duplication in the ancestor of Saccharomyces cerevisiae.
The members of a HOG at a given level are retrieved with
members = TRUE:
members <- getHOG(root$hog_id, level = "Saccharomycetaceae", members = TRUE)
nrow(members)
#> [1] 20
head(members[, c("omaid", "canonicalid", "oma_hog_id")])
#> omaid canonicalid oma_hog_id
#> 1 KLULA01017 Q6CIX1 HOG:F0411479
#> 2 YEAST00001 YAD7_YEAST HOG:F0411479.1b
#> 3 YEAST05611 YO342_YEAST HOG:F0411479.1a
#> 4 YEASA02179 EGA72822 HOG:F0411479.1a
#> 5 YEASA02799 EGA76155 HOG:F0411479.1b
#> 6 YEASV03141 EGA76665 HOG:F0411479.1a
table(members$species.code)
#>
#> ASHGO CANGA ERECY KAZAF KLULA LACFM LACTC NAUCC NAUDC TETBL TETPH VANPO YEASA
#> 1 1 1 1 1 1 1 1 1 1 1 1 2
#> YEASO YEAST YEASV ZYGRO
#> 2 2 1 1The Gene Ontology annotations of the ancestral gene can be retrieved
with attribute = "gene_ontology". The score indicates how
well the annotation is supported by the annotations of the members of
the HOG.
go <- getHOG(root$hog_id, attribute = "gene_ontology")
go[, c("GO_term", "name", "aspect", "score")]
#> GO_term name aspect score
#> 1 GO:0008150 biological_process biological_process 0.7226562
#> 2 GO:0005634 nucleus cellular_component 0.4436035
#> 3 GO:0005737 cytoplasm cellular_component 0.4436035
#> 4 GO:0005575 cellular_component cellular_component 0.7226562
#> 5 GO:0003674 molecular_function molecular_function 0.7226562To test whether the GO annotations of a sub-HOG are enriched compared to the whole family, the annotations of the members can be analysed with the topGO package:
library(topGO)
memberGO <- getProtein(members$omaid, attribute = "gene_ontology")
annotations <- formatTopGO(memberGO, format = "geneID2GO")
subhog <- members$omaid[startsWith(members$oma_hog_id, children$hog_id[1])]
GOdata <- getTopGO(annotations, foregroundGenes = subhog,
format = "geneID2GO", ontology = "BP")
GOdata
#>
#> ------------------------- topGOdata object -------------------------
#>
#> Description:
#> -
#>
#> Ontology:
#> - BP
#>
#> 3 available genes (all genes from the array):
#> - symbol: YEAST00001 YEAST05611 CANGA01146 ...
#> - 1 significant genes.
#>
#> 3 feasible genes (genes that can be used in the analysis):
#> - symbol: YEAST00001 YEAST05611 CANGA01146 ...
#> - 1 significant genes.
#>
#> GO graph (nodes with at least 1 genes):
#> - a graph with directed edges
#> - number of nodes = 1
#> - number of edges = 0
#>
#> ------------------------- topGOdata object -------------------------HOGs with a similar phylogenetic profile, i.e. a similar pattern of
gene losses and duplications, can be found with
attribute = "similar_profile_hogs":
similar <- getHOG(root$hog_id, attribute = "similar_profile_hogs",
max_results = 5)
similar[, c("hog_id", "jaccard_similarity")]
#> hog_id jaccard_similarity
#> 1 HOG:F0412211 0.9726562
#> 2 HOG:F0411624 0.9726562
#> 3 HOG:F0411692 0.9296875
#> 4 HOG:F0412081 0.9062500
#> 5 HOG:F0412167 0.8828125The complete structure of a HOG, with all speciation and duplication events, is available in the OrthoXML format:
xml <- getOrthoXML(root$hog_id)
cat(substr(xml, 1, 300))
#> <orthoXML xmlns="http://orthoXML.org/2011/" origin="OMA" originVersion="May 2025" version="0.5">
#> <species name="Kluyveromyces lactis (strain ATCC 8585 / CBS 2359 / DSM 70799 / NBRC 1267 / NRRL Y-1140 / WM37)" NCBITaxId="284590" taxonId="284590">
#> <database name="Kluyveromyces lactis strain NRRLAll HOGs defined at a taxonomic level correspond to the genes of the ancestral genome at that level:
ancestral <- getHOGs(level = "Saccharomycetaceae")
nrow(ancestral)
#> [1] 7232
summary(ancestral$completeness_score)
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> 0.0560 0.1110 0.8330 0.5873 0.9440 1.0000The members of these HOGs can be loaded using the urls in the column
members_url with resolveURL():
The OMA Browser also infers the gene order of ancestral genomes.
getSynteny() retrieves the neighbourhood of a HOG at a
given level as a graph, with the HOGs as nodes and edges between
neighbouring HOGs:
synteny <- getSynteny(level = "Saccharomycetaceae", id = root$hog_id,
context = 2)
synteny$nodes
#> id nr_members completeness_score
#> 1 HOG:F0411479 20 0.944
#> 2 HOG:F1075055.12b 15 0.833
#> 3 HOG:F0413377 15 0.833
#> 4 HOG:F0848020.6b 14 0.778
#> 5 HOG:F0412295 15 0.611
synteny$links[, c("source", "target", "weight", "orientation")]
#> source target weight orientation
#> 1 HOG:F0411479 HOG:F0412295 9 unidirectional
#> 2 HOG:F0411479 HOG:F1075055.12b 7 convergent
#> 3 HOG:F1075055.12b HOG:F0848020.6b 9 divergent
#> 4 HOG:F0413377 HOG:F0412295 8 divergentThe graph can be analysed with graph packages such as igraph:
Altenhoff AM, Gil M, Gonnet GH, Dessimoz C (2013). Inferring hierarchical orthologous groups from orthologous gene pairs. PLoS ONE 8(1): e53786. https://doi.org/10.1371/journal.pone.0053786
sessionInfo()
#> R version 4.6.2 (2026-10-29)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 26.04.1 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so; LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: Etc/UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats4 stats graphics grDevices utils datasets methods
#> [8] base
#>
#> other attached packages:
#> [1] topGO_2.65.0 SparseM_1.84-2 GO.db_3.24.0
#> [4] AnnotationDbi_1.75.2 IRanges_2.47.5 S4Vectors_0.51.10
#> [7] Biobase_2.73.2 graph_1.91.0 BiocGenerics_0.59.13
#> [10] generics_0.1.4 OmaDB_2.29.2 BiocStyle_2.41.0
#>
#> loaded via a namespace (and not attached):
#> [1] sass_0.5.0 RSQLite_3.53.3 lattice_0.23-1
#> [4] magrittr_2.0.5 digest_0.6.39 grid_4.6.2
#> [7] evaluate_1.0.5 fastmap_1.2.0 blob_1.3.0
#> [10] jsonlite_2.0.0 ape_5.8-1 DBI_1.3.0
#> [13] BiocManager_1.30.27 httr_1.4.9 Biostrings_2.81.9
#> [16] httr2_1.3.0 jquerylib_0.1.4 cli_3.6.6
#> [19] rlang_1.3.0 crayon_1.5.3 XVector_0.53.0
#> [22] bit64_4.8.6 cachem_1.1.0 yaml_2.3.12
#> [25] otel_0.3.0 BiocBaseUtils_1.15.1 parallel_4.6.2
#> [28] tools_4.6.2 memoise_2.0.1 curl_8.1.0
#> [31] buildtools_1.0.0 vctrs_0.7.3 R6_2.6.1
#> [34] png_0.1-9 matrixStats_1.5.0 lifecycle_1.0.5
#> [37] KEGGREST_1.53.6 Seqinfo_1.3.2 bit_4.6.0
#> [40] pkgconfig_2.0.3 bslib_0.12.0 glue_1.8.1
#> [43] Rcpp_1.1.2 GenomicRanges_1.65.4 xfun_0.62
#> [46] sys_3.4.3 knitr_1.52 igraph_2.3.4
#> [49] nlme_3.1-172 htmltools_0.5.9 rmarkdown_2.32
#> [52] maketools_1.3.2 compiler_4.6.2