{"id":19234301,"url":"https://github.com/moshi4/phytreeviz","last_synced_at":"2025-03-17T07:15:41.782Z","repository":{"id":193254149,"uuid":"688400272","full_name":"moshi4/phyTreeViz","owner":"moshi4","description":"Simple phylogenetic tree visualization python package for phylogenetic analysis","archived":false,"fork":false,"pushed_at":"2024-09-14T02:59:31.000Z","size":2458,"stargazers_count":46,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-04T09:51:23.369Z","etag":null,"topics":["bioinformatics","biopython","matplotlib","phylogenetic-trees","python","visualization"],"latest_commit_sha":null,"homepage":"https://moshi4.github.io/phyTreeViz/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moshi4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-07T09:15:13.000Z","updated_at":"2025-02-09T08:10:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"31258134-e76b-4abe-9578-1d271b80ca13","html_url":"https://github.com/moshi4/phyTreeViz","commit_stats":{"total_commits":2,"total_committers":2,"mean_commits":1.0,"dds":0.5,"last_synced_commit":"183ec81cf1e0bc943a51aade5f42759dfe355a9e"},"previous_names":["moshi4/phytreeviz"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moshi4%2FphyTreeViz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moshi4%2FphyTreeViz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moshi4%2FphyTreeViz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moshi4%2FphyTreeViz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moshi4","download_url":"https://codeload.github.com/moshi4/phyTreeViz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243989731,"owners_count":20379648,"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","biopython","matplotlib","phylogenetic-trees","python","visualization"],"created_at":"2024-11-09T16:13:23.920Z","updated_at":"2025-03-17T07:15:41.764Z","avatar_url":"https://github.com/moshi4.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phyTreeViz\n\n![Python3](https://img.shields.io/badge/Language-Python3-steelblue)\n![OS](https://img.shields.io/badge/OS-_Windows_|_Mac_|_Linux-steelblue)\n![License](https://img.shields.io/badge/License-MIT-steelblue)\n[![Latest PyPI version](https://img.shields.io/pypi/v/phytreeviz.svg)](https://pypi.python.org/pypi/phytreeviz)\n[![conda-forge](https://img.shields.io/conda/vn/conda-forge/phytreeviz.svg?color=green)](https://anaconda.org/conda-forge/phytreeviz)\n[![CI](https://github.com/moshi4/phyTreeViz/actions/workflows/ci.yml/badge.svg)](https://github.com/moshi4/phyTreeViz/actions/workflows/ci.yml)\n\n## Table of contents\n\n- [Overview](#overview)\n- [Installation](#installation)\n- [API Usage](#api-usage)\n- [CLI Usage](#cli-usage)\n\n## Overview\n\nphyTreeViz is a simple and minimal phylogenetic tree visualization python package implemented based on matplotlib.\nThis package was developed to enhance phylogenetic tree visualization functionality of BioPython.\n\nphyTreeViz is intended to provide a simple and easy-to-use phylogenetic tree visualization function without complexity.\nTherefore, if you need complex tree annotations, I recommend using [ete](https://github.com/etetoolkit/ete) or [ggtree](https://github.com/YuLab-SMU/ggtree).\n\n## Installation\n\n`Python 3.8 or later` is required for installation.\n\n**Install PyPI package:**\n\n    pip install phytreeviz\n\n**Install conda-forge package:**\n\n    conda install -c conda-forge phytreeviz\n\n## API Usage\n\nOnly simple example usage is described in this section.\nFor more details, please see [Getting Started](https://moshi4.github.io/phyTreeViz/getting_started/) and [API Docs](https://moshi4.github.io/phyTreeViz/api-docs/treeviz/).\n\n### API Example\n\n#### API Example 1\n\n```python\nfrom phytreeviz import TreeViz, load_example_tree_file\n\ntree_file = load_example_tree_file(\"small_example.nwk\")\n\ntv = TreeViz(tree_file)\ntv.show_branch_length(color=\"red\")\ntv.show_confidence(color=\"blue\")\ntv.show_scale_bar()\n\ntv.savefig(\"api_example01.png\", dpi=300)\n```\n\n![example01.png](https://raw.githubusercontent.com/moshi4/phyTreeViz/main/docs/images/api_example01.png)  \n\n#### API Example 2\n\n```python\nfrom phytreeviz import TreeViz, load_example_tree_file\n\ntree_file = load_example_tree_file(\"small_example.nwk\")\n\ntv = TreeViz(tree_file, height=0.7)\ntv.show_scale_axis()\n\ntv.set_node_label_props(\"Homo_sapiens\", color=\"grey\")\ntv.set_node_label_props(\"Pongo_abelii\", color=\"green\", style=\"italic\")\n\ntv.set_node_line_props([\"Hylobates_moloch\", \"Nomascus_leucogenys\"], color=\"orange\", lw=2)\ntv.set_node_line_props([\"Homo_sapiens\", \"Pan_troglodytes\", \"Pan_paniscus\"], color=\"magenta\", ls=\"dotted\")\n\ntv.savefig(\"api_example02.png\", dpi=300)\n```\n\n![example02.png](https://raw.githubusercontent.com/moshi4/phyTreeViz/main/docs/images/api_example02.png)  \n\n#### API Example 3\n\n```python\nfrom phytreeviz import TreeViz, load_example_tree_file\n\ntree_file = load_example_tree_file(\"small_example.nwk\")\n\ntv = TreeViz(tree_file, align_leaf_label=True)\ntv.show_scale_axis()\n\ngroup1 = [\"Hylobates_moloch\", \"Nomascus_leucogenys\"]\ngroup2 = [\"Homo_sapiens\", \"Pan_paniscus\"]\n\ntv.highlight(group1, \"orange\")\ntv.highlight(group2, \"lime\")\n\ntv.annotate(group1, \"group1\")\ntv.annotate(group2, \"group2\")\n\ntv.marker(group1, marker=\"s\", color=\"blue\")\ntv.marker(group2, marker=\"D\", color=\"purple\", descendent=True)\ntv.marker(\"Pongo_abelii\", color=\"red\")\n\ntv.savefig(\"api_example03.png\", dpi=300)\n```\n\n![example03.png](https://raw.githubusercontent.com/moshi4/phyTreeViz/main/docs/images/api_example03.png)  \n\n#### API Example 4\n\n```python\nfrom phytreeviz import TreeViz, load_example_tree_file\nfrom matplotlib.patches import Patch\n\ntree_file = load_example_tree_file(\"medium_example.nwk\")\n\ntv = TreeViz(tree_file, height=0.3, align_leaf_label=True, leaf_label_size=10)\ntv.show_scale_bar()\n\ngroup1 = [\"Hylobates_moloch\", \"Nomascus_leucogenys\"]\ngroup2 = [\"Homo_sapiens\", \"Pongo_abelii\"]\ngroup3 = [\"Piliocolobus_tephrosceles\", \"Rhinopithecus_bieti\"]\ngroup4 = [\"Chlorocebus_sabaeus\", \"Papio_anubis\"]\n\ntv.highlight(group1, \"orange\", area=\"full\")\ntv.highlight(group2, \"skyblue\", area=\"full\")\ntv.highlight(group3, \"lime\", area=\"full\")\ntv.highlight(group4, \"pink\", area=\"full\")\n\ntv.link(group3, group4, connectionstyle=\"arc3,rad=0.2\")\n\nfig = tv.plotfig()\n\n_ = fig.legend(\n    handles=[\n        Patch(label=\"group1\", color=\"orange\"),\n        Patch(label=\"group2\", color=\"skyblue\"),\n        Patch(label=\"group3\", color=\"lime\"),\n        Patch(label=\"group4\", color=\"pink\"),\n    ],\n    frameon=False,\n    bbox_to_anchor=(0.3, 0.3),\n    loc=\"center\",\n    ncols=2,\n)\n\nfig.savefig(\"api_example04.png\", dpi=300)\n```\n\n![example04.png](https://raw.githubusercontent.com/moshi4/phyTreeViz/main/docs/images/api_example04.png)  \n\n## CLI Usage\n\nphyTreeViz provides simple phylogenetic tree visualization CLI.\n\n### Basic Command\n\n    phytreeviz -i [Tree file or text] -o [Tree visualization file]\n\n### Options\n\n    General Options:\n      -i IN, --intree IN      Input phylogenetic tree file or text\n      -o OUT, --outfile OUT   Output phylogenetic tree plot file [*.png|*.jpg|*.svg|*.pdf]\n      --format                Input phylogenetic tree format (Default: 'newick')\n      -v, --version           Print version information\n      -h, --help              Show this help message and exit\n\n    Figure Appearence Options:\n      --fig_height            Figure height per leaf node of tree (Default: 0.5)\n      --fig_width             Figure width (Default: 8.0)\n      --leaf_label_size       Leaf label size (Default: 12)\n      --ignore_branch_length  Ignore branch length for plotting tree (Default: OFF)\n      --align_leaf_label      Align leaf label position (Default: OFF)\n      --show_branch_length    Show branch length (Default: OFF)\n      --show_confidence       Show confidence (Default: OFF)\n      --dpi                   Figure DPI (Default: 300)\n\n    Available Tree Format: ['newick', 'phyloxml', 'nexus', 'nexml', 'cdao']\n\n### CLI Example\n\nClick [here](https://github.com/moshi4/phyTreeViz/raw/main/example/example.zip) to download example tree files.  \n\n#### CLI Example 1\n\n    phytreeviz -i \"((A,B),((C,D),(E,(F,G))));\" -o cli_example01.png\n\n![example01.png](https://raw.githubusercontent.com/moshi4/phyTreeViz/main/docs/images/cli_example01.png)  \n\n#### CLI Example 2\n\n    phytreeviz -i ./example/small_example.nwk -o cli_example02.png \\\n               --show_branch_length --show_confidence\n\n![example02.png](https://raw.githubusercontent.com/moshi4/phyTreeViz/main/docs/images/cli_example02.png)  \n\n#### CLI Example 3\n\n    phytreeviz -i ./example/medium_example.nwk -o cli_example03.png \\\n               --fig_height 0.3 --align_leaf_label \n\n![example03.png](https://raw.githubusercontent.com/moshi4/phyTreeViz/main/docs/images/cli_example03.png)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoshi4%2Fphytreeviz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoshi4%2Fphytreeviz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoshi4%2Fphytreeviz/lists"}