Victor
 All Data Structures Functions Variables Friends Pages
Protein.h
1 /* This file is part of Victor.
2 
3  Victor is free software: you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation, either version 3 of the License, or
6  (at your option) any later version.
7 
8  Victor is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with Victor. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 
18 #ifndef PROTEIN_H
19 #define PROTEIN_H
20 
21 // Includes:
22 #include <Component.h>
23 #include <Polymer.h>
24 #include <Spacer.h>
25 #include <LigandSet.h>
26 
27 namespace Victor { namespace Biopool {
28 
36  class Protein : public Polymer {
37  public:
38 
39  // CONSTRUCTORS/DESTRUCTOR:
40  Protein();
41  Protein(const Protein& orig);
42  virtual ~Protein();
43 
44  // PREDICATES:
45 
46  virtual string getClassName() const {
47  return "Protein";
48  }
49  Polymer& getPolymer(unsigned int n);
50  Spacer* getSpacer(char c); //return a pointer to the Spacer with the correct chainID
51  Spacer* getSpacer(unsigned int n);
52 
53  LigandSet* getLigandSet(char c); //return a pointer to the LigandSet with the correct chainID(NULL if not exist)
54  LigandSet* getLigandSet(unsigned int n);
55 
56  const unsigned int sizeProtein() const;
57  unsigned int getChainNum(char c);
58  char getChainLetter(unsigned int i);
59  vector <char> getAllChains();
60 
61  void save(Saver& s); // data saver
62 
63  // MODIFIERS:
64  void addChain(char c);
65  void insertComponent(Component* c);
66  void setChainSelection();
67  void removeComponent(Component* c);
68  void deleteComponent(Component* c);
69 
70  void copy(const Protein& orig);
71  void load(Loader& l); // data loader
72 
73  virtual Protein* clone();
74 
75  // OPERATORS:
76  Protein& operator=(const Protein& orig);
77  Polymer& operator[](unsigned int n);
78  //const Polymer& operator[](unsigned int n) const;
79 
80  protected:
81  // HELPERS:
82  void printComponents();
83  // ATTRIBUTES
84  private:
85  vector<char> chains;
86 
87  };
88  // ---------------------------------------------------------------------------
89  // Protein
90  // -----------------x-------------------x-------------------x-----------------
91 
92  //PREDICATES
93 
94  inline const unsigned int Protein::sizeProtein() const {
95  return components.size();
96  }
97 
98  inline vector<char>Protein::getAllChains() {
99  return chains;
100  }
101 
102  inline void Protein::save(Saver& s) {
103  s.saveProtein(*this);
104  }
105 
106  // MODIFIERS
107 
108  inline void Protein::addChain(char c) {
109  chains.push_back(c);
110  }
111 
112  inline void Protein::load(Loader& l) {
113  l.loadProtein(*this);
114  }
115 
116  // OPERATORS:
117  inline Polymer&
118  Protein::operator[](unsigned int n) {
119  return getPolymer(n);
120  }
121 
122 
123 
124  // HELPERS:
125 
126 }}//namespace
127 #endif /* PROTEIN2_H */
128 
Base class for saving components (Atoms, Groups, etc.).
Definition: Saver.h:39
void removeComponent(Component *c)
Definition: Protein.cc:130
Polymer & getPolymer(unsigned int n)
Definition: Protein.cc:60
Is a container of Polymers (a component of components). Each chain in a PDB (a Protein object) corres...
Definition: Protein.h:36
Base class for composite structures.
Definition: Component.h:39
virtual Protein * clone()
Definition: Protein.cc:149
Base class for loading components (Atoms, Groups, etc.).
Definition: Loader.h:39
void insertComponent(Component *c)
Definition: Protein.cc:161
class implements methods to manage the ligandSet
Definition: LigandSet.h:37
Implements methods to manage a polymer created by components.
Definition: Polymer.h:33
LigandSet * getLigandSet(char c)
Definition: Protein.cc:85
unsigned int getChainNum(char c)
Definition: Protein.cc:109
void deleteComponent(Component *c)
Definition: Protein.cc:136
char getChainLetter(unsigned int i)
Definition: Protein.cc:121
Implements a "Spacer" for a protein chain. Includes methods to obtain values from the atoms and its p...
Definition: Spacer.h:42
Spacer * getSpacer(char c)
Definition: Protein.cc:49