Back to index

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

List of all members.

Public Member Functions

def __init__
def __repr__
def disordered_add
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 is_disordered
def disordered_get_id_list
def disordered_get
def disordered_get_list

Public Attributes

 last_occupancy
 id
 child_dict
 selected_child
 parent

Detailed Description

This class contains all Atom objects that represent the same disordered
atom. One of these atoms is "selected" and all method calls not caught
by DisorderedAtom are forwarded to the selected Atom object. In that way, a
DisorderedAtom behaves exactly like a normal Atom. By default, the selected 
Atom object represents the Atom object with the highest occupancy, but a 
different Atom object can be selected by using the disordered_select(altloc) 
method. 

Definition at line 302 of file Atom.py.


Constructor & Destructor Documentation

def Bio.PDB.Atom.DisorderedAtom.__init__ (   self,
  id 
)
Arguments:
o id - string, atom name

Reimplemented from Bio.PDB.Entity.DisorderedEntityWrapper.

Definition at line 312 of file Atom.py.

00312 
00313     def __init__(self, id):
00314         """
00315         Arguments:
00316         o id - string, atom name
00317         """
00318         self.last_occupancy=-1
00319         DisorderedEntityWrapper.__init__(self, id)


Member Function Documentation

def Bio.PDB.Entity.DisorderedEntityWrapper.__contains__ (   self,
  id 
) [inherited]

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)

def Bio.PDB.Entity.DisorderedEntityWrapper.__getattr__ (   self,
  method 
) [inherited]

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)

def Bio.PDB.Entity.DisorderedEntityWrapper.__getitem__ (   self,
  id 
) [inherited]

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)

Definition at line 322 of file Atom.py.

00322 
00323     def __repr__(self):
00324         return "<Disordered Atom %s>" % self.get_id() 

Here is the call graph for this function:

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

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

def Bio.PDB.Entity.DisorderedEntityWrapper.__sub__ (   self,
  other 
) [inherited]
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:

def Bio.PDB.Atom.DisorderedAtom.disordered_add (   self,
  atom 
)

Reimplemented from Bio.PDB.Entity.DisorderedEntityWrapper.

Definition at line 325 of file Atom.py.

00325 
00326     def disordered_add(self, atom):
00327         "Add a disordered atom."
00328         # Add atom to dict, use altloc as key   
00329         atom.flag_disorder()
00330         # set the residue parent of the added atom
00331         residue=self.get_parent()
00332         atom.set_parent(residue)
00333         altloc=atom.get_altloc()
00334         occupancy=atom.get_occupancy()
00335         self[altloc]=atom
00336         if occupancy>self.last_occupancy:
00337             self.last_occupancy=occupancy
00338             self.disordered_select(altloc)

Here is the call graph for this function:

def Bio.PDB.Entity.DisorderedEntityWrapper.disordered_get (   self,
  id = None 
) [inherited]
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:

def Bio.PDB.Entity.DisorderedEntityWrapper.disordered_has_id (   self,
  id 
) [inherited]
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:

def Bio.PDB.Entity.DisorderedEntityWrapper.disordered_select (   self,
  id 
) [inherited]
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

def Bio.PDB.Entity.DisorderedEntityWrapper.set_parent (   self,
  parent 
) [inherited]

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 317 of file Atom.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: