Exploring the taxonomy with OmaDB

Introduction

The OMA Browser organises its genomes in a taxonomy derived from the NCBI taxonomy. The taxonomic levels of this tree are the levels at which Hierarchical Orthologous Groups and ancestral genomes are defined. This vignette shows how to retrieve the taxonomy with OmaDB and how to use it with the ape package. See the vignette “Get started with OmaDB” for an introduction to the package.

Installation

if (!requireNamespace("BiocManager", quietly = TRUE)) {
    install.packages("BiocManager")
}
BiocManager::install("OmaDB")
library(OmaDB)

Retrieving the taxonomy

getTaxonomy() returns the taxonomy in newick format. It can be restricted to a subtree with the argument root, or to the taxonomy induced by a set of genomes or taxonomic levels with members:

taxonomy <- getTaxonomy(members = c("YEAST", "ASHGO", "SCHPO", "HUMAN",
    "MOUSE", "DROME", "ARATH"))
taxonomy$root_taxon
#> OMA Browser object with 2 attributes:
#>  $ name     : character Eukaryota 
#>  $ taxon_id : integer 2759
taxonomy$newick
#> [1] "(\"Arabidopsis thaliana\",(((\"Ashbya gossypii (strain ATCC 10895 / CBS 109.51 / FGSC 9923 / NRRL Y-1056)\",\"Saccharomyces cerevisiae (strain ATCC 204508 / S288c)\")Saccharomycetaceae,\"Schizosaccharomyces pombe (strain 972 / ATCC 24843)\")Ascomycota,(\"Drosophila melanogaster\",(\"Homo sapiens\",\"Mus musculus\")Euarchontoglires)Bilateria)Opisthokonta)Eukaryota;"

With newick = FALSE, the taxonomy is returned as a nested structure that includes the NCBI taxon ids of all levels:

tax <- getTaxonomy(members = c("YEAST", "ASHGO", "SCHPO"), newick = FALSE)
tax$name
#> [1] "Ascomycota"
tax$children[, c("name", "id")]
#>                                                  name     id
#> 1                                  Saccharomycetaceae   4893
#> 2 Schizosaccharomyces pombe (strain 972 / ATCC 24843) 284812

Working with the tree

getTree() converts the taxonomy into a phylo object of the ape package, which can be visualised and analysed with ape or other packages such as ggtree.

tree <- getTree(taxonomy)
tree
#> 
#> Phylogenetic tree with 7 tips and 6 internal nodes.
#> 
#> Tip labels:
#>   Arabidopsis thaliana, Ashbya gossypii (strain ATCC 10895 / CBS 109.51 / FGSC 9923 / NRRL Y-1056), Saccharomyces cerevisiae (strain ATCC 204508 / S288c), Schizosaccharomyces pombe (strain 972 / ATCC 24843), Drosophila melanogaster, Homo sapiens, ...
#> Node labels:
#>   Eukaryota, Opisthokonta, Ascomycota, Saccharomycetaceae, Bilateria, Euarchontoglires
#> 
#> Rooted; no branch length.
plot(tree, show.node.label = TRUE, cex = 0.7, no.margin = TRUE,
    x.lim = 12)

The internal node labels are the taxonomic levels that can be used in the other functions of the package, e.g. to retrieve the ancestral genome at a level with getHOGs():

tree$node.label
#> [1] "Eukaryota"          "Opisthokonta"       "Ascomycota"        
#> [4] "Saccharomycetaceae" "Bilateria"          "Euarchontoglires"

Session information

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.4.10          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