Skip to content

Clustering algorithms for phylogenetic reconstruction.

License

Notifications You must be signed in to change notification settings

pylogeny/cluster

Repository files navigation

PyloCluster

codecov PyPI

PyloCluster provides basic functionalities for distance-based clustering procedures in Python, including implementations of the Neighbor-joining and the UPGMA algorithm for phylogenetic reconstruction.

Installation

$ pip install pylocluster

Usage

The following examples requires the python-newick package.

>>> from pylocluster import *
>>> from newick import loads
>>> matrix = squareform([0.5,0.67,0.8,0.2,0.4,0.7,0.6,0.8,0.8,0.3])
>>> nwk = linkage(matrix, taxa=['G', 'S', 'I', 'E', 'D'], method='upgma')
>>> print(loads(nwk).ascii_art())
        ┌─S
    ┌───┤
    │   └─I
────┤
    │   ┌─E
    └───┤
        │   ┌─G
        └───┤
            └─D

About

Clustering algorithms for phylogenetic reconstruction.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages