基于距离的语言系统进化聚类方法
项目描述
PyloCluster
PyloCluster为Python中基于距离的聚类过程提供基本功能,包括邻接法和UPGMA算法的进化重建实现。
安装
$ pip install pylocluster
用法
以下示例需要python-newick包。
>>> 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