Logo Search packages:      
Sourcecode: python-biopython version File versions  Download package

def Bio.Nexus.Nodes.Chain.collapse (   self,
  id 
) [inherited]
Deletes node from chain and relinks successors to predecessor: collapse(self, id).

Definition at line 53 of file Nodes.py.

References Bio.Nexus.Nodes.Chain.chain, and Bio.Nexus.Nodes.Chain.kill().

Referenced by Bio.Phylo.BaseTree.TreeMixin.collapse_all(), and Bio.Nexus.Trees.Tree.prune().

00053 
    def collapse(self,id):
        """Deletes node from chain and relinks successors to predecessor: collapse(self, id)."""
        if id not in self.chain:
            raise ChainException('Unknown ID: '+str(id))
        prev_id=self.chain[id].get_prev()
        self.chain[prev_id].remove_succ(id)
        succ_ids=self.chain[id].get_succ()
        for i in succ_ids:
            self.chain[i].set_prev(prev_id)
        self.chain[prev_id].add_succ(succ_ids)
        node=self.chain[id]
        self.kill(id)
        return node

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index