Loading...
Searching...
No Matches
nucleotide.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_KERNEL_NUCLEOTIDE_H
#define BALL_KERNEL_NUCLEOTIDE_H
#ifndef BALL_KERNEL_FRAGMENT_H
# include <BALL/KERNEL/fragment.h>
#endif
#ifndef BALL_KERNEL_RESIDUE_H
# include <BALL/KERNEL/residue.h>
#endif
#ifndef BALL_KERNEL_NUCLEOTIDEITERATOR_H
# include <BALL/KERNEL/nucleotideIterator.h>
#endif
#define BALL_NUCLEOTIDE_DEFAULT_ID ""
#define BALL_NUCLEOTIDE_DEFAULT_INSERTION_CODE ' '
namespace BALL
{
class NucleicAcid;
class BALL_EXPORT Nucleotide
: public Fragment
{
public:
BALL_CREATE_DEEP(Nucleotide)
enum Property
{
PROPERTY__5_PRIME = Residue::NUMBER_OF_PROPERTIES + 1,
PROPERTY__3_PRIME,
PROPERTY__NUCLEOTIDE,
NUMBER_OF_PROPERTIES
};
Nucleotide();
Nucleotide(const Nucleotide& nucleotide, bool deep = true);
Nucleotide
(const String& name,
const String& id = BALL_NUCLEOTIDE_DEFAULT_ID,
char insertion_code = BALL_NUCLEOTIDE_DEFAULT_INSERTION_CODE);
virtual ~Nucleotide();
virtual void clear();
virtual void destroy();
void persistentWrite(PersistenceManager& pm, const char* name = 0) const;
void persistentRead(PersistenceManager& pm);
void set(const Nucleotide& nucleotide, bool deep = true);
Nucleotide& operator = (const Nucleotide& nucleotide);
void get(Nucleotide& nucleotide, bool deep = true) const;
void swap(Nucleotide& nucleotide);
bool operator == (const Nucleotide& nucleotide) const;
bool operator != (const Nucleotide& nucleotide) const;
NucleicAcid* getNucleicAcid();
const NucleicAcid* getNucleicAcid() const;
void setID(const String& id);
const String& getID() const;
void setInsertionCode(char insertion_code);
void unsetInsertionCode();
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);
bool isTerminal() const;
bool is3Prime() const;
bool is5Prime() const;
virtual bool isValid() const;
virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
private:
AtomContainer* getAtomContainer(Position position);
const AtomContainer* getAtomContainer(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;
BALL_KERNEL_DEFINE_ITERATOR_CREATORS(AtomContainer)
BALL_DECLARE_STD_ITERATOR_WRAPPER(Nucleotide, AtomContainer, atomContainers)
// --- ATTRIBUTES
String id_;
char insertion_code_;
};
template <class NucleotideContainerType>
const Nucleotide* get5Prime(const NucleotideContainerType& nucleotide_container)
{
NucleotideConstIterator res_it;
for ( res_it = nucleotide_container.beginNucleotide(); !res_it.isEnd(); ++res_it)
{
return &(*res_it);
}
return 0;
}
template <class NucleotideContainerType>
const Nucleotide* get3Prime(const NucleotideContainerType& nucleotide_container)
{
for (NucleotideConstIterator res_it = nucleotide_container.rbeginNucleotide(); !res_it.isREnd(); ++res_it)
{
return &(*res_it);
}
return 0;
}
} // namespace BALL
#endif // BALL_KERNEL_NUCLEOTIDE_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::AtomContainer
Definition atomContainer.h:32
BALL::Atom
Definition atom.h:90
BALL::Composite
Definition composite.h:74
BALL::ConstBidirectionalIterator::isEnd
BALL_INLINE bool isEnd() const
Check whether the iterator points to the position after the last item of the container.
Definition bidirectionalIterator.h:73
BALL::Fragment::Fragment
Fragment()
BALL::NucleicAcid
Definition nucleicAcid.h:29
BALL::Nucleotide
Definition nucleotide.h:37
BALL::Nucleotide::persistentWrite
void persistentWrite(PersistenceManager &pm, const char *name=0) const
BALL::Nucleotide::clear
virtual void clear()
Clears the nucleotides contents.
BALL::Nucleotide::persistentRead
void persistentRead(PersistenceManager &pm)
BALL::Nucleotide::append
void append(Atom &atom)
BALL::Nucleotide::dump
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
BALL::Nucleotide::set
void set(const Nucleotide &nucleotide, bool deep=true)
BALL::Nucleotide::insert
void insert(Atom &atom)
BALL::Nucleotide::isValid
virtual bool isValid() const
BALL::Nucleotide::setInsertionCode
void setInsertionCode(char insertion_code)
BALL::Nucleotide::getNucleicAcid
NucleicAcid * getNucleicAcid()
BALL::Nucleotide::is5Prime
bool is5Prime() const
BALL::Nucleotide::getID
const String & getID() const
BALL::Nucleotide::splice
void splice(Nucleotide &nucleotide)
BALL::Nucleotide::isTerminal
bool isTerminal() const
BALL::Nucleotide::Property
Property
Definition nucleotide.h:48
BALL::Nucleotide::NUMBER_OF_PROPERTIES
@ NUMBER_OF_PROPERTIES
Definition nucleotide.h:57
BALL::Nucleotide::PROPERTY__NUCLEOTIDE
@ PROPERTY__NUCLEOTIDE
Definition nucleotide.h:54
BALL::Nucleotide::PROPERTY__3_PRIME
@ PROPERTY__3_PRIME
Definition nucleotide.h:52
BALL::Nucleotide::PROPERTY__5_PRIME
@ PROPERTY__5_PRIME
Definition nucleotide.h:50
BALL::Nucleotide::swap
void swap(Nucleotide &nucleotide)
BALL::Nucleotide::destroy
virtual void destroy()
Clears the nucleotides contents and removes it from all composite structures.
BALL::Nucleotide::insertAfter
void insertAfter(Atom &atom, Composite &after)
BALL::Nucleotide::get
void get(Nucleotide &nucleotide, bool deep=true) const
BALL::Nucleotide::spliceAfter
void spliceAfter(Nucleotide &nucleotide)
BALL::Nucleotide::setID
void setID(const String &id)
BALL::Nucleotide::remove
bool remove(Atom &atom)
BALL::Nucleotide::Nucleotide
Nucleotide()
Default constructor.
BALL::Nucleotide::is3Prime
bool is3Prime() const
BALL::Nucleotide::insertBefore
void insertBefore(Atom &atom, Composite &before)
BALL::Nucleotide::Nucleotide
Nucleotide(const Nucleotide &nucleotide, bool deep=true)
Copy constructor.
BALL::Nucleotide::spliceBefore
void spliceBefore(Nucleotide &nucleotide)
BALL::Nucleotide::Nucleotide
Nucleotide(const String &name, const String &id=BALL_NUCLEOTIDE_DEFAULT_ID, char insertion_code=BALL_NUCLEOTIDE_DEFAULT_INSERTION_CODE)
Detailled constructor.
BALL::Nucleotide::~Nucleotide
virtual ~Nucleotide()
Destructor.
BALL::Nucleotide::getNucleicAcid
const NucleicAcid * getNucleicAcid() const
BALL::Nucleotide::unsetInsertionCode
void unsetInsertionCode()
BALL::Nucleotide::prepend
void prepend(Atom &atom)
BALL::Nucleotide::getInsertionCode
char getInsertionCode() const
BALL::PersistenceManager
Definition persistenceManager.h:73
BALL::Residue::NUMBER_OF_PROPERTIES
@ NUMBER_OF_PROPERTIES
Definition residue.h:70
BALL::String
Definition string.h:57
fragment.h
BALL_CREATE_DEEP
#define BALL_CREATE_DEEP(name)
Definition create.h:26
BALL_KERNEL_DEFINE_ITERATOR_CREATORS
#define BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Type)
Definition iterator.h:25
BALL
Definition constants.h:13
BALL::NucleotideConstIterator
ConstBidirectionalIterator< Composite, Nucleotide, Composite::CompositeIterator, NucleotideIteratorTraits > NucleotideConstIterator
Definition nucleotideIterator.h:71
BALL::atomContainers
BALL_EXPORT AtomContainerList atomContainers(const AtomContainer &fragment, bool selected_only=false)
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::get5Prime
const Nucleotide * get5Prime(const NucleotideContainerType &nucleotide_container)
Definition nucleotide.h:326
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140
BALL::get3Prime
const Nucleotide * get3Prime(const NucleotideContainerType &nucleotide_container)
Definition nucleotide.h:338
nucleotideIterator.h
BALL_NUCLEOTIDE_DEFAULT_INSERTION_CODE
#define BALL_NUCLEOTIDE_DEFAULT_INSERTION_CODE
Definition nucleotide.h:22
BALL_NUCLEOTIDE_DEFAULT_ID
#define BALL_NUCLEOTIDE_DEFAULT_ID
Definition nucleotide.h:21
residue.h
BALL_DECLARE_STD_ITERATOR_WRAPPER
#define BALL_DECLARE_STD_ITERATOR_WRAPPER(container, type, method_name)
Definition stdIteratorWrapper.h:30