def __init__(self, thisNewickStr, thisParentDir, thisStepLength, options):
     Target.__init__(self)
     self.thisNewickStr = thisNewickStr
     self.thisParentDir = thisParentDir
     self.thisStepLength  = thisStepLength
     self.options = options
     self.thisDir = lsc.treeStr2Dir(self.thisNewickStr, options.simDir)
     self.theChild  = os.path.basename(self.thisDir)
     self.theParent = os.path.basename(self.thisParentDir)
 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)