Tree.make_color_tree

Make a color tree, given a list of cluster labels. [source]
Parameters:
inner_node_dict : dict
  Dictionary with all inner node connections.

leaf_dict :
dict
  Dictionary with all leaf node connections to their respective inner nodes.

cluster_label_dict :
dict
  A dictionary with leaf labels as keys and leaf labels as leafs.
Returns:
g : dot
  Dot with the color tree structure. Dot is a graphviz output (learn how to setup graphviz here).
Outputs:
color_tree : png
  An image with the tree present inside the 'g' dot variable.
See also:
tree.make_tree
 Search for the best tree of a given distance matrix.

tree.make_clusters
 Make any given number of clusters, given a respective tree.

Example:

# Imports
from zgli.tree import make_clusters, make_color_tree

# Make Clusters
cluster_labels, cluster_label_dict = make_clusters(5, 'complete', leaf_dict, inner_node_dict, dm, leaf_labels, 10, True)

# Use clusters to make color tree
dot = make_color_tree(inner_node_dict, leaf_dict, cluster_label_dict)