{"id":16300446,"url":"https://github.com/rvosa/bio-phylo-forest-dbtree","last_synced_at":"2026-05-17T19:04:06.379Z","repository":{"id":6831836,"uuid":"8080160","full_name":"rvosa/bio-phylo-forest-dbtree","owner":"rvosa","description":"Bio::Phylo::Forest::DBTree - Object API for trees in portable databases","archived":false,"fork":false,"pushed_at":"2025-03-07T17:51:11.000Z","size":240520,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T21:53:33.160Z","etag":null,"topics":["bioinformatics","computational-biology","databases","object-relational","perl","phylogenetics"],"latest_commit_sha":null,"homepage":"","language":"Perl","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/rvosa.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}},"created_at":"2013-02-07T19:40:45.000Z","updated_at":"2025-03-07T17:51:15.000Z","dependencies_parsed_at":"2022-08-26T06:02:01.659Z","dependency_job_id":null,"html_url":"https://github.com/rvosa/bio-phylo-forest-dbtree","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvosa%2Fbio-phylo-forest-dbtree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvosa%2Fbio-phylo-forest-dbtree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvosa%2Fbio-phylo-forest-dbtree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvosa%2Fbio-phylo-forest-dbtree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvosa","download_url":"https://codeload.github.com/rvosa/bio-phylo-forest-dbtree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119400,"owners_count":21050754,"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":["bioinformatics","computational-biology","databases","object-relational","perl","phylogenetics"],"created_at":"2024-10-10T20:51:15.267Z","updated_at":"2025-10-05T14:46:26.408Z","avatar_url":"https://github.com/rvosa.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1035856.svg)](https://doi.org/10.5281/zenodo.1035856)\n![CPAN](https://img.shields.io/cpan/l/Bio-Phylo-Forest-DBTree?color=success)\n\nDBTree - toolkit for megatrees in portable SQL databases\n========================================================\n\n![Figure 1](docs/fig1.svg)\n\nAn example mapping of a tree topology to a database table. The mapping is\ncreated by processing a [Newick][12] tree file (infile.tre) as follows: \n\n    megatree-loader -i infile.tre -d outfile.db \n    \nWith this mapping, several topological queries can be performed quickly when \nloading the output file in [sqlite3][10] (or the excellent [SQLiteBrowser][11]).\n\n```sql\n-- select the most recent common ancestor of C and F\nselect MRCA.* from node as MRCA, node as C, node as F \n  where C.name='C' and F.name='F' \n  and MRCA.left \u003c min(C.left,F.left) \n  and MRCA.right \u003e max(C.right,F.right)\n  order by MRCA.left desc limit 1;\n \n-- select the descendants from node n2\nselect DESCENDANT.* from node as DESCENDANT, node as MRCA \n  where MRCA.name='n2' \n  and DESCENDANT.left \u003e MRCA.left \n  and DESCENDANT.right \u003c MRCA.right;\n```\n\nUsing databases that are indexed in this way, significant performance increases can\nbe accomplished. For example, a very common usage of large, published, static \nphylogenies is to extract subtrees from them in order to use them for downstream \nanalysis (e.g. in phylogenetic comparative studies). This application is so common that\nit forms essentially the basis of the success of \n[Phylomatic](https://phylodiversity.net/phylomatic/) and the \n[PhyloTastic](http://phylotastic.org/) project.\nA similar subtree extraction operation is also implemented by NCBI as the option to \nextract the '[common tree](https://www.ncbi.nlm.nih.gov/Taxonomy/CommonTree/wwwcmt.cgi)'\nfrom the NCBI taxonomy. Here, this functionality is made available by the \n`megatree-pruner` program. To benchmark its performance in comparison with a naive \napproach that operates on Newick strings, a pruner script based on \n[DendroPy](https://dendropy.org/) was run side by side with the pruner on randomly\nselected sets of tips from the OpenTree topology. The performance difference is shown\nbelow:\n\n![Figure 2](docs/fig2.svg)\n\n\nInstallation\n------------\n\nThe following installation instructions describe three different ways to install the\npackage. Unless you know what you are doing, the first way is probably the best one.\n\n### 1. From BioConda\n\nOn many Linux-like operating systems as well as MacOSX, the entire installation completes\nwith this single command:\n\n    conda install -c bioconda perl-bio-phylo-forest-dbtree\n\n### 2. From the Comprehensive Perl Archive Network (CPAN)\n\nOn many Linux-like operating systems as well as MacOSX, the entire installation completes\nwith this single command:\n\n    sudo cpanm Bio::Phylo::Forest::DBTree\n\n- **Advantages** - it's simple and all prerequisites are automatically installed. You will\n  obtain the [latest stable release][5] from CPAN, which is [amply tested][6].\n- **Disadvantages** - you will likely get code that is a lot older than the latest work\n  on this package.\n\n### 3. From GitHub\n\nOn many Linux-like operating systems as well as MacOSX, you can install the latest code\nfrom the [repository][8] with this single command:\n\n    sudo cpanm git://github.com/rvosa/bio-phylo-forest-dbtree.git\n\n- **Advantages** - it's simple, all prerequisites are automatically installed. You will\n  get the latest code, including any new features and bug fixes.\n- **Disadvantages** - you will install untested, recent code, which might include new bugs \n  or other features, in your system folders.\n\n### 4. From an archive snapshot\n\nThis is the approach you might take if you want complete control over the installation,\nand/or if there is a specific archive (such as zenodo release [10.5281/zenodo.1035856][7])\nyou wish to install or verify. \n\nThis approach starts by installing the prerequisites manually:\n\n```bash\n# do this only if you don't already have these already\nsudo cpanm Bio::Phylo\nsudo cpanm DBIx::Class\nsudo cpanm DBD::SQLite\n```\n\nThen, unpack the archive, move into the top level folder, and issue the build commands:\n\n```bash\nperl Makefile.PL\nmake\nmake test\n```\n\nFinally, you can opt to install the built products (using `sudo make install`), or\nkeep them in the present location, which would require you to update two environment\nvariables:\n\n```bash\n# add the script folder inside the archive to the search path for executables\nexport PATH=\"$PATH\":`pwd`/script\n    \n# add the lib folder to the search path for perl libraries\nexport PERL5LIB=\"$PERL5LIB\":`pwd`/lib\n```\n\nBUGS\n----\nPlease report any bugs or feature requests on the GitHub bug tracker:\nhttps://github.com/rvosa/bio-phylo-forest-dbtree/issues\n\nCOPYRIGHT \u0026 LICENSE\n-------------------\nCopyright 2013-2019 Rutger Vos, All Rights Reserved. This program is free software; \nyou can redistribute it and/or modify it under the same terms as Perl itself, i.e.\na choice between the following licenses:\n- [The Artistic License](COPYING)\n- [GNU General Public License v3.0](LICENSE)\n\nSEE ALSO\n--------\nSeveral curated, large phylogenies released by ongoing projects are made available as\ndatabase files that this distribution can operate on. These are:\n- PhyloTree ([van Oven et al., 2009][1])   - [10.6084/m9.figshare.4620757.v1](http://doi.org/10.6084/m9.figshare.4620757.v1)\n- D-Place ([Kirby et al., 2016][2])        - [10.6084/m9.figshare.4620217.v1](http://doi.org/10.6084/m9.figshare.4620217.v1)\n- NCBI taxonomy ([Federhen, 2011][3])      - [10.6084/m9.figshare.4620733.v1](http://doi.org/10.6084/m9.figshare.4620733.v1)\n- Green Genes ([DeSantis et al., 2006][4]) - [10.6084/m9.figshare.4620214.v1](http://doi.org/10.6084/m9.figshare.4620214.v1)\n- ALLMB ([Smith \u0026 Brown, 2018][13])        - [10.6084/m9.figshare.9747638](https://doi.org/10.6084/m9.figshare.9747638)\n- Open Tree ([Hinchliff et al.,2015][14])  - [10.6084/m9.figshare.9750509](https://doi.org/10.6084/m9.figshare.9750509)\n\n\n[1]: http://doi.org/10.1002/humu.20921\n[2]: http://doi.org/10.1371/journal.pone.0158391\n[3]: http://doi.org/10.1093/nar/gkr1178\n[4]: http://doi.org/10.1128/AEM.03006-05\n[5]: https://metacpan.org/release/Bio-Phylo-Forest-DBTree\n[6]: http://www.cpantesters.org/distro/B/Bio-Phylo-Forest-DBTree.html\n[7]: https://doi.org/10.5281/zenodo.1035856\n[8]: https://github.com/rvosa/bio-phylo-forest-dbtree\n[9]: https://metacpan.org/pod/distribution/App-cpanminus/bin/cpanm\n[10]: https://www.sqlite.org/index.html\n[11]: https://sqlitebrowser.org/\n[12]: http://evolution.genetics.washington.edu/phylip/newicktree.html\n[13]: https://doi.org/10.1002/ajb2.1019\n[14]: https://doi.org/10.1073/pnas.1423041112\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvosa%2Fbio-phylo-forest-dbtree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frvosa%2Fbio-phylo-forest-dbtree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvosa%2Fbio-phylo-forest-dbtree/lists"}