#!/usr/bin/python #from PIPRes.util.cipres import * from PIPRes.cipres_types import * nameContext = initOrbAndGetNameService(sys.argv) treeRefiner = nameContext.getServiceOrExit(CipresIDL_api1.TreeRefine) try: cipresTree = CipresTree('(1:0.089964,2:0.050264,3:0.034803,4:0.055375)') print 'startingTree = ', cipresTree corbaTree = cipresTree.createCorbaType() rMat = CipresDiscreteMatrix([ 'ACGT', 'ACAT', 'ACGT', 'ACAT', ], datatype = CipresIDL_api1.DNA_DATATYPE) print 'about to set matrix' treeRefiner.setMatrix(rMat) print 'about to set tree', corbaTree.m_newick treeRefiner.setTree(corbaTree) print 'about to refineTree' for i in range(1000): returnedTree = treeRefiner.refineTree() print 'returnedTree = ', returnedTree.m_newick finally: treeRefiner.remove()