00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 00005 #ifndef BALL_KERNEL_PROTEIN_H 00006 #define BALL_KERNEL_PROTEIN_H 00007 00008 #ifndef BALL_KERNEL_CHAINITERATOR_H 00009 # include <BALL/KERNEL/chainIterator.h> 00010 #endif 00011 00012 #ifndef BALL_KERNEL_MOLECULE_H 00013 # include <BALL/KERNEL/molecule.h> 00014 #endif 00015 00016 #define BALL_PROTEIN_DEFAULT_ID "" 00017 00018 namespace BALL 00019 { 00028 class BALL_EXPORT Protein 00029 : public Molecule 00030 { 00031 public: 00032 00033 BALL_CREATE_DEEP(Protein) 00034 00035 00038 00039 00041 enum Property 00042 { 00043 NUMBER_OF_PROPERTIES = Molecule::NUMBER_OF_PROPERTIES 00044 }; 00045 00047 00050 00052 Protein(); 00053 00055 Protein(const Protein& protein, bool deep = true); 00056 00058 Protein(const String& name, const String& id = BALL_PROTEIN_DEFAULT_ID); 00059 00061 virtual ~Protein(); 00062 00064 virtual void clear(); 00065 00066 /* Clears the contents of the protein and removes it from all composite structures. 00067 */ 00068 virtual void destroy(); 00069 00071 00074 00078 void persistentWrite(PersistenceManager& pm, const char* name = 0) const; 00079 00083 void persistentRead(PersistenceManager& pm); 00084 00086 00089 00095 void set(const Protein& protein, bool deep = true); 00096 00101 Protein& operator = (const Protein& protein); 00102 00107 void get(Protein& protein, bool deep = true) const; 00108 00112 void swap(Protein& protein); 00113 00115 00120 bool operator == (const Protein& protein) const; 00121 00125 bool operator != (const Protein& protein) const; 00126 00130 00136 Chain* getChain(Position position); 00137 00143 const Chain* getChain(Position position) const; 00144 00150 SecondaryStructure* getSecondaryStructure(Position position); 00151 00157 const SecondaryStructure* getSecondaryStructure(Position position) const; 00158 00164 Residue* getResidue(Position position); 00165 00171 const Residue* getResidue(Position position) const; 00172 00178 Residue* getResidueByID(String residue_ID); 00179 00185 const Residue* getResidueByID(String residue_ID) const; 00186 00192 Residue* getNTerminal(); 00193 00199 const Residue* getNTerminal() const; 00200 00206 Residue* getCTerminal(); 00207 00213 const Residue* getCTerminal() const; 00214 00220 PDBAtom* getPDBAtom(Position position); 00221 00227 const PDBAtom* getPDBAtom(Position position) const; 00228 00232 void setID(const String& id); 00233 00237 const String& getID() const; 00238 00242 Size countChains() const; 00243 00247 Size countSecondaryStructures() const; 00248 00252 Size countResidues() const; 00253 00257 Size countPDBAtoms() const; 00258 00260 00261 using Molecule::prepend; 00262 using Molecule::append; 00263 using Molecule::insert; 00264 using Molecule::insertBefore; 00265 using Molecule::insertAfter; 00266 using Molecule::remove; 00267 using Molecule::splice; 00268 using Molecule::spliceBefore; 00269 using Molecule::spliceAfter; 00270 00274 00279 virtual bool isValid() const; 00280 00287 virtual void dump(std::ostream& s = std::cout, Size depth = 0) const; 00288 00290 00291 // --- EXTERNAL ITERATORS 00292 00293 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Chain) 00294 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(SecondaryStructure) 00295 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Residue) 00296 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(PDBAtom) 00297 00298 00299 private: 00300 00301 // --- ATTRIBUTES 00302 00303 String id_; 00304 }; 00305 } // namespace BALL 00306 00307 #endif // BALL_KERNEL_PROTEIN_H