Table of Contents

Module: tree MolKit/tree.py

This module implements the classes TreeNode and TreeNodeSet.

TreeNodes are objects that can be used to build hierachical structures where each node is a list of it's children. Each Child knows its Parent. An optional elementType argument allows to specify the type of elements a node can hold. When specified it it used during the adoption process of a child to assert the child's type validity. It is also possible to specify the class type of a list of specialised TreeNodes. I.e. if a node called Residue is derive from TreeNode one can specify that a list of Residues should be a ResidueSet (probably derived from TreeNodeSet). In it is possible to specify the type of a set of children of a given node. i.e. for a Residue node we can specify the a subset of its children will be an AtomSet (derived form TreeNodeSet). Finally, the children member can be aliased to a new name. I.e. the children of a Residue element res can be addressed as res.children or res.atoms if atoms is used as an alias for children in the Residue object.

TreeNodeSets is a class to represent lists of TreeNodes. It inherits from ListSet enabling Boolean operations among TreeNodeSets. A get method is provided to filter objects out from the set using a user specified function which is applied to each object of the set.

Classes   
TreeNode

Base class for node that can be used to build trees.

TreeNodeSet

Class to represent a set of nodes from a a tree


Table of Contents

This document was automatically generated on Sun Aug 5 15:53:23 2001 by HappyDoc version r1_5