Back to index

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

List of all members.

Public Member Functions

def __init__
def __repr__
def add
def sort
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

 id
 child_dict
 selected_child
 parent

Detailed Description

DisorderedResidue is a wrapper around two or more Residue objects. It is
used to represent point mutations (e.g. there is a Ser 60 and a Cys 60 residue,
each with 50 % occupancy).

Definition at line 116 of file Residue.py.


Constructor & Destructor Documentation

Reimplemented from Bio.PDB.Entity.DisorderedEntityWrapper.

Definition at line 122 of file Residue.py.

00122 
00123     def __init__(self, id):
00124         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 125 of file Residue.py.

00125 
00126     def __repr__(self):
00127         resname=self.get_resname()
00128         hetflag, resseq, icode=self.get_id()
00129         full_id=(resname, hetflag, resseq, icode)
00130         return "<DisorderedResidue %s het=%s resseq=%i icode=%s>" % full_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

def Bio.PDB.Residue.DisorderedResidue.add (   self,
  atom 
)

Definition at line 131 of file Residue.py.

00131 
00132     def add(self, atom):
00133         residue=self.disordered_get()
00134         if not atom.is_disordered()==2:
00135             # Atoms in disordered residues should have non-blank
00136             # altlocs, and are thus represented by DisorderedAtom objects.
00137             resname=residue.get_resname()
00138             het, resseq, icode=residue.get_id() 
00139             # add atom anyway, if PDBParser ignores exception the atom will be part of the residue
00140             residue.add(atom)
00141             raise PDBConstructionException( \
00142                 "Blank altlocs in duplicate residue %s (%s, %i, %s)" \
00143                 % (resname, het, resseq, icode) )
00144         residue.add(atom)

Here is the call graph for this function:

Here is the caller graph for this function:

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.Residue.DisorderedResidue.disordered_add (   self,
  residue 
)
Add a residue object and use its resname as key.

Arguments:
o residue - Residue object

Reimplemented from Bio.PDB.Entity.DisorderedEntityWrapper.

Definition at line 150 of file Residue.py.

00150 
00151     def disordered_add(self, residue):
00152         """Add a residue object and use its resname as key.
00153 
00154         Arguments:
00155         o residue - Residue object
00156         """
00157         resname=residue.get_resname()
00158         # add chain parent to residue
00159         chain=self.get_parent()
00160         residue.set_parent(chain)
00161         assert(not self.disordered_has_id(resname))
00162         self[resname]=residue
00163         self.disordered_select(resname)
00164 

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:

Definition at line 145 of file Residue.py.

00145 
00146     def sort(self):
00147         "Sort the atoms in the child Residue objects."
00148         for residue in self.disordered_get_list():
00149             residue.sort() 

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: