BALL::Nucleotide Class Reference
[Molecular Datastructures]

Nucleotide class. More...

#include <nucleotide.h>

Inheritance diagram for BALL::Nucleotide:
Inheritance graph
[legend]

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
Equality operator.
bool operator!= (const Nucleotide &nucleotide) const
Inequality operator.
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)
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)
Assignment with cloning facility.
Nucleotide & operator= (const Nucleotide &nucleotide)
Assignment operator.
void get (Nucleotide &nucleotide, bool deep=true) const
Copy this instance to nucleotide .
void swap (Nucleotide &nucleotide)
Swapping of instaces of nucleotide.
Accessors
NucleicAcid * getNucleicAcid ()
Get a pointer to the parent NucleicAcid.
const NucleicAcid * getNucleicAcid () const
Get a pointer to the parent NucleicAcid.
void setID (const String &id)
Set the ID of the nucleotide.
const String & getID () const
Retrieve the ID of the nucleotide.
void setInsertionCode (char insertion_code)
Set the insertion code of the nucleotide.
char getInsertionCode () const
Retrieve the insertion code of the nucleotide.
void prepend (Atom &atom)
Prepend an atom at position 0.
void append (Atom &atom)
Append an atom after the last position.
void insert (Atom &atom)
Insert an atom after the last position.
void insertBefore (Atom &atom, Composite &before)
Insert an atom before a given Composite object.
void insertAfter (Atom &atom, Composite &after)
Insert an atom after a given Composite object.
bool remove (Atom &atom)
Remove an atom.
void spliceBefore (Nucleotide &nucleotide)
Cut all children of nucleotide and prepend them before the children of this instance.
void spliceAfter (Nucleotide &nucleotide)
Cut all children of nucleotide and append them after the children of this instance.
void splice (Nucleotide &nucleotide)
Move the children of nucleotide into this instance.
Predicates
bool isTerminal () const
Test if this instance nucleotide is terminal.
bool is3Prime () const
Test if this instance nucleotide is 3-prime.
bool is5Prime () const
Test if this instance nucleotide is 5-prime.
Debugging and Diagnostics
virtual bool isValid () const
Internal state and consistency self-validation.
virtual void dump (std::ostream &s=std::cout, Size depth=0) const
Internal state dump.

Detailed Description

Nucleotide class.

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


Member Function Documentation

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::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 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 ( Atom & atom )

Insert an atom after the last position.

Parameters:
atom the atom to insert

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 ( 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::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 ( Atom & atom )

Prepend an atom at position 0.

Parameters:
atom the atom to prepend

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 ( Nucleotide & nucleotide )

Move the children of nucleotide into this instance.

The children are inserted using spliceBefore .

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 ( 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

Generated on Thu Aug 6 18:30:31 2009 for BALL by doxygen 1.5.8