Carry out a cluster analysis based on the UPGMA algorithm (Sokal1958).
Parameters : | matrix : list or numpy.array
taxa : list
distances : bool
|
---|---|
Returns : | newick : str
|
Examples
Function is automatically imported when importing lingpy.
>>> from lingpy import *
Create an arbitrary list of taxa.
>>> taxa = ['German','Swedish','Icelandic','English','Dutch']
Create an arbitrary matrix.
>>> matrix = squareform([0.5,0.67,0.8,0.2,0.4,0.7,0.6,0.8,0.8,0.3])
Carry out the cluster analysis.
>>> upgma(matrix,taxa,distances=False)
'((Swedish,Icelandic),(English,(German,Dutch)));'