00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: protein.h,v 1.32 2005/10/23 12:02:20 oliver Exp $ 00005 // 00006 00007 #ifndef BALL_KERNEL_PROTEIN_H 00008 #define BALL_KERNEL_PROTEIN_H 00009 00010 #ifndef BALL_KERNEL_CHAINITERATOR_H 00011 # include <BALL/KERNEL/chainIterator.h> 00012 #endif 00013 00014 #ifndef BALL_KERNEL_MOLECULE_H 00015 # include <BALL/KERNEL/molecule.h> 00016 #endif 00017 00018 #define BALL_PROTEIN_DEFAULT_ID "" 00019 00020 namespace BALL 00021 { 00030 class BALL_EXPORT Protein 00031 : public Molecule 00032 { 00033 public: 00034 00035 BALL_CREATE_DEEP(Protein) 00036 00037 00040 00041 00043 enum Property 00044 { 00045 NUMBER_OF_PROPERTIES = Molecule::NUMBER_OF_PROPERTIES 00046 }; 00047 00049 00052 00054 Protein(); 00055 00057 Protein(const Protein& protein, bool deep = true); 00058 00060 Protein(const String& name, const String& id = BALL_PROTEIN_DEFAULT_ID); 00061 00063 virtual ~Protein(); 00064 00066 virtual void clear(); 00067 00068 /* Clears the contents of the protein and removes it from all composite structures. 00069 */ 00070 virtual void destroy(); 00071 00073 00076 00080 void persistentWrite(PersistenceManager& pm, const char* name = 0) const 00081 throw(Exception::GeneralException); 00082 00086 void persistentRead(PersistenceManager& pm) 00087 throw(Exception::GeneralException); 00088 00090 00093 00099 void set(const Protein& protein, bool deep = true); 00100 00105 Protein& operator = (const Protein& protein); 00106 00111 void get(Protein& protein, bool deep = true) const; 00112 00116 void swap(Protein& protein); 00117 00119 00124 bool operator == (const Protein& protein) const; 00125 00129 bool operator != (const Protein& protein) const; 00130 00134 00140 Chain* getChain(Position position); 00141 00147 const Chain* getChain(Position position) const; 00148 00154 SecondaryStructure* getSecondaryStructure(Position position); 00155 00161 const SecondaryStructure* getSecondaryStructure(Position position) const; 00162 00168 Residue* getResidue(Position position); 00169 00175 const Residue* getResidue(Position position) const; 00176 00182 Residue* getResidueByID(String residue_ID); 00183 00189 const Residue* getResidueByID(String residue_ID) const; 00190 00196 Residue* getNTerminal(); 00197 00203 const Residue* getNTerminal() const; 00204 00210 Residue* getCTerminal(); 00211 00217 const Residue* getCTerminal() const; 00218 00224 PDBAtom* getPDBAtom(Position position); 00225 00231 const PDBAtom* getPDBAtom(Position position) const; 00232 00236 void setID(const String& id); 00237 00241 const String& getID() const; 00242 00246 Size countChains() const; 00247 00251 Size countSecondaryStructures() const; 00252 00256 Size countResidues() const; 00257 00261 Size countPDBAtoms() const; 00262 00264 00265 using Molecule::prepend; 00266 using Molecule::append; 00267 using Molecule::insert; 00268 using Molecule::insertBefore; 00269 using Molecule::insertAfter; 00270 using Molecule::remove; 00271 using Molecule::splice; 00272 using Molecule::spliceBefore; 00273 using Molecule::spliceAfter; 00274 00278 00283 virtual bool isValid() const; 00284 00291 virtual void dump(std::ostream& s = std::cout, Size depth = 0) const; 00292 00294 00295 // --- EXTERNAL ITERATORS 00296 00297 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Chain) 00298 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(SecondaryStructure) 00299 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Residue) 00300 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(PDBAtom) 00301 00302 00303 private: 00304 00305 // --- ATTRIBUTES 00306 00307 String id_; 00308 }; 00309 } // namespace BALL 00310 00311 #endif // BALL_KERNEL_PROTEIN_H