00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: nucleicAcid.h,v 1.35 2005/10/23 12:02:19 oliver Exp $ 00005 // 00006 00007 #ifndef BALL_KERNEL_NUCLEICACID_H 00008 #define BALL_KERNEL_NUCLEICACID_H 00009 00010 #ifndef BALL_KERNEL_MOLECULE_H 00011 # include <BALL/KERNEL/molecule.h> 00012 #endif 00013 00014 #ifndef BALL_KERNEL_NUCLEOTIDE_H 00015 # include <BALL/KERNEL/nucleotide.h> 00016 #endif 00017 00018 #define BALL_NUCLEICACID_DEFAULT_ID "" 00019 00020 namespace BALL 00021 { 00029 class BALL_EXPORT NucleicAcid 00030 : public Molecule 00031 { 00032 public: 00033 00034 BALL_CREATE_DEEP(NucleicAcid) 00035 00036 00039 00040 00042 enum Property 00043 { 00044 NUMBER_OF_PROPERTIES = Molecule::NUMBER_OF_PROPERTIES 00045 }; 00046 00048 00051 00054 NucleicAcid(); 00055 00058 NucleicAcid(const NucleicAcid& nucleic_acid, bool deep = true); 00059 00062 NucleicAcid(const String& name, 00063 const String& id = BALL_NUCLEICACID_DEFAULT_ID); 00064 00067 virtual ~NucleicAcid(); 00068 00071 virtual void clear(); 00072 00076 virtual void destroy(); 00077 00079 00082 00086 void persistentWrite(PersistenceManager& pm, const char* name = 0) const 00087 throw(Exception::GeneralException); 00088 00092 void persistentRead(PersistenceManager& pm) 00093 throw(Exception::GeneralException); 00094 00096 00099 00105 void set(const NucleicAcid& nucleic_acid, bool deep = true); 00106 00109 NucleicAcid& operator = (const NucleicAcid& nucleic_acid); 00110 00113 void get(NucleicAcid& nucleic_acid, bool deep = true) const; 00114 00117 void swap(NucleicAcid& nucleic_acid); 00118 00120 00125 bool operator == (const NucleicAcid& nucleic_acid) const; 00126 00130 bool operator != (const NucleicAcid& nucleic_acid) const; 00131 00134 00142 Nucleotide* getNucleotide(Position position); 00143 00151 const Nucleotide* getNucleotide(Position position) const; 00152 00157 Nucleotide* get3Prime(); 00158 00163 const Nucleotide* get3Prime() const; 00164 00169 Nucleotide* get5Prime(); 00170 00175 const Nucleotide* get5Prime() const; 00176 00180 void setID(const String& id); 00181 00185 const String& getID() const; 00186 00190 Size countNucleotides() const; 00191 00193 00194 #ifdef BALL_CFG_USING_METHOD_DIRECTIVE 00195 using Molecule::prepend; 00196 using Molecule::append; 00197 using Molecule::insert; 00198 using Molecule::insertBefore; 00199 using Molecule::insertAfter; 00200 using Molecule::remove; 00201 using Molecule::splice; 00202 using Molecule::spliceBefore; 00203 using Molecule::spliceAfter; 00204 #else 00205 Molecule::prepend; 00206 Molecule::append; 00207 Molecule::insert; 00208 Molecule::insertBefore; 00209 Molecule::insertAfter; 00210 Molecule::remove; 00211 Molecule::splice; 00212 Molecule::spliceBefore; 00213 Molecule::spliceAfter; 00214 #endif 00215 00219 00225 virtual bool isValid() const; 00226 00234 virtual void dump(std::ostream& s = std::cout, Size depth = 0) const; 00235 00237 00238 // --- EXTERNAL ITERATORS 00239 00240 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Nucleotide) 00241 00242 00243 private: 00244 00245 // --- ATTRIBUTES 00246 00247 String id_; 00248 }; 00249 } // namespace BALL 00250 00251 #endif // BALL_KERNEL_NUCLEICACID_H