def test_limited_wls(self): """testing (well, exercising at least), wls with constrained start""" init = make_tree(treestring="((a,c),b,d)") reconstructed = wls(self.dists, start=init, show_progress=False) self.assertEqual(len(reconstructed.get_tip_names()), 6) init2 = make_tree(treestring="((a,d),b,c)") reconstructed = wls(self.dists, start=[init, init2], show_progress=False) self.assertEqual(len(reconstructed.get_tip_names()), 6) init3 = make_tree(treestring="((a,d),b,z)") self.assertRaises(Exception, wls, self.dists, start=[init, init3]) # if start tree has all seq names, should raise an error self.assertRaises( Exception, wls, self.dists, start=[make_tree(treestring="((a,c),b,(d,(e,f)))")], )
def test_truncated_wls(self): """testing wls with order option""" order = ["e", "b", "c", "d"] reconstructed = wls(self.dists, order=order, show_progress=False) self.assertEqual(set(reconstructed.get_tip_names()), set(order))
def test_wls(self): """testing wls""" reconstructed = wls(self.dists, a=4, show_progress=False) self.assertTreeDistancesEqual(self.tree, reconstructed)
def test_wls(self): """testing wls""" reconstructed = wls(self.dists, a=4) self.assertTreeDistancesEqual(self.tree, reconstructed)