Exemple #1
0
 def test_upgma_cluster(self):
     """UPGMA_cluster clusters nodes based on info in a matrix with UPGMA"""
     matrix = self.matrix
     node_order = self.node_order
     large_number = 9999999999
     tree = UPGMA_cluster(matrix, node_order, large_number)
     self.assertEqual(
         str(tree),
         "(((a:0.5,b:0.5):1.75,c:2.25):5.875,(d:1.0,e:1.0):7.125);")
Exemple #2
0
 def test_UPGMA_cluster_diag(self):
     """UPGMA_cluster works when the diagonal has intermediate values"""
     # test that checking the diagonal works
     matrix = self.matrix_five
     node_order = self.node_order
     large_number = 9999999999
     tree = UPGMA_cluster(matrix, node_order, large_number)
     self.assertEqual(
         str(tree),
         "(((a:0.5,b:0.5):1.75,c:2.25):5.875,(d:1.0,e:1.0):7.125);")