treetime/treeanc.py
def prune_short_branches(self):
        """
        If the branch length is less than the minimal value, remove the branch
        from the tree. **Requires** ancestral sequence reconstruction
        """
        self.logger("TreeAnc.prune_short_branches: pruning short branches (max prob at zero)...", 1)
        for node in self.tree.find_clades():
            if node.up is None or node.is_terminal():
                continue

            # probability of the two seqs separated by zero time is not zero
            if self.gtr.prob_t(node.up.cseq, node.cseq, 0.0,
                               pattern_multiplicity=self.multiplicity) > 0.1:
                # re-assign the node children directly to its parent
                node.up.clades = [k for k in node.up.clades if k != node] + node.clades
                for clade in node.clades:
                    clade.up = node.up
def prune_short_branches(self):
        """
        If the branch length is less than the minimal value, remove the branch
        from the tree. **Requires** ancestral sequence reconstruction
        """
        self.logger("TreeAnc.prune_short_branches: pruning short branches (max prob at zero)...", 1)
        for node in self.tree.find_clades():
            if node.up is None or node.is_terminal():
                continue

            # probability of the two seqs separated by zero time is not zero
            if self.gtr.prob_t(node.up.cseq, node.cseq, 0.0,
                               pattern_multiplicity=self.multiplicity) > 0.1:
                # re-assign the node children directly to its parent
                node.up.clades = [k for k in node.up.clades if k != node] + node.clades
                for clade in node.clades:
                    clade.up = node.up
def prune_short_branches ( self ) : self . logger ( "TreeAnc.prune_short_branches: pruning short branches (max prob at zero)..." , 1 ) for node in self . tree . find_clades ( ) : if node . up is None or node . is_terminal ( ) : continue # probability of the two seqs separated by zero time is not zero if self . gtr . prob_t ( node . up . cseq , node . cseq , 0.0 , pattern_multiplicity = self . multiplicity ) > 0.1 : # re-assign the node children directly to its parent node . up . clades = [ k for k in node . up . clades if k != node ] + node . clades for clade in node . clades : clade . up = node . up
If the branch length is less than the minimal value, remove the branch
        from the tree. **Requires** ancestral sequence reconstruction
If the branch length is less than the minimal value remove the branch from the tree . ** Requires ** ancestral sequence reconstruction