예제 #1
0
 def testUpgmaFitch(self):
     fitchTree = hw.upgma(hw.fitchList, hw.fitchMatrix)
     testFitchTree = (17.6, ('moth', (), ()),
                      (14.5, ('tuna', (), ()),
                       (9.0, (0.5, ('man', (), ()), ('monkey', (), ())),
                        (4.0, ('turtle', (), ()), ('chicken', (), ())))))
     self.assertTrue(isomorphic(fitchTree, testFitchTree),
                     "Incorrect fitch tree")
예제 #2
0
 def testUpgmaCarnivores(self):
     carnivoresTree = hw.upgma(hw.carnivoresList, hw.carnivoresMatrix)
     testCarnivoresTree = (45.375, ('cat', (), ()),
                           (21.666666666666664, ('dog', (), ()),
                            (18.25, ('seal', (), ()),
                             (13.0, ('bear', (), ()), ('raccoon', (),
                                                       ())))))
     self.assertTrue(isomorphic(carnivoresTree, testCarnivoresTree),
                     "Incorrect carnivores tree")
예제 #3
0
 def testUpgmaHumans(self):
     humansTree = hw.upgma(hw.humansList, hw.humansMatrix)
     testHumansTree = (0.0026804, ('San', (), ()),
                       (0.0023785, ('Kikuyu', (), ()),
                        (0.0010831666666666665, ('Yoruba', (), ()),
                         (0.0009215, ('Han', (), ()),
                          (0.000656, ('Finnish', (), ()), ('Papuan', (),
                                                           ()))))))
     self.assertTrue(isomorphic(humansTree, testHumansTree),
                     "Incorrect humans tree")
예제 #4
0
 def testUpgmaNeand(self):
     neandTree = hw.upgma(hw.neandList, hw.neandMatrix)
     testNeandTree = (0.0447688, ('Chimpanzee', (), ()),
                      (0.00571225, ('Neanderthal', (), ()),
                       (0.0026615, ('San', (), ()),
                        (0.00110925, ('Yoruba', (), ()),
                         (0.000656, ('Finnish', (), ()), ('Kostenki', (),
                                                          ()))))))
     self.assertTrue(isomorphic(neandTree, testNeandTree),
                     "Incorrect neand tree")
예제 #5
0
 def testUpgmaGroodies(self):
     groodiesTree = hw.upgma(hw.groodiesList, hw.groodiesMatrix)
     testGroodiesTree = (6.0, ('Snoody', (), ()), (3.5, ('Groody', (), ()),
                                                   ('Froody', (), ())))
     self.assertTrue(isomorphic(groodiesTree, testGroodiesTree),
                     "Incorrect groodies tree")