{ "info": { "author": "Simon J. Greenhill", "author_email": "simon@simon.net.nz", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Bio-Informatics", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# treemaker\n\nA Python library for creating a Newick formatted tree from a set of classification strings (e.g. a taxonomy)\n\n[![Build Status](https://travis-ci.org/SimonGreenhill/treemaker.svg?branch=master)](https://travis-ci.org/SimonGreenhill/treemaker)\n[![Coverage Status](https://coveralls.io/repos/SimonGreenhill/treemaker/badge.svg?branch=master&service=github)](https://coveralls.io/github/SimonGreenhill/treemaker?branch=master)\n[![DOI](https://zenodo.org/badge/22704/SimonGreenhill/treemaker.svg)](https://zenodo.org/badge/latestdoi/22704/SimonGreenhill/treemaker)\n[![status](http://joss.theoj.org/papers/19eae6958062fc8a72d8a02efdaf8b23/status.svg)](http://joss.theoj.org/papers/19eae6958062fc8a72d8a02efdaf8b23)\n\n```treemaker``` is a Python library to convert a text-based classification schema into a Newick file for use in phylogenetic and bioinformatic programs.\n\nResearch in linguistics or cultural evolution often produces or uses tree taxonomies or classifications. However, these are usually not in a format readily available for use in programs that can understand and manipulate trees. For example, the global taxonomy of languages published by the [Ethnologue](https://www.ethnologue.com/) classifies languages into families and subgroups using a taxonomy string e.g. the language [Kalam](https://www.ethnologue.com/language/kmh) is classified as \"Trans-New Guinea, Madang, Kalam-Kobon\", while [Mauwake](https://www.ethnologue.com/language/mhl) is classified as \"Trans-New Guinea, Madang, Croisilles, Pihom\", and [Kare](https://www.ethnologue.com/language/kmf) is \"Trans-New Guinea, Madang, Croisilles, Kare\". This classification indicates that while all these languages are part of the Madang subgroup of the Trans-New Guinea language family, Kare and Mauwake are more closely related (as they belong to the Croisilles subgroup).\n\nOther publications use a tabular indented format to demarcate relationships, such as the example in Figure 1 from Stephen Wurm's classification of his proposed Yele-Solomons language phylum (Wurm 1975).\n\nBoth the taxonomy string and tabular format however are hard to load into software packages that can analyse, compare, visualise and manipulate trees. ```treemaker``` aims to make this easy by converting taxonomic data into [Newick](https://en.wikipedia.org/wiki/Newick_format) and Nexus (Maddison 1997) formats commonly used by phylogenetic manipulation programs.\n\n## Converting a Taxonomy to a Tree:\n\n```treemaker``` can convert a text file with a taxonomy to a tree. These taxonomies can easily be obtained from Ethnologue or manually entered, such as this example from Wurm's (outdated) classification of Yele-Solomons in Figure 1:\n\n```text\nBilua Yele-Solomons, Central Solomon\nBaniata Yele-Solomons, Central Solomon\nLavukaleve Yele-Solomons, Central Solomon\nSavosavo Yele-Solomons, Central Solomon\nKazukuru Yele-Solomons, Kazukuru\nGuliguli Yele-Solomons, Kazukuru\nDororo Yele-Solomons, Kazukuru\nYele Yele-Solomons\n```\n\n``treemaker`` can then generate a Newick representation:\n\n```text\n((Baniata,Bilua,Lavukaleve,Savosavo),(Dororo,Guliguli,Kazukuru),Yele);\n```\n\n...which can then be loaded into phylogenetic programs to visualise or manipulate as in Figure 2.\n\n```treemaker``` has been used to enable the analyses in (Bromham et al. 2018), and a number of forthcoming articles.\n\n\n![Example of a language taxonomy in indented format from Wurm (1975).](wurm1975.png)\n\n![Tree visualisation of the relationships between the putative Yele-Solomons languages.](tree.png)\n\n\n## Installation:\n\nInstallation is only a pip install away:\n\n```shell\npip install treemaker\n```\n\nOr from git:\n\n```shell\ngit clone https://github.com/SimonGreenhill/treemaker/ treemaker\ncd treemaker\npython setup.py install\n```\n\n## Usage: Command line:\n\nBasic usage: \n\n```shell\n> treemaker\n\nusage: treemaker [-h] [-o OUTPUT] [-m {nexus,newick}] [--labels] input\n```\n\ne.g. Given a text file:\n\n```\nLangA Indo-European, Germanic\nLangB Indo-European, Germanic\nLangC Indo-European, Romance\nLangD Indo-European, Anatolian\n```\n\n... then you can build a taxonomy/classification tree from that as follows:\n\n```shell\n> treemaker classification.txt\n(LangD,(LangA,LangB),LangC);\n\n# with nodelabels:\n> treemaker --labels classification.txt\n(LangD,(LangA,LangB)Germanic,LangC)Indo-European;\n\n> treemaker -m nexus classification.txt\n\n#NEXUS\n\nbegin trees;\n tree root = (LangD,(LangA,LangB),LangC);\nend;\n```\n\nTo write to file:\n\n```shell\n> treemaker classification.txt\n(LangD,(LangA,LangB),LangC);\n\n> treemaker classification.txt -o classification.nex\n```\n\n\n## Usage: Library:\n\n```python\nfrom treemaker import TreeMaker\n```\n\n### generate a tree manually:\n\n```python\nfrom treemaker import TreeMaker\n\nt = TreeMaker()\nt.add('A1', 'family a, subgroup 1')\nt.add('A2', 'family a, subgroup 2')\nt.add('B1a', 'family b, subgroup 1')\nt.add('B1b', 'family b, subgroup 1')\nt.add('B2', 'family b, subgroup 2')\n\nprint(t.write())\n```\n\n### Add from a list:\n\n```python\nfrom treemaker import TreeMaker\n\ntaxa = [\n ('A1', 'family a, subgroup 1'),\n ('A2', 'family a, subgroup 2'),\n ('B1a', 'family b, subgroup 1'),\n ('B1b', 'family b, subgroup 1'),\n ('B2', 'family b, subgroup 2'),\n]\n\nt = TreeMaker()\nt.add_from(taxa)\n\nprint(t.write())\n\n```\n\n## API Documentation:\n\nThe API is [documented here](https://simongreenhill.github.io/treemaker/build/html/index.html).\n\n## Running treemaker's tests:\n\nTo run treemaker's tests simply run:\n\n```shell\n> make test\n# or\n> python setup.py test\n# or\n> python treemaker/test_treemaker.py\n```\n\n\n## Version History:\n\n* v1.3: add nodelabels support, add some rudimentary input checking.\n\n## Support:\n\nFor questions on how to use or update this, feel free to [open an issue](https://github.com/SimonGreenhill/treemaker/issues). I'll get to it as soon as I can. \n\n## References:\n\n* Bromham, Lindell, Xia Hua, Marcel Cardillo, Hilde Schneemann, & Simon J. Greenhill. 2018. \u201c[Parasites and Politics: Why Cross-Cultural Studies Must Control for Relatedness, Proximity and Covariation](https://doi.org/10.1098/rsos.181100).\u201d Open Science 5 (8). https://doi.org/10.1098/rsos.181100.\n* Maddison, D R, D L Swofford, & Wayne P. Maddison. 1997. \u201c[Nexus: An Extensible File Format for Systematic Information](https://doi.org/10.1093/sysbio/46.4.590).\u201d Systematic Biology 46 (4): 590\u2013621. https://doi.org/10.1093/sysbio/46.4.590.\n* Wurm, S. A. 1975. \u201c[The East Papuan Phylum in General](https://doi.org/http://dx.doi.org/10.15144/PL-C38).\u201d In New Guinea Area Languages and Language Study: Papuan Languages and the New Guinea Linguistic Scene, edited by S. A. Wurm. Canberra: Pacific Linguistics. https://doi.org/http://dx.doi.org/10.15144/PL-C38.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SimonGreenhill/treemaker", "keywords": "phylogenetics newick taxonomy", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "treemaker", "package_url": "https://pypi.org/project/treemaker/", "platform": "", "project_url": "https://pypi.org/project/treemaker/", "project_urls": { "Homepage": "https://github.com/SimonGreenhill/treemaker" }, "release_url": "https://pypi.org/project/treemaker/1.3/", "requires_dist": null, "requires_python": "", "summary": "A python tool for generating a Newick formatted tree from alist of classifications", "version": "1.3" }, "last_serial": 5547086, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "c0c4698fcd2bd869fd3bd8ce8a040f6c", "sha256": "7994fb84a9edee15989a6dc92234b43b80b01d8179b686c6193b04a647845021" }, "downloads": -1, "filename": "treemaker-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c0c4698fcd2bd869fd3bd8ce8a040f6c", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 7776, "upload_time": "2016-02-26T00:19:16", "url": "https://files.pythonhosted.org/packages/71/2b/ba7fa976dbc23326e7bb40088045996a0b6cbe500bbbb1d917cf99326cb0/treemaker-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5c1c93f20539b302c60d84198d491318", "sha256": "24a78633fb3575d7a406192d49c5ed74bae10b47cc06662c003ae46f6b57779d" }, "downloads": -1, "filename": "treemaker-1.0.tar.gz", "has_sig": false, "md5_digest": "5c1c93f20539b302c60d84198d491318", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6638, "upload_time": "2016-02-26T00:19:07", "url": "https://files.pythonhosted.org/packages/3c/c3/97d1f784f47d7a55ee75a1918988dba992a7c72490a7f23d667229e57402/treemaker-1.0.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "ed9ab88a2ad85ea2b1f9bde25c26c564", "sha256": "13fda907ccf7e33d13ef8ce5b12c99cdf4b4352310ae3bd386e39a554937dd86" }, "downloads": -1, "filename": "treemaker-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ed9ab88a2ad85ea2b1f9bde25c26c564", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 7273, "upload_time": "2018-09-27T11:19:55", "url": "https://files.pythonhosted.org/packages/59/43/c77ea7ea3ec428f703585b7d08c986234d0c96ef30f6070ee30924a5e81d/treemaker-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9594fb52182db16fb9139a8e64fd3307", "sha256": "9798d48ab1c02092b5dc4c254457ab20941e94c4222f7802ecc39f4dfbf45866" }, "downloads": -1, "filename": "treemaker-1.0.3.tar.gz", "has_sig": false, "md5_digest": "9594fb52182db16fb9139a8e64fd3307", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7433, "upload_time": "2018-09-27T11:19:53", "url": "https://files.pythonhosted.org/packages/a6/f3/689a7ccb001ece57408a09a73fc3e0156ceabb4e66e5beab02c3b235f6cc/treemaker-1.0.3.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "499e4af6333362e2a92e690f22c9cbb5", "sha256": "4c154ade0b9f5bd1388fa22ca8ef881b57b9b7f25564c2b3325b38b3158abcce" }, "downloads": -1, "filename": "treemaker-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "499e4af6333362e2a92e690f22c9cbb5", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 7705, "upload_time": "2016-09-05T12:28:01", "url": "https://files.pythonhosted.org/packages/6c/42/07735ba9a0489b8d3bd7b6790c669153f55c40195e918ef3c07162c95697/treemaker-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b9039c82bc975868cfe1f901d4e09d97", "sha256": "f26b28a8effd759b4e187f7e10213b1c48b84c4bcd849f6acf5c96ff5c18ee80" }, "downloads": -1, "filename": "treemaker-1.1.tar.gz", "has_sig": false, "md5_digest": "b9039c82bc975868cfe1f901d4e09d97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6726, "upload_time": "2016-09-05T12:27:58", "url": "https://files.pythonhosted.org/packages/d2/35/d8af9036d663ef3a39767ee5fe4fe0aaaafb9c58173d97b22b6cd7e17de4/treemaker-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "94a4da442f795e5332629a29ead53f12", "sha256": "6b339c66dd2810df8503cc3f5903c3c7b62bfac42b188470d225e587fb614437" }, "downloads": -1, "filename": "treemaker-1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "94a4da442f795e5332629a29ead53f12", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 10666, "upload_time": "2018-11-08T10:04:12", "url": "https://files.pythonhosted.org/packages/bd/9f/3d30925ab0a56ad46d1c56effe85d3a105d6a80489db7d1efe5e8264f9f4/treemaker-1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "618b080571626d246957f096a46d7d2b", "sha256": "a79d236632424c9fa92a352fd3253d839f4814011da1bec6c2bbaa0085023db5" }, "downloads": -1, "filename": "treemaker-1.2.tar.gz", "has_sig": false, "md5_digest": "618b080571626d246957f096a46d7d2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14189, "upload_time": "2018-11-08T10:04:10", "url": "https://files.pythonhosted.org/packages/a2/70/cd39cd9879a334438016701da072d3b1cc36c2fbbea3377b587b08700d5b/treemaker-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "1705f3b8092b44b1653046d472cae9c6", "sha256": "2e6bc01d49f6e08a505ebe4294e2acd7c903b4aaa5a61a5aaf9fa949d49fb35b" }, "downloads": -1, "filename": "treemaker-1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1705f3b8092b44b1653046d472cae9c6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11183, "upload_time": "2019-07-17T18:10:09", "url": "https://files.pythonhosted.org/packages/5d/97/6edaae049be41dc908594af8f35e1f1b6c23a42586cf67d063d25509859c/treemaker-1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "47c166561d9f0018352d9cacd2caa450", "sha256": "30a2c2ca29e947bd80a84a9bb98e6bf1f108a7f85c6bbbbeb8d0b600da7b5034" }, "downloads": -1, "filename": "treemaker-1.3.tar.gz", "has_sig": false, "md5_digest": "47c166561d9f0018352d9cacd2caa450", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14874, "upload_time": "2019-07-17T18:10:11", "url": "https://files.pythonhosted.org/packages/5d/41/a12d35c3633fbff117409320474efc4822c0f6bc7ea3c65f662c0aa42d05/treemaker-1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1705f3b8092b44b1653046d472cae9c6", "sha256": "2e6bc01d49f6e08a505ebe4294e2acd7c903b4aaa5a61a5aaf9fa949d49fb35b" }, "downloads": -1, "filename": "treemaker-1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1705f3b8092b44b1653046d472cae9c6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11183, "upload_time": "2019-07-17T18:10:09", "url": "https://files.pythonhosted.org/packages/5d/97/6edaae049be41dc908594af8f35e1f1b6c23a42586cf67d063d25509859c/treemaker-1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "47c166561d9f0018352d9cacd2caa450", "sha256": "30a2c2ca29e947bd80a84a9bb98e6bf1f108a7f85c6bbbbeb8d0b600da7b5034" }, "downloads": -1, "filename": "treemaker-1.3.tar.gz", "has_sig": false, "md5_digest": "47c166561d9f0018352d9cacd2caa450", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14874, "upload_time": "2019-07-17T18:10:11", "url": "https://files.pythonhosted.org/packages/5d/41/a12d35c3633fbff117409320474efc4822c0f6bc7ea3c65f662c0aa42d05/treemaker-1.3.tar.gz" } ] }