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

Nucleotide Class Reference
[Molecular Datastructures]

Nucleotide class. More...

#include <nucleotide.h>

Inheritance diagram for Nucleotide:

Fragment AtomContainer Composite PropertyManager PersistentObject Selectable Object 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.

Public Member Functions

bool operator== (const Nucleotide &nucleotide) const throw ()
 Equality operator.
bool operator!= (const Nucleotide &nucleotide) const throw ()
 Inequality operator.
Constructors and Destructors
 Nucleotide () throw ()
 Default constructor.
 Nucleotide (const Nucleotide &nucleotide, bool deep=true) throw ()
 Copy constructor.
 Nucleotide (const String &name, const String &id=BALL_NUCLEOTIDE_DEFAULT_ID, char insertion_code=BALL_NUCLEOTIDE_DEFAULT_INSERTION_CODE) throw ()
 Detailled constructor.
virtual ~Nucleotide () throw ()
 Destructor.
virtual void clear () throw ()
 Clears the nucleotides contents.
virtual void destroy () throw ()
 Clears the nucleotides contents and removes it from all composite structures.
Persistence
void persistentWrite (PersistenceManager &pm, const char *name=0) const throw (Exception::GeneralException)
 Writes a Nucleotide object to a persistent stream.
void persistentRead (PersistenceManager &pm) throw (Exception::GeneralException)
 Reads a Nucleotide object from a persistent stream.
Assignment
void set (const Nucleotide &nucleotide, bool deep=true) throw ()
 Assignment with cloning facility.
Nucleotideoperator= (const Nucleotide &nucleotide) throw ()
 Assignment operator.
void get (Nucleotide &nucleotide, bool deep=true) const throw ()
 Copy this instance to nucleotide .
void swap (Nucleotide &nucleotide) throw ()
 Swapping of instaces of nucleotide.
Accessors
NucleicAcidgetNucleicAcid () throw ()
 Get a pointer to the parent NucleicAcid.
const NucleicAcidgetNucleicAcid () const throw ()
 Get a pointer to the parent NucleicAcid.
void setID (const String &id) throw ()
 Set the ID of the nucleotide.
const StringgetID () const throw ()
 Retrieve the ID of the nucleotide.
void setInsertionCode (char insertion_code) throw ()
 Set the insertion code of the nucleotide.
char getInsertionCode () const throw ()
 Retrieve the insertion code of the nucleotide.
void prepend (Atom &atom) throw ()
 Prepend an atom at position 0.
void append (Atom &atom) throw ()
 Append an atom after the last position.
void insert (Atom &atom) throw ()
 Insert an atom after the last position.
void insertBefore (Atom &atom, Composite &before) throw ()
 Insert an atom before a given Composite object.
void insertAfter (Atom &atom, Composite &after) throw ()
 Insert an atom after a given Composite object.
bool remove (Atom &atom) throw ()
 Remove an atom.
void spliceBefore (Nucleotide &nucleotide) throw ()
 Cut all children of nucleotide and prepend them before the children of this instance.
void spliceAfter (Nucleotide &nucleotide) throw ()
 Cut all children of nucleotide and append them after the children of this instance.
void splice (Nucleotide &nucleotide) throw ()
 Move the children of nucleotide into this instance.
Predicates
bool isTerminal () const throw ()
 Test if this instance nucleotide is terminal.
bool is3Prime () const throw ()
 Test if this instance nucleotide is 3-prime.
bool is5Prime () const throw ()
 Test if this instance nucleotide is 5-prime.
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

Nucleotide class.

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


Member Function Documentation

void Nucleotide::append Atom atom  )  throw ()
 

Append an atom after the last position.

Parameters:
atom the atom to append

Reimplemented from AtomContainer.

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

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

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 String& Nucleotide::getID  )  const throw ()
 

Retrieve the ID of the nucleotide.

Returns:
String the ID (constant)

char Nucleotide::getInsertionCode  )  const throw ()
 

Retrieve the insertion code of the nucleotide.

Returns:
String the insertion code (constant)

const NucleicAcid* Nucleotide::getNucleicAcid  )  const throw ()
 

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* Nucleotide::getNucleicAcid  )  throw ()
 

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 Nucleotide::insert Atom atom  )  throw ()
 

Insert an atom after the last position.

Parameters:
atom the atom to insert

Reimplemented from AtomContainer.

void Nucleotide::insertAfter Atom atom,
Composite after
throw ()
 

Insert an atom after a given Composite object.

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

Reimplemented from AtomContainer.

void Nucleotide::insertBefore Atom atom,
Composite before
throw ()
 

Insert an atom before a given Composite object.

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

Reimplemented from AtomContainer.

bool Nucleotide::is3Prime  )  const throw ()
 

Test if this instance nucleotide is 3-prime.

Returns true, if this instance is the first nucleotide in its parent NucleicAcid.

Returns:
bool

bool Nucleotide::is5Prime  )  const throw ()
 

Test if this instance nucleotide is 5-prime.

Returns true, if this instance is the last nucleotide in its parent NucleicAcid.

Returns:
bool

bool Nucleotide::isTerminal  )  const throw ()
 

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 Nucleotide::isValid  )  const throw () [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 AtomContainer.

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

Inequality operator.

See also:
operator ==

Nucleotide& Nucleotide::operator= const Nucleotide nucleotide  )  throw ()
 

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 Nucleotide::operator== const Nucleotide nucleotide  )  const throw ()
 

Equality operator.

Two nucleotides are equal if they have the same handle.

See also:
Object::operator ==.

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

Reads a Nucleotide object from a persistent stream.

Parameters:
pm the persistence manager

Reimplemented from Fragment.

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

void Nucleotide::prepend Atom atom  )  throw ()
 

Prepend an atom at position 0.

Parameters:
atom the atom to prepend

Reimplemented from AtomContainer.

bool Nucleotide::remove Atom atom  )  throw ()
 

Remove an atom.

Parameters:
atom the atom to remove

Reimplemented from AtomContainer.

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

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 Nucleotide::setID const String id  )  throw ()
 

Set the ID of the nucleotide.

Parameters:
id the new ID

void Nucleotide::setInsertionCode char  insertion_code  )  throw ()
 

Set the insertion code of the nucleotide.

Parameters:
insertion_code the new insertion code

void Nucleotide::splice Nucleotide nucleotide  )  throw ()
 

Move the children of nucleotide into this instance.

The children are inserted using spliceBefore .

void Nucleotide::spliceAfter Nucleotide nucleotide  )  throw ()
 

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

Parameters:
nucleotide the nucleotide to access

void Nucleotide::spliceBefore Nucleotide nucleotide  )  throw ()
 

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

Parameters:
nucleotide the nucleotide to access

void Nucleotide::swap Nucleotide nucleotide  )  throw ()
 

Swapping of instaces of nucleotide.

Parameters:
nucleotide the instance of nucleotide to swap with