BALL::Nucleotide Class Reference
[Molecular Datastructures]

#include <BALL/KERNEL/nucleotide.h>

Inheritance diagram for BALL::Nucleotide:
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__5_PRIME = Residue::NUMBER_OF_PROPERTIES + 1, PROPERTY__3_PRIME, PROPERTY__NUCLEOTIDE, NUMBER_OF_PROPERTIES }
 

The number of predefined properties for AtomContainer.

More...

Public Member Functions

bool operator== (const Nucleotide &nucleotide) const
bool operator!= (const Nucleotide &nucleotide) const
Constructors and Destructors
 Nucleotide ()
 

Default constructor.


 Nucleotide (const Nucleotide &nucleotide, bool deep=true)
 

Copy constructor.


 Nucleotide (const String &name, const String &id=BALL_NUCLEOTIDE_DEFAULT_ID, char insertion_code=BALL_NUCLEOTIDE_DEFAULT_INSERTION_CODE)
 

Detailled constructor.


virtual ~Nucleotide ()
 

Destructor.


virtual void clear ()
 

Clears the nucleotides contents.


virtual void destroy ()
 

Clears the nucleotides contents 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 Nucleotide &nucleotide, bool deep=true)
Nucleotideoperator= (const Nucleotide &nucleotide)
void get (Nucleotide &nucleotide, bool deep=true) const
void swap (Nucleotide &nucleotide)
Accessors


NucleicAcidgetNucleicAcid ()
const NucleicAcidgetNucleicAcid () const
void setID (const String &id)
const StringgetID () const
void setInsertionCode (char insertion_code)
char getInsertionCode () const
void prepend (Atom &atom)
void append (Atom &atom)
void insert (Atom &atom)
void insertBefore (Atom &atom, Composite &before)
void insertAfter (Atom &atom, Composite &after)
bool remove (Atom &atom)
void spliceBefore (Nucleotide &nucleotide)
void spliceAfter (Nucleotide &nucleotide)
void splice (Nucleotide &nucleotide)
Predicates
bool isTerminal () const
bool is3Prime () const
bool is5Prime () 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

Nucleotide class. This class is used to represent nucleotides within an NucleicAcid object.


Member Enumeration Documentation

The number of predefined properties for AtomContainer.

Enumerator:
PROPERTY__5_PRIME 
PROPERTY__3_PRIME 
PROPERTY__NUCLEOTIDE 
NUMBER_OF_PROPERTIES 

Reimplemented from BALL::Fragment.


Constructor & Destructor Documentation

BALL::Nucleotide::Nucleotide (  ) 

Default constructor.

BALL::Nucleotide::Nucleotide ( const Nucleotide nucleotide,
bool  deep = true 
)

Copy constructor.

BALL::Nucleotide::Nucleotide ( const String name,
const String id = BALL_NUCLEOTIDE_DEFAULT_ID,
char  insertion_code = BALL_NUCLEOTIDE_DEFAULT_INSERTION_CODE 
)

Detailled constructor.

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

Destructor.


Member Function Documentation

void BALL::Nucleotide::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::Nucleotide::append ( Atom atom  ) 

Append an atom after the last position.

Parameters:
atom the atom to append

Reimplemented from BALL::AtomContainer.

virtual void BALL::Nucleotide::clear (  )  [virtual]

Clears the nucleotides contents.

Reimplemented from BALL::AtomContainer.

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

Count the child AtomContainers.

Returns:
Size the number of AtomContainers

Reimplemented from BALL::AtomContainer.

virtual void BALL::Nucleotide::destroy (  )  [virtual]

Clears the nucleotides contents and removes it from all composite structures.

Reimplemented from BALL::AtomContainer.

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

Internal state dump. Dump the current internal state of this instance to the output ostream s with dumping depth depth .

Parameters:
s output stream where to output the internal state of this instance nucleotide
depth the dumping depth

Reimplemented from BALL::Fragment.

void BALL::Nucleotide::get ( Nucleotide nucleotide,
bool  deep = true 
) const

Copy this instance to nucleotide . The assignment is either deep or shallow (default).

Parameters:
nucleotide the nucleotide to be assigned to
See also:
nucleotide::set
const AtomContainer* BALL::Nucleotide::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::Nucleotide::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 String& BALL::Nucleotide::getID (  )  const

Retrieve the ID of the nucleotide.

Returns:
String the ID (constant)
char BALL::Nucleotide::getInsertionCode (  )  const

Retrieve the insertion code of the nucleotide.

Returns:
String the insertion code (constant)
const NucleicAcid* BALL::Nucleotide::getNucleicAcid (  )  const

Get a pointer to the parent NucleicAcid. The pointer is 0 if this instance nucleotide does not have a parent NucleicAcid.

Returns:
NucleicAcid* - constant pointer to the parent NucleicAcid
NucleicAcid* BALL::Nucleotide::getNucleicAcid (  ) 

Get a pointer to the parent NucleicAcid. The pointer is 0 if this instance nucleotide does not have a parent NucleicAcid.

Returns:
NucleicAcid* - mutable pointer to the parent NucleicAcid
void BALL::Nucleotide::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::Nucleotide::insert ( Atom atom  ) 

Insert an atom after the last position.

Parameters:
atom the atom to insert

Reimplemented from BALL::AtomContainer.

void BALL::Nucleotide::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::Nucleotide::insertAfter ( Atom atom,
Composite after 
)

Insert an atom after a given Composite object.

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

Reimplemented from BALL::AtomContainer.

void BALL::Nucleotide::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::Nucleotide::insertBefore ( Atom atom,
Composite before 
)

Insert an atom before a given Composite object.

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

Reimplemented from BALL::AtomContainer.

bool BALL::Nucleotide::is3Prime (  )  const

Test if this instance nucleotide is 3-prime. Returns true, if this instance is the first nucleotide in its parent NucleicAcid.

Returns:
bool
bool BALL::Nucleotide::is5Prime (  )  const

Test if this instance nucleotide is 5-prime. Returns true, if this instance is the last nucleotide in its parent NucleicAcid.

Returns:
bool
bool BALL::Nucleotide::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::Nucleotide::isTerminal (  )  const

Test if this instance nucleotide is terminal. Returns true, if this instance is the first or last nucleotide in its parent NucleicAcid.

Returns:
bool
virtual bool BALL::Nucleotide::isValid (  )  const [virtual]

Internal state and consistency self-validation.

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

Reimplemented from BALL::AtomContainer.

bool BALL::Nucleotide::operator!= ( const Nucleotide nucleotide  )  const

Inequality operator

See also:
operator ==
Nucleotide& BALL::Nucleotide::operator= ( const Nucleotide nucleotide  ) 

Assignment operator. The assignment is either deep or shallow (default).

Parameters:
nucleotide the nucleotide to be copied (cloned)
Returns:
nucleotide& - this instance nucleotide
See also:
nucleotide::set
bool BALL::Nucleotide::operator== ( const Nucleotide nucleotide  )  const

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

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

Reads a Nucleotide object from a persistent stream.

Parameters:
pm the persistence manager

Reimplemented from BALL::Fragment.

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

Writes a Nucleotide object to a persistent stream.

Parameters:
pm the persistence manager

Reimplemented from BALL::Fragment.

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

Prepend an AtomContainer at position 0.

Parameters:
atom_container the AtomContainer to prepend

Reimplemented from BALL::AtomContainer.

void BALL::Nucleotide::prepend ( Atom atom  ) 

Prepend an atom at position 0.

Parameters:
atom the atom to prepend

Reimplemented from BALL::AtomContainer.

bool BALL::Nucleotide::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::Nucleotide::remove ( Atom atom  ) 

Remove an atom.

Parameters:
atom the atom to remove

Reimplemented from BALL::AtomContainer.

void BALL::Nucleotide::set ( const Nucleotide nucleotide,
bool  deep = true 
)

Assignment with cloning facility. The assignment is either deep or shallow (default).

Parameters:
nucleotide the nucleotide to be copied (cloned)
deep make a deep (=true) or shallow (=false) copy
void BALL::Nucleotide::setID ( const String id  ) 

Set the ID of the nucleotide.

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

Set the insertion code of the nucleotide.

Parameters:
insertion_code the new insertion code
void BALL::Nucleotide::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::Nucleotide::splice ( Nucleotide nucleotide  ) 

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

void BALL::Nucleotide::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::Nucleotide::spliceAfter ( Nucleotide nucleotide  ) 

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

Parameters:
nucleotide the nucleotide to access
void BALL::Nucleotide::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::Nucleotide::spliceBefore ( Nucleotide nucleotide  ) 

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

Parameters:
nucleotide the nucleotide to access
void BALL::Nucleotide::swap ( Nucleotide nucleotide  ) 

Swapping of instaces of nucleotide.

Parameters:
nucleotide the instance of nucleotide to swap with

Member Data Documentation