Documentation
¶
Overview ¶
Package tree provides a struct and functions that allow for creating binary trees modifying them, and doing calculations on them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Draw ¶
Draw prints a tree to as an image. The function takes a pointer to the root of the tree along with the desired height and width of the output image.
func Height ¶
Height returns the maximum cumulative branch length from the input tree node to a leaf node.
func ToString ¶
ToString takes a pointer to the root of a tree and returns that tree as a text representation of the tree in newick format.
func WriteNewick ¶
WriteNewick takes a filename and a pointer to the root of a tree. It writes the tree to the file in newick format.
Types ¶
type Tree ¶
A Tree is a node in a binary tree
func ParseDot ¶
ParseDot takes in the filename of a filename of a tree in "dot" format and a verbose flag that can be used to print debugging info. ParseDot returns a pointer to the root node of the tree.
func ParseNewick ¶
ParseNewick takes a newick tree as an input string and returns a pointer to the root of the tree.
func ReadNewick ¶
ReadNewick takes a filename of a newick tree as input and returns a pointer to the root of the tree.