def getNewick(node, newick, parentdist, leaf_names):
    if node.is_leaf():
        return '%s:%.2f%s' % (leaf_names[node.id], parentdist - node.dist,
            newick)
Save dendrogram to newick format