Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

Residue Class Reference
[Molecular Datastructures]

Residue class. More...

#include <residue.h>

Inheritance diagram for Residue:

Fragment AtomContainer Composite PropertyManager PersistentObject Selectable Object AutoDeletable List of all members.

Public Types

Enums
enum  Property {
  PROPERTY__NON_STANDARD = Fragment::NUMBER_OF_PROPERTIES + 1, PROPERTY__AMINO_ACID, PROPERTY__WATER, PROPERTY__HAS_SSBOND,
  PROPERTY__C_TERMINAL, PROPERTY__N_TERMINAL, PROPERTY__CYCLIC, NUMBER_OF_PROPERTIES
}
 The number of predefined properties for AtomContainer. More...
enum  FullNameType { NO_VARIANT_EXTENSIONS, ADD_VARIANT_EXTENSIONS, ADD_RESIDUE_ID, ADD_VARIANT_EXTENSIONS_AND_ID }
 Enum used to describe the kind of name constructed by getFullName . More...

Public Member Functions

bool operator== (const Residue &residue) const throw ()
 Equality operator.
bool operator!= (const Residue &residue) const throw ()
 Inequality operator.
Constructors and Destructors
 Residue () throw ()
 Default constructor.
 Residue (const Residue &residue, bool deep=true) throw ()
 Copy constructor.
 Residue (const String &name, const String &id=BALL_RESIDUE_DEFAULT_ID, char insertion_code=BALL_RESIDUE_DEFAULT_INSERTION_CODE) throw ()
 Detailled constructor.
virtual ~Residue () throw ()
 Destructor.
virtual void clear () throw ()
 Clears the contents of this instance.
virtual void destroy () throw ()
 Clears the contents of this instance and removes it from all composite structures.
Persistence
void persistentWrite (PersistenceManager &pm, const char *name=0) const throw (Exception::GeneralException)
 Writes a Residue object to a persistent stream.
void persistentRead (PersistenceManager &pm) throw (Exception::GeneralException)
 Reads a Residue object from a persistent stream.
Assignment
void set (const Residue &residue, bool deep=true) throw ()
 Assignment with cloning facility.
Residueoperator= (const Residue &residue) throw ()
 Assignment operator.
void get (Residue &residue, bool deep=true) const throw ()
 Assign a Residue object from another instance.
void swap (Residue &residue) throw ()
 Swap the contents of two Residue objects.
Accessors
String getFullName (FullNameType type=ADD_VARIANT_EXTENSIONS) const throw ()
 Return the fully qualified name.
bool hasTorsionPhi () const throw ()
 Check whether the torsion angle phi is defined.
Angle getTorsionPhi () const throw ()
 Calculate the torsion angle phi.
bool hasTorsionPsi () const throw ()
 Check whether the torsion angle psi is defined.
Angle getTorsionPsi () const throw ()
 Calculate the torsion angle psi.
ProteingetProtein () throw ()
 Get a pointer to the parent protein.
const ProteingetProtein () const throw ()
 Get a constant pointer to the parent protein.
ChaingetChain () throw ()
 Get a pointer to the parent chain.
const ChaingetChain () const throw ()
 Get a pointer to the parent chain.
SecondaryStructuregetSecondaryStructure () throw ()
 Get a pointer to the parent secondary structure.
const SecondaryStructuregetSecondaryStructure () const throw ()
 Get a pointer to the parent secondary structure.
PDBAtomgetPDBAtom (Position position) throw ()
 Get a pointer to a child PDBAtom at a given position.
const PDBAtomgetPDBAtom (Position position) const throw ()
 Get a pointer to a child PDBAtom at a given position.
void setID (const String &id) throw ()
 Set the ID.
const StringgetID () const throw ()
 Retrieve the ID.
void setInsertionCode (char insertion_code) throw ()
 Set the insertion code.
char getInsertionCode () const throw ()
 Get the insertion code.
Size countPDBAtoms () const throw ()
 Count the child PDBAtoms.
void prepend (PDBAtom &atom) throw ()
 Prepend a PDBAtom at position 0.
void append (PDBAtom &atom) throw ()
 Append a PDBAtom at the last position.
void insert (PDBAtom &atom) throw ()
 Insert a PDBAtom at the last position.
void insertBefore (PDBAtom &atom, Composite &before) throw ()
 Insert a PDBAtom before a given Composite object.
void insertAfter (PDBAtom &atom, Composite &after) throw ()
 Insert a PDBAtom after a given Composite object.
bool remove (PDBAtom &atom) throw ()
 Remove a PDBAtom.
void spliceBefore (Residue &residue) throw ()
 Cut all children of residue and prepend them before the children of this instance.
void spliceAfter (Residue &residue) throw ()
 Cut all children of residue and append them after the children of this instance.
void splice (Residue &residue) throw ()
 Move the children of residue into this instance.
Predicates
bool isAminoAcid () const throw ()
 Test if this residue is an amino acid.
bool isTerminal () const throw ()
 Test if this residue is terminal.
bool isNTerminal () const throw ()
 Test if this residue is N-terminal.
bool isCTerminal () const throw ()
 Test if this residue is C-terminal.
Debugging and Diagnostics
virtual bool isValid () const throw ()
 Internal state and consistency self-validation.
virtual void dump (std::ostream &s=std::cout, Size depth=0) const throw ()
 Internal state dump.

Detailed Description

Residue class.

This class is used to represent residues in proteins.


Member Enumeration Documentation

enum Residue::FullNameType
 

Enum used to describe the kind of name constructed by getFullName .

Enumeration values:
NO_VARIANT_EXTENSIONS  This returns the unmodified residue name only.
ADD_VARIANT_EXTENSIONS  Add the residue variant extensions (e.g. '-C' for C-terminal residues).

enum Residue::Property
 

The number of predefined properties for AtomContainer.

Enumeration values:
PROPERTY__CYCLIC  Property for cyclic peptides.

This property is set by the build bonds processor, if an atom of the first and an atom of the last residue in a chain share a bond.

Reimplemented from Fragment.


Member Function Documentation

void Residue::append PDBAtom atom  )  throw ()
 

Append a PDBAtom at the last position.

Parameters:
atom the PDBAtom to append

Size Residue::countPDBAtoms  )  const throw ()
 

Count the child PDBAtoms.

Returns:
Size the number of PDBAtoms

virtual void Residue::dump std::ostream &  s = std::cout,
Size  depth = 0
const throw () [virtual]
 

Internal state dump.

Dump the current internal state to the output ostream s with dumping depth depth .

Parameters:
s output stream where to output the internal state
depth the dumping depth

Reimplemented from Fragment.

void Residue::get Residue residue,
bool  deep = true
const throw ()
 

Assign a Residue object from another instance.

const Chain* Residue::getChain  )  const throw ()
 

Get a pointer to the parent chain.

The pointer is 0 if this instance does not have a parent chain.

Returns:
Chain* - constant pointer to the parent chain

Chain* Residue::getChain  )  throw ()
 

Get a pointer to the parent chain.

The pointer is 0 if this instance does not have a parent chain.

Returns:
Chain* - mutable pointer to the parent chain

String Residue::getFullName FullNameType  type = ADD_VARIANT_EXTENSIONS  )  const throw ()
 

Return the fully qualified name.

Residue names are modified as follows:

  • -N is added for N terminal residues
  • -C is added for C terminal residue
  • [-]S is added for CYS involved in a disulphide bridge
  • -M is added for individual amino acids (C and N terminal)

Parameters:
type if type is set to NO_VARIANT_EXTENSIONS, the variant extension (-XX) is omitted.
Returns:
String the full fragment name

const String& Residue::getID  )  const throw ()
 

Retrieve the ID.

Returns:
String the ID

char Residue::getInsertionCode  )  const throw ()
 

Get the insertion code.

Returns:
char the insertion code

const PDBAtom* Residue::getPDBAtom Position  position  )  const throw ()
 

Get a pointer to a child PDBAtom at a given position.

The pointer is 0 if this instance does not have a PDBAtom at this position.

Parameters:
position the position of the child PDBAtom
Returns:
PDBAtom* - constant pointer to the child

PDBAtom* Residue::getPDBAtom Position  position  )  throw ()
 

Get a pointer to a child PDBAtom at a given position.

The pointer is 0 if this instance does not have a PDBAtom at this position.

Parameters:
position the position of the child PDBAtom
Returns:
PDBAtom* - mutable pointer to the child

const Protein* Residue::getProtein  )  const throw ()
 

Get a constant pointer to the parent protein.

The pointer is 0 if this instance does not have a parent protein.

Returns:
Protein* - constant pointer to the parent protein

Protein* Residue::getProtein  )  throw ()
 

Get a pointer to the parent protein.

The pointer is 0 if this instance does not have a parent protein.

Returns:
Protein* - mutable pointer to the parent protein

const SecondaryStructure* Residue::getSecondaryStructure  )  const throw ()
 

Get a pointer to the parent secondary structure.

The pointer is 0 if this instance does not have a parent secondary structure.

Returns:
SecondaryStructure* - mutable pointer to the parent chain

SecondaryStructure* Residue::getSecondaryStructure  )  throw ()
 

Get a pointer to the parent secondary structure.

The pointer is 0 if this instance does not have a parent secondary structure.

Returns:
SecondaryStructure* - mutable pointer to the parent chain

Angle Residue::getTorsionPhi  )  const throw ()
 

Calculate the torsion angle phi.

Returns:
Angle - the torsion angle phi

Angle Residue::getTorsionPsi  )  const throw ()
 

Calculate the torsion angle psi.

Returns:
Angle - the torsion angle phi

bool Residue::hasTorsionPhi  )  const throw ()
 

Check whether the torsion angle phi is defined.

Returns:
bool

bool Residue::hasTorsionPsi  )  const throw ()
 

Check whether the torsion angle psi is defined.

Returns:
bool

void Residue::insert PDBAtom atom  )  throw ()
 

Insert a PDBAtom at the last position.

Parameters:
atom the PDBAtom to append

void Residue::insertAfter PDBAtom atom,
Composite after
throw ()
 

Insert a PDBAtom after a given Composite object.

Parameters:
atom the PDBAtom to insert
after the Composite object to insert after

void Residue::insertBefore PDBAtom atom,
Composite before
throw ()
 

Insert a PDBAtom before a given Composite object.

Parameters:
atom the PDBAtom to insert
before the Composite object to insert before

bool Residue::isAminoAcid  )  const throw ()
 

Test if this residue is an amino acid.

Returns true, if this instance has the property "PROPERTY__AMINO_ACID".

Returns:
bool

bool Residue::isCTerminal  )  const throw ()
 

Test if this residue is C-terminal.

Returns true, if this instance has the property "PROPERTY__AMINO_ACID" and is the last amino acid residue in its parent chain.

Returns:
bool

bool Residue::isNTerminal  )  const throw ()
 

Test if this residue is N-terminal.

Returns true, if this instance has the property "PROPERTY__AMINO_ACID" and is the first amino acid residue in its parent chain.

Returns:
bool

bool Residue::isTerminal  )  const throw ()
 

Test if this residue is terminal.

Returns true, if this instance has the property "PROPERTY__AMINO_ACID" and is the first or last amino acid residue in its parent chain.

Returns:
bool

virtual bool Residue::isValid  )  const throw () [virtual]
 

Internal state and consistency self-validation.

Returns:
bool - true if the internal state is correct (self-validated) and consistent, false otherwise

Reimplemented from AtomContainer.

bool Residue::operator!= const Residue residue  )  const throw ()
 

Inequality operator.

See also:
operator ==

bool Residue::operator== const Residue residue  )  const throw ()
 

Equality operator.

Two residues are equal if they have the same handle.

See also:
Object::operator ==

void Residue::persistentRead PersistenceManager pm  )  throw (Exception::GeneralException) [virtual]
 

Reads a Residue object from a persistent stream.

Parameters:
pm the persistence manager

Reimplemented from Fragment.

void Residue::persistentWrite PersistenceManager pm,
const char *  name = 0
const throw (Exception::GeneralException) [virtual]
 

Writes a Residue object to a persistent stream.

Parameters:
pm the persistence manager

Reimplemented from Fragment.

void Residue::prepend PDBAtom atom  )  throw ()
 

Prepend a PDBAtom at position 0.

Parameters:
atom the PDBAtom to prepend

bool Residue::remove PDBAtom atom  )  throw ()
 

Remove a PDBAtom.

Parameters:
atom the PDBAtom to remove

void Residue::set const Residue residue,
bool  deep = true
throw ()
 

Assignment with cloning facility.

The assignment is either deep or shallow (default).

Parameters:
residue the Residue to be copied (cloned)
deep make a deep (=true) or shallow (=false) copy

void Residue::setID const String id  )  throw ()
 

Set the ID.

Parameters:
id the new ID

void Residue::setInsertionCode char  insertion_code  )  throw ()
 

Set the insertion code.

Parameters:
insertion_code the new insertion code

void Residue::splice Residue residue  )  throw ()
 

Move the children of residue into this instance.

The children are inserted using spliceBefore .

void Residue::spliceAfter Residue residue  )  throw ()
 

Cut all children of residue and append them after the children of this instance.

Parameters:
residue the residue to access

void Residue::spliceBefore Residue residue  )  throw ()
 

Cut all children of residue and prepend them before the children of this instance.

Parameters:
residue the residue to access

void Residue::swap Residue residue  )  throw ()
 

Swap the contents of two Residue objects.