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 using Molecule::prepend; 00195 using Molecule::append; 00196 using Molecule::insert; 00197 using Molecule::insertBefore; 00198 using Molecule::insertAfter; 00199 using Molecule::remove; 00200 using Molecule::splice; 00201 using Molecule::spliceBefore; 00202 using Molecule::spliceAfter; 00203 00207 00213 virtual bool isValid() const; 00214 00222 virtual void dump(std::ostream& s = std::cout, Size depth = 0) const; 00223 00225 00226 // --- EXTERNAL ITERATORS 00227 00228 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Nucleotide) 00229 00230 00231 private: 00232 00233 // --- ATTRIBUTES 00234 00235 String id_; 00236 }; 00237 } // namespace BALL 00238 00239 #endif // BALL_KERNEL_NUCLEICACID_H