PhyloTree.draw#
missionbio.plotting.phylotree.PhyloTree.draw
- PhyloTree.draw(palette: Optional[dict] = None, root: bool = True, layout: str = 'compact', compress: bool = True, fig: Optional[Figure] = None, row: Optional[int] = None, col: Optional[int] = None) Figure #
Create and draw the subclone tree graph.
- Parameters:
- palette: dict
Dictionary mapping the subclone name to the color.
- root: bool
Whether the root node should be included in the plot. If False, the root, and any edge connecting to the root are not drawn.
- layout: str
The layout of the tree. One of [“compact”, “depth-first”]. “compact” is the default structure which uses the Reingold-Tilford algorithm to create a compact tree. “depth-first” uses a depth-first search to create a tree, where every node is at a different x-position. This is useful for incoporating the phylogeny in other figures (like heatmaps) where each clone must be at a different x-position.
- compress: bool
Whether to compress the tree in the y direction.
- fig: plotly.graph_objs.figure
Plot figure object. If the width and height are not set then they will be modified to fit the tree. However, it assumes that the tree is the only subplot, therefore modifying them after adding calling graph.draw might be required. The minimum width and height to fit the tree alone can be obtained using graph.expected_fig_size. If the width and height both are already set then they are not modified.
- row: int
Row position if fig is specified.
- col: int
Col position if fig is specified.
- Returns:
- figplotly.graph_objs.figure
< Class PhyloTree