예제 #1
0
from pylogeny.tree import tree  # import tree class definition

t = tree("(10,((11,(4,(1,(3,2)))),(9,((5,6),(8,7)))));"
         )  # instantiate with this Newick string
#print t
topo = t.toTopology()  # converts a tree to a rich object of branches and nodes

rearrList = topo.allSPR()  # a list of rearrangement objects
for rearr in rearrList:
    move = rearr.doMove(
    )  # perform the rearrangement and get a topology object
    print move  # prints the Newick string for this topology

    #foo(move)                # do something with this topology
예제 #2
0
 def test_tree_initNoCheck(self):
     t = tree(self.tree_.getNewick(), check=False)
     self.assertTrue(type(t) == tree)
     self.assertEqual(t.newick, self.tree_.getNewick())
예제 #3
0
 def test_tree_init(self):
     t = tree(self.tree_.getNewick(), check=True)
     self.assertTrue(type(t) == tree)
예제 #4
0
# From Ishrat Jahan of UIU

from pylogeny.tree import tree  # import tree class definition

t = tree(
    "(GAL,(ORN,((MAC,MON),(((CHO,DAS),(ECH,(LOX,PRO))),(((TUP,((ORY,OCH),(SPE,(CAV,(DIP,(MUS,RAT)))))),((OTO,MIC),(TAR,(CAL,(NEW,(PON,(GOR,(PAN,HOM)))))))),((SOR,ERI),((MYO,PTE),(((FEL,CAN),(VIC,(SUS,(TUR,BOS)))),EQU))))))));"
)  # instantiate with this Newick string
#print t
topo = t.toTopology()  # converts a tree to a rich object of branches and nodes

rearrList = topo.allSPR()  # a list of rearrangement objects
for rearr in rearrList:
    move = rearr.doMove(
    )  # perform the rearrangement and get a topology object
    print(move)  # prints the Newick string for this topology

    #foo(move)                # do something with this topology
예제 #5
0
 def test_tree_initNoCheck(self):
     t = tree(self.tree_.getNewick(),check=False)
     self.assertTrue(type(t) == tree)
     self.assertEqual(t.newick,self.tree_.getNewick())
예제 #6
0
 def test_tree_init(self):
     t = tree(self.tree_.getNewick(),check=True)
     self.assertTrue(type(t) == tree)