{"id":19787927,"url":"https://github.com/drostlab/orthologr","last_synced_at":"2025-12-17T03:10:24.948Z","repository":{"id":83417351,"uuid":"21604114","full_name":"drostlab/orthologr","owner":"drostlab","description":"Genome wide orthology inference and dNdS estimation","archived":false,"fork":false,"pushed_at":"2023-10-10T07:16:50.000Z","size":108361,"stargazers_count":90,"open_issues_count":9,"forks_count":27,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-06T06:25:02.816Z","etag":null,"topics":["biomartr","blast","blast-searches","codon-alignment","comparative","comparative-genomics","comparative-genomics-studies","comparing-genomes","dnds-estimation","entire-genomes","genomics","genomics-studies","orthologous-genes","orthology-inference","proteome","r","retrieve-genomes","sequence-alignment","sequence-alignments","species"],"latest_commit_sha":null,"homepage":"https://drostlab.github.io/orthologr/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drostlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-07-08T08:01:29.000Z","updated_at":"2025-03-13T04:39:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"660a8cd9-6df9-4362-902a-5250d7dbb8b6","html_url":"https://github.com/drostlab/orthologr","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drostlab%2Forthologr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drostlab%2Forthologr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drostlab%2Forthologr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drostlab%2Forthologr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drostlab","download_url":"https://codeload.github.com/drostlab/orthologr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251802687,"owners_count":21646260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biomartr","blast","blast-searches","codon-alignment","comparative","comparative-genomics","comparative-genomics-studies","comparing-genomes","dnds-estimation","entire-genomes","genomics","genomics-studies","orthologous-genes","orthology-inference","proteome","r","retrieve-genomes","sequence-alignment","sequence-alignments","species"],"created_at":"2024-11-12T06:25:08.203Z","updated_at":"2025-12-17T03:10:24.903Z","avatar_url":"https://github.com/drostlab.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"orthologr \u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"174\" width=\"150\" /\u003e\n=========\n\n## Comparative Genomics with R\n\n### Motivation\n\nThe comparative method is a powerful approach in genomics research. Based on our knowledge about the phylogenetic relationships between species, we can study the evolution, diversification, and constraints of biological processes by comparing genomes, genes, and other genomic loci across species. The `orthologr` package aims to provide a framework to perform __large scale__ comparative genomics studies with R. `Orthologr` aims to be as easy to use as possible - from genomic data retrieval to orthology inference and dNdS estimation between several genomes.\n\nIn combination with the R package [biomartr](https://github.com/ropensci/biomartr), users can retrieve genomes, proteomes, or coding sequences for several species and use them as input\nfor orthology inference and dN/dS estimation with `orthologr`. The advantage of using `biomartr` in combination with `orthologr` is that\nusers can join the new wave of research that promotes and facilitates\n[computational reproducibility in genomics studies](https://github.com/ropensci/biomartr#short-package-description) and solve the\nissue of comparing genomes with different genome assembly qualities (also referred to as [genome version crisis](https://github.com/ropensci/biomartr#short-package-description)).\n\nYou can find a detailed list of all `orthologr` functions here: https://drostlab.github.io/orthologr/reference/index.html\n\n### Citation\n\n**Please cite the following paper in which I introduce `orthologr` when using this package for your own research. This will allow me to continue\nworking on this software tool and will motivate me to extend its functionality and usability in the next years. Many thanks in advance :)**\n\n\u003e Drost et al. 2015. __Evidence for Active Maintenance of Phylotranscriptomic Hourglass Patterns in Animal and Plant Embryogenesis__. _Mol. Biol. Evol._ 32 (5): 1221-1231. [doi:10.1093/molbev/msv012](http://mbe.oxfordjournals.org/content/32/5/1221.abstract?sid=767aea12-1eb3-40be-8c6a-e2861f159b46)\n\n### Short package description\n\nIn detail, `orthologr` allows users to perform orthology inference and dN/dS estimation between two genomes or between several genomes. The following methods\nto infer orthologous relationships between genes of entire genomes are available in this package:\n\n- [__BLAST best hit__](https://drostlab.github.io/orthologr/articles/blast.html#the-blast_best-function)\n- [__BLAST best reciprocal hit__](https://drostlab.github.io/orthologr/articles/blast.html#the-blast_rec-function)\n- [__OrthoFinder2__](https://drostlab.github.io/orthologr/articles/orthology_inference.html)\n\nThe most useful implementation in `orthologr` is the ability to compute synonymous versus non-synonymous substitution rates (dN/dS)\nfor all orthologous genes between two __entire genomes__.\nAvailable dN/dS estimation methods are:\n\n- \"NG\": Nei, M. and Gojobori, T. (1986)\n- \"LWL\": Li, W.H., et al. (1985)\n- \"LPB\": Li, W.H. (1993) and Pamilo, P. and Bianchi, N.O. (1993)\n- \"MLWL\" (Modified LWL), MLPB (Modified LPB): Tzeng, Y.H., et al. (2004)\n- \"YN\": Yang, Z. and Nielsen, R. (2000)\n- \"MYN\" (Modified YN): Zhang, Z., et al. (2006)\n- \"GMYN\": Wang, D.P., et al. Biology Direct. (2009)\n- \"GY\": Goldman, N. and Yang, Z. (1994)\n- \"MS\": (Model Selection): based on a set of candidate models, Posada, D. (2003) \n- \"MA\" (Model Averaging): based on a set of candidate models, Posada, D. (2003)\n- \"ALL\": All models toghether \n\nPlease find more details [here](https://drostlab.github.io/orthologr/articles/dNdS_estimation.html).\n\n## Install `orthologr`\n\n```r\n# Install Bioconductor\nif (!requireNamespace(\"BiocManager\", quietly = TRUE))\n    install.packages(\"BiocManager\")\nBiocManager::install()\n\n# Install package dependencies\nBiocManager::install(c(\n        \"Biostrings\",\n        \"GenomicRanges\",\n        \"GenomicFeatures\",\n        \"Rsamtools\",\n        \"rtracklayer\"\n))\n\n# install CRAN dependencies\ninstall.packages(c(\"doParallel\", \"foreach\", \"ape\", \"Rdpack\", \"benchmarkme\", \"devtools\"))\n\n# install BLAST dependency metablastr from GitHub\ndevtools::install_github(\"drostlab/metablastr\")\n\n# install DIAMOND dependency rdiamond from GitHub\ndevtools::install_github(\"drostlab/rdiamond\")\n\n# install orthologr from GitHub\ndevtools::install_github(\"drostlab/orthologr\")\n```\n\n## Use Cases\n\nLearn `orthologr` by reading these tutorials: \n\n- [Install Prerequisite Tools](https://drostlab.github.io/orthologr/articles/Install.html)\n- [Perform Orthology Inference and dNdS Estimation](https://drostlab.github.io/orthologr/articles/dNdS_estimation.html)\n- [Perform Only Orthology Inference](https://drostlab.github.io/orthologr/articles/orthology_inference.html)\n- [Perform BLAST Searches](https://drostlab.github.io/orthologr/articles/blast.html)\n- [Perform Divergence Stratigraphy](https://drostlab.github.io/orthologr/articles/divergence_stratigraphy.html)\n- [Perform Sequence Alignments](https://drostlab.github.io/orthologr/articles/sequence_alignments.html)\n\n\n\n## Example\n\n### Small example with internal dataset\n```r\nlibrary(orthologr)\n\n# Detect orthologous genes between a query species and a subject species\n# and compute the synonymous versus non-synonymous substitution rates (dN/dS)\n# following this paradigm:\n# 1) reciprocal best hit for orthology inference (RBH)\n# 2) Needleman-Wunsch for pairwise amino acid alignments\n# 3) pal2nal for codon alignments\n# 4) Comeron for dNdS estimation\n# 5) multi-core processing 'comp_cores = 1'\ndNdS(query_file      = system.file('seqs/ortho_thal_cds.fasta', package = 'orthologr'),\n     subject_file    = system.file('seqs/ortho_lyra_cds.fasta', package = 'orthologr'),\n     delete_corrupt_cds = TRUE, # coding sequences that cannot be divided by 3 (triplets) will be removed\n     ortho_detection = \"RBH\", # perform DIAMOND best reciprocal hit orthology inference\n     aa_aln_type     = \"pairwise\", # perform pairwise global alignments of AA seqs \n     aa_aln_tool     = \"NW\", # using Needleman-Wunsch\n     codon_aln_tool  = \"pal2nal\", # perform codon alignments using the tool Pal2Nal\n     dnds_est.method = \"Comeron\", # use Comeron's method for dN/dS inference\n     comp_cores      = 1) # number of compute cores\n```\n\n```\n# A tibble: 20 x 24\n   query_id subject_id      dN    dS   dNdS perc_identity num_ident_match… alig_length\n   \u003cchr\u003e    \u003cchr\u003e        \u003cdbl\u003e \u003cdbl\u003e  \u003cdbl\u003e         \u003cdbl\u003e            \u003cint\u003e       \u003cint\u003e\n 1 AT1G010… 333554|PA… 0.106   0.254 0.420           74.0              347         469\n 2 AT1G010… 470181|PA… 0.0402  0.104 0.388           91.1              224         246\n 3 AT1G010… 470180|PA… 0.0150  0.126 0.118           95.5              343         359\n 4 AT1G010… 333551|PA… 0.0135  0.116 0.116           92.0             1812        1970\n 5 AT1G010… 909874|PA… 0       0.175 0              100                213         213\n 6 AT1G010… 470177|PA… 0.0449  0.113 0.397           89.5              580         648\n 7 AT1G010… 918864|PA… 0.0183  0.106 0.173           95.1              348         366\n 8 AT1G010… 909871|PA… 0.0340  0.106 0.322           90.3              271         300\n 9 AT1G010… 470171|PA… 0.00910 0.218 0.0417          96.8              420         434\n10 AT1G011… 333544|PA… 0.0325  0.122 0.266           93.6              494         528\n11 AT1G011… 918858|PA… 0.00307 0.133 0.0232          99.2              525         529\n12 AT1G011… 470161|PA… 0.00567 0.131 0.0432          98.5              446         453\n13 AT1G011… 918855|PA… 0.13    0.203 0.641           72.6              207         285\n14 AT1G011… 918854|PA… 0.105   0.280 0.373           84.9              152         179\n15 AT1G011… 311317|PA… 0       0.306 0               85.6               83          97\n16 AT1G011… 909860|PA… 0.0297  0.176 0.168           92.6              287         310\n17 AT1G011… 311315|PA… 0.0287  0.162 0.177           94.2              502         533\n18 AT1G012… 470156|PA… 0.0190  0.168 0.114           95.8              228         238\n19 AT1G012… 311313|PA… 0.0207  0.154 0.134           95.3              102         107\n20 AT1G012… 470155|PA… 0.0157  0.153 0.102           96.7             1021        1056\n# … with 16 more variables: mismatches \u003cint\u003e, gap_openings \u003cint\u003e, n_gaps \u003cint\u003e,\n#   pos_match \u003cint\u003e, ppos \u003cdbl\u003e, q_start \u003cint\u003e, q_end \u003cint\u003e, q_len \u003cint\u003e, qcov \u003cint\u003e,\n#   qcovhsp \u003cint\u003e, s_start \u003cint\u003e, s_end \u003cdbl\u003e, s_len \u003cdbl\u003e, evalue \u003cdbl\u003e, bit_score \u003cdbl\u003e,\n#   score_raw \u003cdbl\u003e\n```\n\nWhen running your own query file, please specify `query_file = \"path/to/your/cds.fasta` instead of `system.file(..., package = \"orthologr\")`. The command `system.file(..., package = \"orthologr\")` merely references the path to the example file stored in the `orthologr` package itself.\n\n\n### Example: Computing dN/dS values for all orthologous genes between two genomes\n\nFirst, users can retrieve all coding sequences from entire genomes using the [biomartr](https://github.com/ropensci/biomartr) package ([see details here](https://ropensci.github.io/biomartr/articles/Sequence_Retrieval.html#cds-retrieval)).\n\n```r\ninstall.packages(\"biomartr\")\nlibrary(biomartr)\n# download all coding sequences for Mus musculus\nMmusculus_file \u003c- biomartr::getCDS(organism = \"Mus musculus\", path = getwd())\n# download all coding sequences for Homo sapiens\nHsapiens_file \u003c- biomartr::getCDS(organism = \"Homo sapiens\", path = getwd())\n# compute dN/dS values for Homo sapiens versus Mus musculus\nHs_vs_Mm_dNdS \u003c- \n  dNdS(query_file      = Hsapiens_file,\n       subject_file    = Mmusculus_file,\n       delete_corrupt_cds = FALSE,\n       ortho_detection = \"RBH\", \n       aa_aln_type     = \"pairwise\",\n       aa_aln_tool     = \"NW\", \n       codon_aln_tool  = \"pal2nal\", \n       dnds_est.method = \"Comeron\", \n       comp_cores      = 1 )\n# store result in Excel readable csv file\ninstall.packages(\"readr\")\nreadr::write_excel_csv(Hs_vs_Mm_dNdS, \"Hs_vs_Mm_dNdS.csv\")\n```\n\nUsers can find the corresponding map at https://github.com/drostlab/dNdS_database.\n\n__This way, users can compute dN/dS values for any pairwise genome comparison.__\n\n### On Windows Systems\n\nIn some cases (when working with __WINDOWS__ machines), the installation via `devtools`\nwill not work properly. In this case users can try the follwing steps:\n\n```r\n# On Windows, this won't work - see ?build_github_devtools\ninstall_github(\"drostlab/orthologr\", build_vignettes = TRUE, dependencies = TRUE)\n\n# When working with Windows, first users need to install the\n# R package: rtools -\u003e install.packages(\"rtools\")\n\n# Afterwards users can install devtools -\u003e install.packages(\"devtools\")\n# and then they can run:\n\ndevtools::install_github(\"drostlab/orthologr\", build_vignettes = TRUE, dependencies = TRUE)\n\n# and then call it from the library\nlibrary(\"orthologr\", lib.loc = \"C:/Program Files/R/R-3.1.1/library\")\n```\n\n### Troubleshooting on Windows Machines\n\n- Install `orthologr` on a Win 8 laptop: [solution](https://github.com/drostlab/orthologr/issues/1) ( Thanks to Andres Romanowski )\n\n\n## Interfaces implemented in `orthologr`:\n\n### Perform BLAST searches with R  \n\n* `blast()`: Perform a BLAST+ search\n* `blast_best()`: Perform a BLAST+ best hit search\n* `blast_rec()`: Perform a BLAST+ best reciprocal hit (BRH) search\n\n\n### Perform Pairwise and Multiple Sequence Alignements with R\n\n* `multi_aln()`: Compute Multiple Sequence Alignments based on the `clustalw`, `t_coffee`, `muscle`, `clustalo`, and `mafft` programs.\n* `pairwise_aln()`: Compute Pairwise Alignments\n* `codon_aln()`: Compute a Codon Alignment\n\n### Perform Orthology Inference with R\n\n* `orthologs()`: Main Orthology Inference Function\n\n### Perform Population Genomics with R\n\n* `dNdS()`: Compute dNdS values for two organisms\n* `substitutionrate()`: Internal function for dNdS computations\n\n### Read and Write CDS, Genomes, and Proteomes\n\n* `read.cds()`: Read the CDS of a given organism\n* `read.genome()`: Read the genome of a given organism\n* `read.proteome()`: Read the proteome of a given organism\n* `write.proteome()`: Save a proteome in fasta format\n\n\n## Discussions and Bug Reports\n\nI would be very happy to learn more about potential improvements of the concepts and functions provided in this package.\n\nFurthermore, in case you find some bugs, need additional (more flexible) functionality of parts of this package, or want to contribute to this project please let me know:\n\nhttps://github.com/drostlab/orthologr/issues\n\n## Licenses\n\nThe `orthologr` package includes source code that has been published under following licenses:\n\n### gestimator\n\n```\nAll files included in `orthologr` that were taken from gestimator are \nalso part of libsequence.\n\nlibsequence is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or\n(at your option) any later version.\n\nlibsequence is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nlong with libsequence.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n\nModified by Sarah Scharfenberg and Hajk-Georg Drost (2014) to work \nin orthologr without using external libraries from libsequence.\n\nAll changes are also free under the terms of GNU General Public License\nversion 2 of the License, or any later version.\n\n```\n\n### KaKs_Calculator\n\nIn `orthologr` the file `parseFastaIntoAXT.pl` is stored in `/inst/KaKs_Calc_parser`.\n\n```\nThe parseFastaIntoAXT.pl script is freely available under GNU GPL v3 \nLicence and included in the KaKs_Calculator project that can be found at \nhttps://code.google.com/p/kaks-calculator/\n\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrostlab%2Forthologr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrostlab%2Forthologr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrostlab%2Forthologr/lists"}