gneiss.plot.heatmap

gneiss.plot.heatmap(table, tree, mdvar, highlights=None, cmap=’viridis’, linewidth=0.5, grid_col=’w’, grid_width=2, highlight_width=0.02, figsize=(5, 5))[source]

Creates heatmap plotting object

Parameters:
  • table (pd.DataFrame) – Contain sample/feature labels along with table of values. Rows correspond to samples, and columns correspond to features.
  • tree (skbio.TreeNode) – Tree representing the feature hierarchy.
  • highlights (pd.DataFrame or dict of tuple of str) – List of internal nodes in the tree to highlight. Each internal node must contain two colors, one for the left subtree and the other for the right subtree highlight. The first color will always correspond to the left subtree, and the second color will always correspond to the right subtree.
  • cmap (str) – Specifies the matplotlib colormap for the heatmap (default=’viridis’)
  • linewidth (int) – Width of dendrogram lines.
  • mdvar (pd.Series) – Metadata values for samples. The index must correspond to the index of table.
  • highlight_width (int) – Width of highlights. (default=0.02)
  • grid_col (str) – Color of vertical lines for highlighting sample metadata. (default=’w’)
  • grid_width (int) – Width of vertical lines for highlighting sample metadata. (default=2)
  • figsize (tuple of int) – Species (width, height) for figure. (default=(5, 5))
Returns:

Matplotlib figure object

Return type:

matplotlib.pyplot.figure

Note

The highlights parameter assumes that the tree is bifurcating.