Package MolKit :: Package pdb2pqr :: Package src :: Module structures :: Class Residue
[hide private]
[frames] | no frames]

Class Residue

source code

Known Subclasses:
aa.Amino, aa.LIG, aa.WAT, definitions.DefinitionResidue, na.Nucleic

Residue class

The residue class contains a list of Atom objects associated with that residue and other helper functions.

Instance Methods [hide private]
  __init__(self, atoms)
...
  __str__(self)
Basic string representation for debugging
  addAtom(self, atom)
Add the atom object to the residue.
  addMissing(self, value)
...
  createAtom(self, name, newcoords, type)
Add a new atom object to the residue.
  get(self, name)
...
  getAtom(self, name)
...
  getAtoms(self)
  getCharge(self)
Get the total charge of the residue.
  hasAtom(self, name)
  numAtoms(self)
...
  removeAtom(self, atomname)
Remove an atom from the residue object.
  renameAtom(self, oldname, newname)
...
  renameResidue(self, name)
...
  reorder(self)
Reorder the atoms to start with N, CA, C, O if they exist
  rotateTetrahedral(self, atom1, atom2, angle)
Rotate about the atom1-atom2 bond by a given angle All atoms connected to atom2 will rotate.
  set(self, name, value)
...
  setChainID(self, value)
Set the chainID field to a certain value
  setDonorsAndAcceptors(self)
Set the donors and acceptors within the residue
  setResSeq(self, value)
Set the atom field resSeq to a certain value and change the residue's information.

Method Details [hide private]

__init__(self, atoms)
(Constructor)

source code 

Initialize the class

Parameters
    atoms:      A list of Atom objects to be stored in this class
                (list)

__str__(self)
(Informal representation operator)

source code 
Basic string representation for debugging

addAtom(self, atom)

source code 

Add the atom object to the residue.

Parameters
    atom: The object to be added (ATOM)

addMissing(self, value)

source code 

Add the value to the list of missing atoms

Parameters
    value: The name of the missing atom (string)

createAtom(self, name, newcoords, type)

source code 

Add a new atom object to the residue. Uses an atom
currently in the residue to seed the new atom
object, then replaces the coordinates and name accordingly.

Parameters
    name:      The name of the new atom (string)
    newcoords: The x,y,z coordinates of the new atom (list)
    type:      The type of atom, ATOM or HETATM

get(self, name)

source code 

Get a member of the Residue class

Parameters
    name:          The name of the member (string)
Possible Values
    atoms:         The atoms in the residue
    name:          The name of the residue
    chainID:       The chainID associated with the residue
    resSeq:        The sequence number of the residue
    icode:         The iCode of the residue
    SSbonded:      1 if the residue has a SS bond, 0 otherwise
    SSbondpartner: The residue of the bond partner
    type:          The type associated with this residue
    isNterm:       # of hydrogens if the residue is the N-Terminus, 0 otherwise
    isCterm:       1 if the residue is the C-Terminus, 0 otherwise
    missing:     List of missing atoms of the residue
Returns
    item:          The value of the member

getAtom(self, name)

source code 

Retrieve an atom from the mapping

Parameters
    resname: The name of the residue to retrieve (string)

getAtoms(self)

source code 
None

getCharge(self)

source code 

Get the total charge of the residue.  In order to get rid
of floating point rounding error, do the string
transformation.

Returns:
    charge: The charge of the residue (float)

hasAtom(self, name)

source code 
None

numAtoms(self)

source code 

Get the number of atoms for the residue

Returns
    count:  Number of atoms in the residue (int)

removeAtom(self, atomname)

source code 

Remove an atom from the residue object.

Parameters
    atomname: The name of the atom to be removed (string)

renameAtom(self, oldname, newname)

source code 

Rename an atom to a new name

Parameters
    oldname: The old atom name (string)
    newname: The new atom name (string)

renameResidue(self, name)

source code 

Rename a given residue

Parameters
    name:       The new name of the residue

reorder(self)

source code 
Reorder the atoms to start with N, CA, C, O if they exist

rotateTetrahedral(self, atom1, atom2, angle)

source code 

Rotate about the atom1-atom2 bond by a given angle
All atoms connected to atom2 will rotate.

Parameters:
    atom1:  The first atom of the bond to rotate about (atom)
    atom2:  The second atom of the bond to rotate about (atom)
    angle:  The number of degrees to rotate (float)

set(self, name, value)

source code 

Set a member of the Residue class to a specific value 

Parameters
    name:          The name of the object to set (string)
    value:         The object to append
Possible Values
    atoms:         The atoms in the residue
    name:          The name of the residue
    chain:         The chainID associated with the residue
    resSeq:        The sequence number of the residue
    icode:         The iCode of the residue
    SSbonded:      1 if the residue has a SS bond, 0 otherwise
    SSbondpartner: The residue of the bond partner
    type:          The type associated with this residue
    isNterm:       # of hydrogens if the residue is the N-Terminus, 0 otherwise
    isCterm:       1 if the residue is the C-Terminus, 0 otherwise
    isDirty:       1 if the residue is not missing atoms,
                   0 otherwise
Notes
    resSeq points to the residue.setResSeq function
Returns
    item:          The value of the member   

setChainID(self, value)

source code 
Set the chainID field to a certain value

setDonorsAndAcceptors(self)

source code 
Set the donors and acceptors within the residue

setResSeq(self, value)

source code 

Set the atom field resSeq to a certain value and
change the residue's information.  The icode field is no longer
useful.

Parameters
    value:  The new value of resSeq (int)