BALL  1.4.1
nucleicAcid.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 
00005 #ifndef BALL_KERNEL_NUCLEICACID_H
00006 #define BALL_KERNEL_NUCLEICACID_H
00007 
00008 #ifndef BALL_KERNEL_MOLECULE_H
00009 # include <BALL/KERNEL/molecule.h>
00010 #endif
00011 
00012 #ifndef BALL_KERNEL_NUCLEOTIDE_H
00013 # include <BALL/KERNEL/nucleotide.h>
00014 #endif
00015 
00016 #define BALL_NUCLEICACID_DEFAULT_ID   ""
00017 
00018 namespace BALL 
00019 {
00027   class BALL_EXPORT NucleicAcid
00028     : public Molecule
00029   {
00030     public:
00031 
00032     BALL_CREATE_DEEP(NucleicAcid)
00033 
00034     
00037       
00038     
00040     enum Property
00041     {
00042       NUMBER_OF_PROPERTIES = Molecule::NUMBER_OF_PROPERTIES
00043     };
00044 
00046 
00049 
00052     NucleicAcid();
00053   
00056     NucleicAcid(const NucleicAcid& nucleic_acid, bool deep = true);
00057   
00060     NucleicAcid(const String& name,
00061         const String& id = BALL_NUCLEICACID_DEFAULT_ID);
00062 
00065     virtual ~NucleicAcid();
00066   
00069     virtual void clear();
00070   
00074     virtual void destroy();
00075 
00077 
00080     
00084     void persistentWrite(PersistenceManager& pm, const char* name = 0) const;
00085 
00089     void persistentRead(PersistenceManager& pm);
00090 
00092 
00095 
00101     void set(const NucleicAcid& nucleic_acid, bool deep = true);
00102 
00105     NucleicAcid& operator = (const NucleicAcid& nucleic_acid);
00106 
00109     void get(NucleicAcid& nucleic_acid, bool deep = true) const;
00110   
00113     void swap(NucleicAcid& nucleic_acid);
00114   
00116 
00121     bool operator == (const NucleicAcid& nucleic_acid) const;
00122 
00126     bool operator != (const NucleicAcid& nucleic_acid) const;
00127 
00130 
00138     Nucleotide* getNucleotide(Position position);
00139   
00147     const Nucleotide* getNucleotide(Position position) const;
00148 
00153     Nucleotide* get3Prime();
00154 
00159     const Nucleotide* get3Prime() const;
00160 
00165     Nucleotide* get5Prime();
00166 
00171     const Nucleotide* get5Prime() const;
00172 
00176     void setID(const String& id);
00177 
00181     const String& getID() const;
00182 
00186     Size countNucleotides() const;
00187 
00189 
00190     using Molecule::prepend;
00191     using Molecule::append;
00192     using Molecule::insert;
00193     using Molecule::insertBefore;
00194     using Molecule::insertAfter;
00195     using Molecule::remove;
00196     using Molecule::splice;
00197     using Molecule::spliceBefore;
00198     using Molecule::spliceAfter;
00199 
00203 
00209     virtual bool isValid() const;
00210 
00218     virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
00219 
00221 
00222     // --- EXTERNAL ITERATORS
00223 
00224     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Nucleotide)
00225     
00226 
00227     private:
00228 
00229     // --- ATTRIBUTES
00230 
00231     String id_;
00232   };
00233 } // namespace BALL
00234 
00235 #endif // BALL_KERNEL_NUCLEICACID_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines