BALL::Residue Class Reference
[Molecular Datastructures]

#include <BALL/KERNEL/residue.h>

Inheritance diagram for BALL::Residue:
BALL::Fragment BALL::AtomContainer BALL::Composite BALL::PropertyManager BALL::PersistentObject BALL::Selectable BALL::Object BALL::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 }

Public Member Functions

bool operator== (const Residue &residue) const
bool operator!= (const Residue &residue) const
Constructors and Destructors
 Residue ()
 

Default constructor.


 Residue (const Residue &residue, bool deep=true)
 

Copy constructor.


 Residue (const String &name, const String &id=BALL_RESIDUE_DEFAULT_ID, char insertion_code=BALL_RESIDUE_DEFAULT_INSERTION_CODE)
 

Detailled constructor.


virtual ~Residue ()
 

Destructor.


virtual void clear ()
 

Clears the contents of this instance.


virtual void destroy ()
 

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)
void persistentRead (PersistenceManager &pm) throw (Exception::GeneralException)
Assignment
void set (const Residue &residue, bool deep=true)
Residueoperator= (const Residue &residue)
void get (Residue &residue, bool deep=true) const
void swap (Residue &residue)
Accessors
String getFullName (FullNameType type=ADD_VARIANT_EXTENSIONS) const
bool hasTorsionPhi () const
Angle getTorsionPhi () const
bool hasTorsionPsi () const
Angle getTorsionPsi () const
ProteingetProtein ()
const ProteingetProtein () const
ChaingetChain ()
const ChaingetChain () const
SecondaryStructuregetSecondaryStructure ()
const SecondaryStructuregetSecondaryStructure () const
PDBAtomgetPDBAtom (Position position)
const PDBAtomgetPDBAtom (Position position) const
void setID (const String &id)
const StringgetID () const
void setInsertionCode (char insertion_code)
char getInsertionCode () const
Size countPDBAtoms () const
void prepend (PDBAtom &atom)
void append (PDBAtom &atom)
void insert (PDBAtom &atom)
void insertBefore (PDBAtom &atom, Composite &before)
void insertAfter (PDBAtom &atom, Composite &after)
bool remove (PDBAtom &atom)
void spliceBefore (Residue &residue)
void spliceAfter (Residue &residue)
void splice (Residue &residue)
Predicates
bool isAminoAcid () const
bool isTerminal () const
bool isNTerminal () const
bool isCTerminal () const
Debugging and Diagnostics
virtual bool isValid () const
virtual void dump (std::ostream &s=std::cout, Size depth=0) const

Private Member Functions

AtomContainergetAtomContainer (Position position)
const AtomContainergetAtomContainer (Position position) const
Size countAtomContainers () const
void prepend (AtomContainer &atom_container)
void append (AtomContainer &atom_container)
void insert (AtomContainer &atom_container)
void insertBefore (AtomContainer &atom_container, Composite &composite)
void insertAfter (AtomContainer &atom_container, Composite &composite)
void spliceBefore (AtomContainer &atom_container)
void spliceAfter (AtomContainer &base_ragment)
void splice (AtomContainer &AtomContainer)
bool remove (AtomContainer &AtomContainer)
bool isSuperAtomContainerOf (const AtomContainer &atom_container) const

Private Attributes

String id_
char insertion_code_

Detailed Description

Residue class. This class is used to represent residues in proteins.


Member Enumeration Documentation

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

Enumerator:
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).

ADD_RESIDUE_ID 
ADD_VARIANT_EXTENSIONS_AND_ID 

The number of predefined properties for AtomContainer.

Enumerator:
PROPERTY__NON_STANDARD 
PROPERTY__AMINO_ACID 
PROPERTY__WATER 
PROPERTY__HAS_SSBOND 
PROPERTY__C_TERMINAL 
PROPERTY__N_TERMINAL 
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.

NUMBER_OF_PROPERTIES 

Reimplemented from BALL::Fragment.


Constructor & Destructor Documentation

BALL::Residue::Residue (  ) 

Default constructor.

BALL::Residue::Residue ( const Residue residue,
bool  deep = true 
)

Copy constructor.

BALL::Residue::Residue ( const String name,
const String id = BALL_RESIDUE_DEFAULT_ID,
char  insertion_code = BALL_RESIDUE_DEFAULT_INSERTION_CODE 
)

Detailled constructor.

virtual BALL::Residue::~Residue (  )  [virtual]

Destructor.


Member Function Documentation

void BALL::Residue::append ( AtomContainer atom_container  )  [private]

Append an AtomContainer at the last position.

Parameters:
atom_container the AtomContainer to prepend

Reimplemented from BALL::AtomContainer.

void BALL::Residue::append ( PDBAtom atom  ) 

Append a PDBAtom at the last position.

Parameters:
atom the PDBAtom to append
virtual void BALL::Residue::clear (  )  [virtual]

Clears the contents of this instance.

Reimplemented from BALL::AtomContainer.

Size BALL::Residue::countAtomContainers (  )  const [private]

Count the child AtomContainers.

Returns:
Size the number of AtomContainers

Reimplemented from BALL::AtomContainer.

Size BALL::Residue::countPDBAtoms (  )  const

Count the child PDBAtoms.

Returns:
Size the number of PDBAtoms
virtual void BALL::Residue::destroy (  )  [virtual]

Clears the contents of this instance and removes it from all composite structures.

Reimplemented from BALL::AtomContainer.

virtual void BALL::Residue::dump ( std::ostream &  s = std::cout,
Size  depth = 0 
) const [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 BALL::Fragment.

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

Assign a Residue object from another instance.

const AtomContainer* BALL::Residue::getAtomContainer ( Position  position  )  const [private]

Get a constant pointer to a child AtomContainer at a given position. The pointer is 0 if this instance does not have an AtomContainer at the given position.

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

Reimplemented from BALL::AtomContainer.

AtomContainer* BALL::Residue::getAtomContainer ( Position  position  )  [private]

Get a pointer to a child AtomContainer at a given position. The pointer is 0 if this instance does not have an AtomContainer at the given position.

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

Reimplemented from BALL::AtomContainer.

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

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* BALL::Residue::getChain (  ) 

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 BALL::Residue::getFullName ( FullNameType  type = ADD_VARIANT_EXTENSIONS  )  const

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& BALL::Residue::getID (  )  const

Retrieve the ID.

Returns:
String the ID
char BALL::Residue::getInsertionCode (  )  const

Get the insertion code.

Returns:
char the insertion code
const PDBAtom* BALL::Residue::getPDBAtom ( Position  position  )  const

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* BALL::Residue::getPDBAtom ( Position  position  ) 

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* BALL::Residue::getProtein (  )  const

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* BALL::Residue::getProtein (  ) 

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* BALL::Residue::getSecondaryStructure (  )  const

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* BALL::Residue::getSecondaryStructure (  ) 

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 BALL::Residue::getTorsionPhi (  )  const

Calculate the torsion angle phi.

Returns:
Angle - the torsion angle phi
Angle BALL::Residue::getTorsionPsi (  )  const

Calculate the torsion angle psi.

Returns:
Angle - the torsion angle phi
bool BALL::Residue::hasTorsionPhi (  )  const

Check whether the torsion angle phi is defined.

Returns:
bool
bool BALL::Residue::hasTorsionPsi (  )  const

Check whether the torsion angle psi is defined.

Returns:
bool
void BALL::Residue::insert ( AtomContainer atom_container  )  [private]

Insert an AtomContainer at the last position.

Parameters:
atom_container the AtomContainer to insert

Reimplemented from BALL::AtomContainer.

void BALL::Residue::insert ( PDBAtom atom  ) 

Insert a PDBAtom at the last position.

Parameters:
atom the PDBAtom to append
void BALL::Residue::insertAfter ( AtomContainer atom_container,
Composite after 
) [private]

Insert an AtomContainer after a given Composite object.

Parameters:
atom_container the AtomContainer to insert
after the Composite object to insert after

Reimplemented from BALL::AtomContainer.

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

Insert a PDBAtom after a given Composite object.

Parameters:
atom the PDBAtom to insert
after the Composite object to insert after
void BALL::Residue::insertBefore ( AtomContainer atom_container,
Composite before 
) [private]

Insert an AtomContainer before a given Composite object.

Parameters:
atom_container the AtomContainer to insert
before the Composite object to insert before

Reimplemented from BALL::AtomContainer.

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

Insert a PDBAtom before a given Composite object.

Parameters:
atom the PDBAtom to insert
before the Composite object to insert before
bool BALL::Residue::isAminoAcid (  )  const

Test if this residue is an amino acid. Returns true, if this instance has the property "PROPERTY__AMINO_ACID".

Returns:
bool
bool BALL::Residue::isCTerminal (  )  const

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 BALL::Residue::isNTerminal (  )  const

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 BALL::Residue::isSuperAtomContainerOf ( const AtomContainer atom_container  )  const [private]

Test if an AtomContainer is the parent.

Parameters:
atom_container the AtomContainer to test

Reimplemented from BALL::AtomContainer.

bool BALL::Residue::isTerminal (  )  const

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 BALL::Residue::isValid (  )  const [virtual]

Internal state and consistency self-validation.

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

Reimplemented from BALL::AtomContainer.

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

Inequality operator

See also:
operator ==
Residue& BALL::Residue::operator= ( const Residue residue  ) 

Assignment operator

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

Equality operator. Two residues are equal if they have the same handle.

See also:
Object::operator ==
void BALL::Residue::persistentRead ( PersistenceManager pm  )  throw (Exception::GeneralException) [virtual]

Reads a Residue object from a persistent stream.

Parameters:
pm the persistence manager

Reimplemented from BALL::Fragment.

void BALL::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 BALL::Fragment.

void BALL::Residue::prepend ( AtomContainer atom_container  )  [private]

Prepend an AtomContainer at position 0.

Parameters:
atom_container the AtomContainer to prepend

Reimplemented from BALL::AtomContainer.

void BALL::Residue::prepend ( PDBAtom atom  ) 

Prepend a PDBAtom at position 0.

Parameters:
atom the PDBAtom to prepend
bool BALL::Residue::remove ( AtomContainer atom_container  )  [private]

Remove an AtomContainer

Parameters:
atom_container the AtomContainer to remove
Returns:
false if {atom_container} could not be removed

Reimplemented from BALL::AtomContainer.

bool BALL::Residue::remove ( PDBAtom atom  ) 

Remove a PDBAtom.

Parameters:
atom the PDBAtom to remove
void BALL::Residue::set ( const Residue residue,
bool  deep = true 
)

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 BALL::Residue::setID ( const String id  ) 

Set the ID.

Parameters:
id the new ID
void BALL::Residue::setInsertionCode ( char  insertion_code  ) 

Set the insertion code.

Parameters:
insertion_code the new insertion code
void BALL::Residue::splice ( AtomContainer atom_container  )  [private]

Move the children of {atom_container} into this instance. The children of atom_container are inserted at its position if it is is a child of this. Otherwise the children are inserted using spliceBefore .

Reimplemented from BALL::AtomContainer.

void BALL::Residue::splice ( Residue residue  ) 

Move the children of residue into this instance. The children are inserted using spliceBefore .

void BALL::Residue::spliceAfter ( AtomContainer atom_container  )  [private]

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

Parameters:
atom_container the AtomContainer to access

Reimplemented from BALL::AtomContainer.

void BALL::Residue::spliceAfter ( Residue residue  ) 

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

Parameters:
residue the residue to access
void BALL::Residue::spliceBefore ( AtomContainer atom_container  )  [private]

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

Parameters:
atom_container the AtomContainer to access

Reimplemented from BALL::AtomContainer.

void BALL::Residue::spliceBefore ( Residue residue  ) 

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

Parameters:
residue the residue to access
void BALL::Residue::swap ( Residue residue  ) 

Swap the contents of two Residue objects.


Member Data Documentation