-
Notifications
You must be signed in to change notification settings - Fork 17
Home
Niema Moshiri edited this page Jul 19, 2024
·
7 revisions
TreeSwift is a Python package for efficiently traversing and manipulating ultra-large phylogenetic trees. It should support all versions of Python 3.
TreeSwift can be installed using pip:
sudo pip install treeswiftIf you are using a machine on which you lack administrative powers, TreeSwift can be installed locally using pip:
pip install --user treeswiftTypical usage should be as follows:
- Import the
treeswiftpackage - Use
treeswift.read_tree_newickto load your Newick tree - Use the various
Treeclass 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)For more examples, take a look at the Cookbook. Full documentation can be found at: https://niema.net/TreeSwift
Niema Moshiri 2018