protein.h

Go to the documentation of this file.
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* getNTerminal();
00183 
00189     const Residue* getNTerminal() const;
00190 
00196     Residue* getCTerminal();
00197 
00203     const Residue* getCTerminal() const;
00204 
00210     PDBAtom* getPDBAtom(Position position);
00211 
00217     const PDBAtom* getPDBAtom(Position position) const;
00218 
00222     void setID(const String& id);
00223 
00227     const String& getID() const;
00228 
00232     Size countChains() const;
00233 
00237     Size countSecondaryStructures() const;
00238 
00242     Size countResidues() const;
00243 
00247     Size countPDBAtoms() const;
00248 
00250 
00251     using Molecule::prepend;
00252     using Molecule::append;
00253     using Molecule::insert;
00254     using Molecule::insertBefore;
00255     using Molecule::insertAfter;
00256     using Molecule::remove;
00257     using Molecule::splice;
00258     using Molecule::spliceBefore;
00259     using Molecule::spliceAfter;
00260 
00264 
00269     virtual bool isValid() const;
00270 
00277     virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
00278 
00280 
00281     // --- EXTERNAL ITERATORS
00282 
00283     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Chain)
00284     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(SecondaryStructure)
00285     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Residue)
00286     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(PDBAtom)
00287 
00288     
00289     private:
00290 
00291     // --- ATTRIBUTES
00292 
00293     String id_;
00294   };
00295 } // namespace BALL
00296 
00297 #endif // BALL_KERNEL_PROTEIN_H