gneiss.plot.diamondtree¶
-
gneiss.plot.
diamondtree
(tree, **kwargs)[source]¶ Plots collapsed tree with background coloring and clade coloring.
This creates collapsed trees similar to the tree plots in the tree of life paper [1]. Rather than plotting all of the leaves, specified subtrees will be replaced by diamonds that are scaled to approximate the depth and the width of the subtree.
Parameters: - tree (skbio.TreeNode) – A strictly bifurcating tree defining a hierarchical relationship between all of the features within table.
- collapsed_nodes (list of str) – Names of internal nodes to collapse within the tree. (default : [])
- layout (function, optional) – A layout for formatting the tree visualization. Must take a ete.tree as a parameter. (default : None)
- labelcolor (str) – Color of the node labels. (default : ‘black’)
- bgcolors (dict of str or matplotlib colormap) – String or function encoding matplotlib colormap for the backgrounds outside of the clades. (default : None)
- cladecolors (dict of str or str) – String or function encoding matplotlib colormap for the colors within the clade faces. (default ‘#0000FF’)
- depth_scaling (int) – Scaling factor for height of the subtrees represented by diamonds. (default : 30)
- breadth_scaling (int) – Scaling factor for width of the subtrees represented by diamonds. (default : 6)
- label_size (int) – Size of nodes labels. (default : 10)
- mode (str) – Type of display to show the tree. (‘c’: circular, ‘r’: rectangular). (default : ‘c’)
Returns: - ete.Tree – ETE tree object that will be plotted.
- ete.TreeStyle – ETE TreeStyle that decorates the tree and heatmap visualization.
References
[1] Hug, Laura A., et al. “A new view of the tree of life.” Nature Microbiology 1 (2016): 16048.