if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
# orthogene is only available on Bioconductor>=3.14
if(BiocManager::version()<"3.14")
BiocManager::install(update = TRUE, ask = FALSE)
BiocManager::install("orthogene")
library(orthogene)
data("exp_mouse")
# Setting to "homologene" for the purposes of quick demonstration.
# We generally recommend using method="gprofiler" (default).
method <- "homologene"
It’s not always clear whether a dataset is using the original species gene names, human gene names, or some other species’ gene names.
infer_species takes a list/matrix/data.frame with genes and
infers the species that they best match to!
For the sake of speed, the genes extracted from gene_df
are tested against genomes from only the following 6 test_species by default:
- human
- monkey
- rat
- mouse
- zebrafish
- fly
However, you can supply your own list of test_species, which will
be automatically be mapped and standardised using map_species.
matches <- orthogene::infer_species(gene_df = exp_mouse,
method = method)
## Preparing gene_df.
## sparseMatrix format detected.
## Extracting genes from rownames.
## 15,259 genes extracted.
## Testing for gene overlap with: human
## Retrieving all genes using: homologene.
## Retrieving all organisms available in homologene.
## Mapping species name: human
## Common name mapping found for human
## 1 organism identified from search: 9606
## Using cached file: /Users/biocbuild/Library/Caches/org.R-project.R/R/orthogene/all_genes-9606-homologene.csv.gz
## Returning all 19,129 genes from human.
## Testing for gene overlap with: monkey
## Retrieving all genes using: homologene.
## Retrieving all organisms available in homologene.
## Mapping species name: monkey
## Common name mapping found for monkey
## 1 organism identified from search: 9544
## Using cached file: /Users/biocbuild/Library/Caches/org.R-project.R/R/orthogene/all_genes-9544-homologene.csv.gz
## Returning all 16,843 genes from monkey.
## Testing for gene overlap with: rat
## Retrieving all genes using: homologene.
## Retrieving all organisms available in homologene.
## Mapping species name: rat
## Common name mapping found for rat
## 1 organism identified from search: 10116
## Using cached file: /Users/biocbuild/Library/Caches/org.R-project.R/R/orthogene/all_genes-10116-homologene.csv.gz
## Returning all 20,616 genes from rat.
## Testing for gene overlap with: mouse
## Retrieving all genes using: homologene.
## Retrieving all organisms available in homologene.
## Mapping species name: mouse
## Common name mapping found for mouse
## 1 organism identified from search: 10090
## Using cached file: /Users/biocbuild/Library/Caches/org.R-project.R/R/orthogene/all_genes-10090-homologene.csv.gz
## Returning all 21,207 genes from mouse.
## Testing for gene overlap with: zebrafish
## Retrieving all genes using: homologene.
## Retrieving all organisms available in homologene.
## Mapping species name: zebrafish
## Common name mapping found for zebrafish
## 1 organism identified from search: 7955
## Using cached file: /Users/biocbuild/Library/Caches/org.R-project.R/R/orthogene/all_genes-7955-homologene.csv.gz
## Returning all 20,897 genes from zebrafish.
## Testing for gene overlap with: fly
## Retrieving all genes using: homologene.
## Retrieving all organisms available in homologene.
## Mapping species name: fly
## Common name mapping found for fly
## 1 organism identified from search: 7227
## Using cached file: /Users/biocbuild/Library/Caches/org.R-project.R/R/orthogene/all_genes-7227-homologene.csv.gz
## Returning all 8,438 genes from fly.
## Top match:
## - species: mouse
## - percent_match: 92%
To create an example dataset, turn the gene names into rat genes.
exp_rat <- orthogene::convert_orthologs(gene_df = exp_mouse,
input_species = "mouse",
output_species = "rat",
method = method)
matches <- orthogene::infer_species(gene_df = exp_rat,
method = method)
To create an example dataset, turn the gene names into human genes.
exp_human <- orthogene::convert_orthologs(gene_df = exp_mouse,
input_species = "mouse",
output_species = "human",
method = method)
matches <- orthogene::infer_species(gene_df = exp_human,
method = method)
test_speciesYou can even supply test_species with the name of one of the R packages that
orthogene gets orthologs from. This will test against all species available
in that particular R package.
For example, by setting test_species="homologene" we automatically test for
% gene matches in each of the 20+ species available in homologene.
matches <- orthogene::infer_species(gene_df = exp_human,
test_species = method,
method = method)
utils::sessionInfo()
R version 4.6.0 Patched (2026-04-24 r89963)
Platform: aarch64-apple-darwin23
Running under: macOS Tahoe 26.3.1
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRlapack.dylib; LAPACK version 3.12.1
locale:
[1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: America/New_York
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] orthogene_1.18.0 BiocStyle_2.40.0
loaded via a namespace (and not attached):
[1] ggiraph_0.9.6 tidyselect_1.2.1
[3] viridisLite_0.4.3 dplyr_1.2.1
[5] farver_2.1.2 R.utils_2.13.0
[7] S7_0.2.2 fastmap_1.2.0
[9] lazyeval_0.2.3 homologene_1.4.68.19.3.27
[11] fontquiver_0.2.1 digest_0.6.39
[13] lifecycle_1.0.5 tidytree_0.4.7
[15] magrittr_2.0.5 compiler_4.6.0
[17] rlang_1.2.0 sass_0.4.10
[19] tools_4.6.0 yaml_2.3.12
[21] data.table_1.18.2.1 knitr_1.51
[23] ggsignif_0.6.4 labeling_0.4.3
[25] htmlwidgets_1.6.4 RColorBrewer_1.1-3
[27] aplot_0.2.9 abind_1.4-8
[29] babelgene_22.9 withr_3.0.2
[31] purrr_1.2.2 R.oo_1.27.1
[33] grid_4.6.0 ggpubr_0.6.3
[35] gdtools_0.5.0 ggplot2_4.0.3
[37] scales_1.4.0 MASS_7.3-65
[39] dichromat_2.0-0.1 tinytex_0.59
[41] cli_3.6.6 rmarkdown_2.31
[43] treeio_1.36.0 generics_0.1.4
[45] otel_0.2.0 ggtree_4.2.0
[47] httr_1.4.8 gprofiler2_0.2.4
[49] ape_5.8-1 cachem_1.1.0
[51] parallel_4.6.0 ggplotify_0.1.3
[53] BiocManager_1.30.27 yulab.utils_0.2.4
[55] vctrs_0.7.3 Matrix_1.7-5
[57] jsonlite_2.0.0 fontBitstreamVera_0.1.1
[59] carData_3.0-6 bookdown_0.46
[61] car_3.1-5 gridGraphics_0.5-1
[63] patchwork_1.3.2 rstatix_0.7.3
[65] Formula_1.2-5 magick_2.9.1
[67] systemfonts_1.3.2 plotly_4.12.0
[69] tidyr_1.3.2 jquerylib_0.1.4
[71] glue_1.8.1 gtable_0.3.6
[73] tibble_3.3.1 pillar_1.11.1
[75] rappdirs_0.3.4 htmltools_0.5.9
[77] R6_2.6.1 evaluate_1.0.5
[79] lattice_0.22-9 R.methodsS3_1.8.2
[81] backports_1.5.1 broom_1.0.12
[83] ggfun_0.2.0 fontLiberation_0.1.0
[85] bslib_0.10.0 Rcpp_1.1.1-1.1
[87] nlme_3.1-169 xfun_0.57
[89] fs_2.1.0 pkgconfig_2.0.3