{"id":24182971,"url":"https://github.com/ms609/tbrdist","last_synced_at":"2026-06-08T11:02:18.670Z","repository":{"id":56936045,"uuid":"222702955","full_name":"ms609/TBRDist","owner":"ms609","description":"An R package to calculate tree rearrangement distances","archived":false,"fork":false,"pushed_at":"2026-04-17T13:03:12.000Z","size":980,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-17T14:32:57.730Z","etag":null,"topics":["algorithms","bioinformatics","distance-calculation","phylogenetic-trees","phylogenetics","r"],"latest_commit_sha":null,"homepage":"https://ms609.github.io/TBRDist","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ms609.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json","zenodo":".zenodo.json","notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2019-11-19T13:29:57.000Z","updated_at":"2026-04-17T13:00:56.000Z","dependencies_parsed_at":"2022-08-21T06:20:36.809Z","dependency_job_id":null,"html_url":"https://github.com/ms609/TBRDist","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ms609/TBRDist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms609%2FTBRDist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms609%2FTBRDist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms609%2FTBRDist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms609%2FTBRDist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ms609","download_url":"https://codeload.github.com/ms609/TBRDist/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms609%2FTBRDist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34059157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["algorithms","bioinformatics","distance-calculation","phylogenetic-trees","phylogenetics","r"],"created_at":"2025-01-13T08:45:52.546Z","updated_at":"2026-06-08T11:02:18.664Z","avatar_url":"https://github.com/ms609.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TBRDist\n\n[![R-CMD-check](https://github.com/ms609/TBRDist/actions/workflows/R-CMD-check.yml/badge.svg)](https://github.com/ms609/TBRDist/actions/workflows/R-CMD-check.yml)\n[![codecov](https://codecov.io/gh/ms609/TBRDist/branch/master/graph/badge.svg)](https://codecov.io/gh/ms609/TBRDist)\n[![CRAN Status Badge](https://www.r-pkg.org/badges/version/TBRDist)](https://cran.r-project.org/package=TBRDist)\n[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/TBRDist)](https://ms609.github.io/usage#tbrdist)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3548332.svg)](https://doi.org/10.5281/zenodo.3548332)\n[![Project Status: Inactive – The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.](https://www.repostatus.org/badges/latest/inactive.svg)](https://www.repostatus.org/#inactive)\n\n'TBRDist' is an R package that calculates rearrangement distances between\nphylogenetic trees using C++ algorithms\nby [Chris Whidden](https://web.cs.dal.ca/~whidden/):\n\n- **Unrooted trees** (`TBRDist()`, `USPRDist()`, `ReplugDist()`): TBR, SPR,\n  and Replug distances based on the algorithms of\n  [Whidden and Matsen (2017)](https://arxiv.org/abs/1511.07529).\n  The C++ implementation has diverged from the upstream\n  [uspr](https://github.com/cwhidden/uspr) library with optimizations\n  including integer-encoded tree identity (replacing Newick string\n  round-tripping), precomputed SPR lookup tables for small trees, and\n  reduced heap allocation in the A\\* search and branch-and-bound routines,\n  yielding roughly 2.5× faster computation.\n- **Rooted trees** (`RSPRDist()`): Rooted SPR distances via\n  [rspr](https://github.com/cwhidden/rspr), implementing the exact\n  fixed-parameter algorithm (with cluster decomposition) of Whidden, Beiko,\n  and Zeh (2013). Supports exact distances, a linear-time 3-approximation, and\n  maximum agreement forest output.\n\nThe uSPR distance is a natural distance metric with respect to phylogenetic\ntree search, as common tree search and sampling software mainly use SPR\noperations (or NNI operations, a subset of SPR operations). The uSPR distance\nis also a lower bound on the number of lateral gene transfer events required to\nexplain the difference between a reference/species tree and a gene tree.\n\nNote that the uSPR distance is NP-hard to compute (as are the TBR and replug\ndistances) and the running time of most of the algorithms used in this software\nscales exponentially with the distance computed.\nThe unrooted functions are aimed at trees with up to 50 leaves and uSPR\ndistances up to 14. The rooted `RSPRDist()` can handle much larger trees\n(200+ leaves, distances \u003e 50).\n\n\n# Installation\n\nInstall and load the library from CRAN as follows:\n```\ninstall.packages('TBRDist')\nlibrary('TBRDist')\n```\n\nYou can install the development version thus:\n```r\nif(!require(devtools)) install.packages(\"devtools\")\ndevtools::install_github('ms609/TBRDist')\n```\n\nAdvanced users wishing to access the source code should note that the project\ncontains [submodules](https://github.blog/2016-02-01-working-with-submodules/).\nTo download the contents of these subdirectories, clone the project using\n`git clone --recursive https://github.com/ms609/TBRDist`,\nor if you've already cloned the project, run\n`git submodule update --init --recursive`.  \n\n# Citation\n\nIf you use unrooted distances (`TBRDist`, `USPRDist`, `ReplugDist`) in your\nresearch, please cite:\n\n\u003e Whidden C, Matsen FA IV (2019). Calculating the Unrooted\n\u003e Subtree-Prune-and-Regraft Distance. _IEEE/ACM Transactions on Computational\n\u003e Biology and Bioinformatics_ 16(3):898–911.\n\u003e doi:[10.1109/TCBB.2018.2802911](https://doi.org/10.1109/TCBB.2018.2802911)\n\nIf you use rooted SPR distances (`RSPRDist`), please cite:\n\n\u003e Whidden C, Beiko RG, Zeh N (2013). Fixed-Parameter Algorithms for Maximum\n\u003e Agreement Forests. _SIAM Journal on Computing_ 42(4):1431–1466.\n\u003e doi:[10.1137/110845045](https://doi.org/10.1137/110845045)\n\nA citation to the R package itself would also be appreciated:\n\n\u003e Smith MR (2019). TBRDist: Rearrangement Distances Between Phylogenetic Trees.\n\u003e doi:[10.5281/zenodo.3548333](https://doi.org/10.5281/zenodo.3548333)\n\n\n# Notes\n\nSome text in this README file originates from the ['uspr' readme](https://github.com/cwhidden/uspr/blob/master/README.md).\n\nPlease note that the 'TBRDist' project is released with a\n[Contributor Code of Conduct](CODE_OF_CONDUCT.md).\nBy contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fms609%2Ftbrdist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fms609%2Ftbrdist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fms609%2Ftbrdist/lists"}