BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
residueRotamerSet.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_STRUCTURE_RESIDUEROTAMERSET_H
6 #define BALL_STRUCTURE_RESIDUEROTAMERSET_H
7 
8 #ifndef BALL_MATHS_ANGLE_H
9  #include <BALL/MATHS/angle.h>
10 #endif
11 
12 #ifndef BALL_DATATYPE_STRING_H
13  #include <BALL/DATATYPE/string.h>
14 #endif
15 
16 #ifndef BALL_MATHS_VECTOR3_H
17  #include <BALL/MATHS/vector3.h>
18 #endif
19 
20 namespace BALL
21 {
23  class Residue;
24  template <typename Key> class HashSet;
25  template <typename Key> class StringHashMap;
26  class Atom;
27 
38  {
39  public:
40 
44  Rotamer();
46 
48  Rotamer(const Rotamer& rotamer);
49 
51  Rotamer(float new_P, float new_chi1, float new_chi2 = 0.0,
52  float new_chi3 = 0.0, float new_chi4 = 0.0);
54 
55 
59  float P;
61 
63  float chi1;
64 
66  float chi2;
67 
69  float chi3;
70 
72  float chi4;
74  };
75 
76 
88  {
89  public:
90 
94  typedef std::vector<Rotamer>::const_iterator ConstIterator;
96  typedef std::vector<Rotamer>::const_iterator const_iterator;
98  typedef std::vector<Rotamer>::iterator Iterator;
99  typedef std::vector<Rotamer>::iterator iterator;
101 
102 
107 
108 
111 
114  ResidueRotamerSet(const ResidueRotamerSet& rotamer_set);
115 
118  ResidueRotamerSet(const Residue& residue, Size number_of_torsions);
119 
122  virtual ~ResidueRotamerSet();
124 
125 
129 
132  Iterator begin()
133  {
134  return rotamers_.begin();
135  }
136 
140  {
141  return rotamers_.end();
142  }
143 
147  {
148  return rotamers_.begin();
149  }
150 
154  {
155  return rotamers_.end();
156  }
158 
162  const ResidueRotamerSet& operator = (const ResidueRotamerSet& residue_rotamer_set);
165 
169  const String& getName() const;
171 
173  bool isValid() const;
174 
176  Size getNumberOfRotamers() const;
177 
181  Size getNumberOfTorsions() const;
182 
186  void setNumberOfTorsions(Size number_of_torsions) throw(Exception::IndexOverflow);
187 
189  const Rotamer& operator [] (Position index) const throw(Exception::IndexOverflow);
190 
192  bool hasTorsionPhi() const;
193 
195  Angle getTorsionPhi() const;
196 
198  void setTorsionPhi(const Angle& phi);
199 
201  bool hasTorsionPsi() const;
202 
204  Angle getTorsionPsi() const;
205 
207  void setTorsionPsi(const Angle& psi);
209 
213  bool setTemplateResidue(const Residue& residue, Size number_of_torsions);
215 
219  bool setRotamer(Residue& residue, const Rotamer& rotamer);
220 
224  Rotamer getRotamer(const Residue& residue) const;
225 
231  const Rotamer& getRotamer(Position index) const;
232 
234  void setName(const String& name);
235 
237  void addRotamer(const Rotamer& rotamer);
238 
240  void deleteRotamer(Iterator loc);
241 
243  void deleteRotamers(Iterator begin, Iterator end);
244 
246  void sort();
248 
249 
250 
251  protected:
252 
253 
255  : std::binary_function<Rotamer, Rotamer, bool>
256  {
257  bool operator () (const Rotamer& r1, const Rotamer& r2)
258  {
259  return r1.P > r2.P;
260  }
261  };
262 
268  void addMovable_(std::vector<String>& movable, const Atom& a, const HashSet<String>& assigned_atoms);
269 
271  void setTorsionAngle_(Residue& residue, const std::vector<String>& movable, float torsion);
272 
274  bool valid_;
275 
278 
280  std::vector<Rotamer> rotamers_;
281 
283  std::vector<String> movable_atoms_chi1_;
284  std::vector<String> movable_atoms_chi2_;
285  std::vector<String> movable_atoms_chi3_;
286  std::vector<String> movable_atoms_chi4_;
287 
290 
293 
296 
299 
302 
305  };
306 
307 } // namespace BALL
308 
309 #endif // BALL_STRUCTURE_RESIDUEROTAMERSET_H
float chi2
Angle in degrees.
#define BALL_CREATE(name)
Definition: create.h:62
std::vector< String > movable_atoms_chi2_
std::vector< String > movable_atoms_chi1_
Names of the movable atoms (names) for each of the torsions.
Size number_of_torsions_
Number of valid torsions in the side chain.
std::vector< String > movable_atoms_chi4_
ConstIterator begin() const
float chi4
Angle in degrees.
float P
Probability.
std::vector< Rotamer > rotamers_
Array containing all rotamers.
std::vector< Rotamer >::iterator Iterator
StringHashMap< Vector3 > original_coordinates_
Original coordinates of the template residue.
std::vector< Rotamer >::const_iterator const_iterator
Angle phi_
The torsion phi.
const char * getName()
Definition: rtti.h:97
bool valid_
Indicates whether the instance is valid.
String name_
Name of the residue (variant name)
std::vector< Rotamer >::iterator iterator
ConstIterator end() const
std::vector< String > movable_atoms_chi3_
std::vector< Rotamer >::const_iterator ConstIterator
bool has_torsion_phi_
true if this residue rotamer set is backbone dependent
char Atom[5]
Definition: PDBdefs.h:257
bool has_torsion_psi_
true if this residue rotamer set is backbone dependent
float chi1
Angle in degrees.
#define BALL_EXPORT
Definition: COMMON/global.h:50
Angle psi_
The torsion psi.
float chi3
Angle in degrees.