Simple example of Tree construction

Alignment:

1 ATTGCCG
2 AATGCCG
3 TTAAGGG
4 TTAAAGG
5 TCAAGGG

Distance table (matrix):

Let the distance between two genes be the number of mismatches (mutations).
Then the distance matrix is:
 
   1 2 3 4 5
1 0        
2 1 0      
3 5 6 0    
4 5 6 1 0  
5 6 6 1 2 0

Apply UPGMA:

1. Several pairs have distance 1. Select (arbitrarily) pair (1,2). Result:
 
  1,2 3 4 5
1,2 0      
3 5.5 0    
4 5.5 1 0  
5 6 1 2 0

2. Select 3,4 as one of the pairs with minimum value. Result:
 
  1,2 3,4 5
1,2 0    
3,4 5.5 0  
5 6 1.5 0

3. Now the minimum is (3,4),5. Result:
  1,2 (3,4),5
1,2 0  
(3,4),5 5.67 0

The distance between (1,2) and ((3,4),5) was calculated as the weighted average of the distance between (1,2) and 5 (which is 6) and the distance between (1,2) and (3,4) which is 5.5. Weighting each by the number of nodes below we get (2*5.5+1*6)/3=5.67. See equation 9.2 on page 55 in the booklet.

Note that if we had used WPGMA, the distance beween (1,2) and ((3,4),5) would simply have been (5.5+6)/2=5.75 which would effectively have given the same weight to the distance between (1,2) and 5 and that between (1,2) and (3,4) meaning that sequence 5 has more influence than each of the sequences 3 and 4.

Now the lowest pair is (1,2), ((3,4),5). The resulting tree is (edge lengths not proportional to number of mutations):