Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
Bio.PDB.Entity.DisorderedEntityWrapper Class Reference
Inheritance diagram for Bio.PDB.Entity.DisorderedEntityWrapper:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def __getattr__
def __getitem__
def __setitem__
def __contains__
def __iter__
def __len__
def __sub__
def get_id
def disordered_has_id
def detach_parent
def get_parent
def set_parent
def disordered_select
def disordered_add
def is_disordered
def disordered_get_id_list
def disordered_get
def disordered_get_list

Public Attributes

 id
 child_dict
 selected_child
 parent

Detailed Description

This class is a simple wrapper class that groups a number of equivalent
Entities and forwards all method calls to one of them (the currently selected 
object). DisorderedResidue and DisorderedAtom are subclasses of this class.

E.g.: A DisorderedAtom object contains a number of Atom objects,
where each Atom object represents a specific position of a disordered
atom in the structure.

Definition at line 185 of file Entity.py.


Constructor & Destructor Documentation

Reimplemented in Bio.PDB.Atom.DisorderedAtom, and Bio.PDB.Residue.DisorderedResidue.

Definition at line 195 of file Entity.py.

00195 
00196     def __init__(self, id):
00197         self.id=id
00198         self.child_dict={}
00199         self.selected_child=None
00200         self.parent=None    


Member Function Documentation

Definition at line 221 of file Entity.py.

00221 
00222     def __contains__(self, id):
00223         "True if the child has the given id."
00224         return (id in self.selected_child)

Definition at line 203 of file Entity.py.

00203 
00204     def __getattr__(self, method):
00205         "Forward the method call to the selected child."
00206         if not hasattr(self, 'selected_child'):
00207             # Avoid problems with pickling
00208             # Unpickling goes into infinite loop!
00209             raise AttributeError
00210         return getattr(self.selected_child, method)

Definition at line 211 of file Entity.py.

00211 
00212     def __getitem__(self, id):
00213         "Return the child with the given id."
00214         return self.selected_child[id]

Here is the caller graph for this function:

Definition at line 225 of file Entity.py.

00225 
00226     def __iter__(self):
00227         "Return the number of children."
00228         return iter(self.selected_child)

Here is the caller graph for this function:

Definition at line 229 of file Entity.py.

00229 
00230     def __len__(self):
00231         "Return the number of children."
00232         return len(self.selected_child)

def Bio.PDB.Entity.DisorderedEntityWrapper.__setitem__ (   self,
  id,
  child 
)

Definition at line 217 of file Entity.py.

00217 
00218     def __setitem__(self, id, child):
00219         "Add a child, associated with a certain id."
00220         self.child_dict[id]=child

Subtraction with another object.

Definition at line 233 of file Entity.py.

00233 
00234     def __sub__(self, other):
00235         """Subtraction with another object."""
00236         return self.selected_child - other

Definition at line 247 of file Entity.py.

00247 
00248     def detach_parent(self):
00249         "Detach the parent"
00250         self.parent=None
00251         for child in self.disordered_get_list():
00252             child.detach_parent()

Here is the call graph for this function:

Reimplemented in Bio.PDB.Atom.DisorderedAtom, and Bio.PDB.Residue.DisorderedResidue.

Definition at line 270 of file Entity.py.

00270 
00271     def disordered_add(self, child):
00272         "This is implemented by DisorderedAtom and DisorderedResidue."
00273         raise NotImplementedError

Get the child object associated with id.

If id is None, the currently selected child is returned.

Definition at line 287 of file Entity.py.

00287 
00288     def disordered_get(self, id=None):
00289         """Get the child object associated with id.
00290 
00291         If id is None, the currently selected child is returned.
00292         """
00293         if id==None:
00294             return self.selected_child
00295         return self.child_dict[id]

Here is the caller graph for this function:

Definition at line 280 of file Entity.py.

00280 
00281     def disordered_get_id_list(self):
00282         "Return a list of id's."
00283         l=self.child_dict.keys()
00284         # sort id list alphabetically
00285         l.sort()
00286         return l
        

Definition at line 296 of file Entity.py.

00296 
00297     def disordered_get_list(self):
00298         "Return list of children."
00299         return self.child_dict.values()

Here is the caller graph for this function:

True if there is an object present associated with this id.

Definition at line 243 of file Entity.py.

00243 
00244     def disordered_has_id(self, id):
00245         """True if there is an object present associated with this id."""
00246         return (id in self.child_dict)

Here is the caller graph for this function:

Select the object with given id as the currently active object.

Uncaught method calls are forwarded to the selected child object.

Definition at line 263 of file Entity.py.

00263 
00264     def disordered_select(self, id):
00265         """Select the object with given id as the currently active object.
00266 
00267         Uncaught method calls are forwarded to the selected child object.
00268         """
00269         self.selected_child=self.child_dict[id]
    

Here is the caller graph for this function:

Definition at line 239 of file Entity.py.

00239 
00240     def get_id(self):
00241         "Return the id."
00242         return self.id

Here is the caller graph for this function:

Definition at line 253 of file Entity.py.

00253 
00254     def get_parent(self):
00255         "Return parent."
00256         return self.parent

Here is the caller graph for this function:

Return 2, indicating that this Entity is a collection of Entities.

Definition at line 274 of file Entity.py.

00274 
00275     def is_disordered(self):
00276         """
00277         Return 2, indicating that this Entity is a collection of Entities.
00278         """
00279         return 2

Definition at line 257 of file Entity.py.

00257 
00258     def set_parent(self, parent):
00259         "Set the parent for the object and its children."
00260         self.parent=parent
00261         for child in self.disordered_get_list():
00262             child.set_parent(parent)

Here is the call graph for this function:


Member Data Documentation

Definition at line 197 of file Entity.py.

Definition at line 196 of file Entity.py.

Definition at line 199 of file Entity.py.

Definition at line 198 of file Entity.py.


The documentation for this class was generated from the following file: