目录

TreeSwift

TreeSwift is a pure Python library for parsing, manipulating, and iterating over (rooted) tree structures. TreeSwift places an emphasis on speed.

We strongly recommend that you consider our new package, CompactTree (a header-only C++ library that has a Python package wrapper with similar functionality as TreeSwift), though we will continue maintaining TreeSwift in parallel with CompactTree.

Installation

TreeSwift can be installed using pip:

sudo pip install treeswift

If you are using a machine on which you lack administrative powers, TreeSwift can be installed locally using pip:

pip install --user treeswift

Usage

Typical usage should be as follows:

  1. Import the treeswift package
  2. Use treeswift.read_tree_newick to load your Newick tree
  3. Use the various Tree class functions on the resulting object as you need
import treeswift
tree = treeswift.read_tree_newick(my_newick_string)
for node in tree.traverse_postorder():
    print(node)

Full documentation can be found at https://niema.net/TreeSwift, and more examples can be found in the TreeSwift Wiki.

Citing TreeSwift

If you use TreeSwift in your work, please cite:

Moshiri N (2020). “TreeSwift: a massively scalable Python package for trees.” SoftwareX. 11:100436. doi:10.1016/j.softx.2020.100436

关于

用于高效处理和分析系统发育树的Python库

1.3 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号