7.0 Summarizing tree topologies

(Win version)

< 6.0 | 7.0 | 7.1 >

In this part, you will learn how to summarize trees in terms of their component splits. By the end of this section, your program will read a tree file and report all unique tree topologies and the number of trees having each topology. You will also install the Nexus Class Library in order to read NEXUS-formatted tree files.

A split is a partition that divides the leaves of a tree into two subsets. There is one split associated with every edge in a tree: if that edge is cut, two subtrees are produced and the leaves in each of these subtrees represent the two subsets composing the split. In practice, we will think of a split as the set of leaves in the subtree distal from the root. Thus, splits are only useful if they are all defined using the same root position.

A Split class will store the set of leaves that descend from a given node. A tree topology can be identified by the set of splits it contains. A tree ID is thus the set of splits in a tree. Because trees with identical tree IDs have identical topologies, we can use tree IDs to determine how many unique topologies there are for any set of trees having the same leaf set.

Step Title Description
Step 7.1 The Split class

The Split class provides an object that can store the set of taxa that represent descendants of a given Node object. We will provide a Split object for every Node.

Step 7.2 Adding splits to Node and TreeManip

Before we can do anything interesting with our Split class, we need to add a Split object to the Node class and a storeSplits member function to the TreeManip class.

Step 7.3 The TreeSummary class

The TreeSummary class will read a tree file, keep track of the number of distinct tree topologies found therein, and count the number of trees having each unique topology.

Step 7.4 Test the TreeSummary class

To test the TreeSummary class, we need for the main function to create a TreeSummary object and call its readTreeFile and showSummary functions. We also need a tree file to read, and need to link in the Nexus Class Library to do the work of parsing this tree file.

< 6.0 | 7.0 | 7.1 >