def run(self):
     nt = newickTreeParser(self.options.inputNewick, 0.0)
     if nt.distance == 0:
         self.addChildTarget(Tree(lsc.tree2str(nt.left), self.options.parentDir,  
                                  'left', self.options))
         self.addChildTarget(Tree(lsc.tree2str(nt.right), self.options.parentDir, 
                                  'right', self.options))
     else:
         self.addChildTarget(Tree(lsc.tree2str(nt), self.options.parentDir, 
                                  'stem', self.options))
 def run(self):
     logger.info('TreeFollow object running, %s' % self.thisGrandParentDir)
     nt = newickTreeParser(self.thisNewickStr, 0.0)
     name = lsc.nameTree(nt)
     commonParentDir = os.path.abspath(os.path.join(self.options.simDir, name))
     if nt.distance == 0:
         if nt.internal:
             # branch point
             branches = { 'left' : lsc.tree2str(nt.left),
                          'right': lsc.tree2str(nt.right) }
             for b in branches:
                 if not lsc.nodeIsLeaf(branches[b]):
                     self.addChildTarget(Tree(branches[b], commonParentDir, b, self.options))
                     childDir = lsc.treeStr2Dir(lsc.takeNewickStep(branches[b], self.options)[0], 
                                                 self.options.simDir)
         else:
             # follow up to leaf cycles... Transalign and Stats only
             self.setFollowOnTarget(LeafCleanUp(commonParentDir, 
                                                self.thisGrandParentDir, self.options))
     else:
         # stem with distance
         self.addChildTarget(Tree(lsc.tree2str(nt), commonParentDir, 'stem', self.options))
         childDir = lsc.treeStr2Dir(lsc.takeNewickStep(lsc.tree2str(nt), self.options)[0], 
                                     self.options.simDir)