BALL  1.5.0
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 
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);
187 
192  const Rotamer& operator [] (Position index) const;
193 
195  bool hasTorsionPhi() const;
196 
198  Angle getTorsionPhi() const;
199 
201  void setTorsionPhi(const Angle& phi);
202 
204  bool hasTorsionPsi() const;
205 
207  Angle getTorsionPsi() const;
208 
210  void setTorsionPsi(const Angle& psi);
212 
216  bool setTemplateResidue(const Residue& residue, Size number_of_torsions);
218 
222  bool setRotamer(Residue& residue, const Rotamer& rotamer);
223 
227  Rotamer getRotamer(const Residue& residue) const;
228 
234  const Rotamer& getRotamer(Position index) const;
235 
237  void setName(const String& name);
238 
240  void addRotamer(const Rotamer& rotamer);
241 
243  void deleteRotamer(Iterator loc);
244 
246  void deleteRotamers(Iterator begin, Iterator end);
247 
249  void sort();
251 
252 
253 
254  protected:
255 
256 
258  : std::binary_function<Rotamer, Rotamer, bool>
259  {
260  bool operator () (const Rotamer& r1, const Rotamer& r2)
261  {
262  return r1.P > r2.P;
263  }
264  };
265 
271  void addMovable_(std::vector<String>& movable, const Atom& a, const HashSet<String>& assigned_atoms);
272 
274  void setTorsionAngle_(Residue& residue, const std::vector<String>& movable, float torsion);
275 
277  bool valid_;
278 
281 
283  std::vector<Rotamer> rotamers_;
284 
286  std::vector<String> movable_atoms_chi1_;
287  std::vector<String> movable_atoms_chi2_;
288  std::vector<String> movable_atoms_chi3_;
289  std::vector<String> movable_atoms_chi4_;
290 
293 
296 
299 
302 
305 
308  };
309 
310 } // namespace BALL
311 
312 #endif // BALL_STRUCTURE_RESIDUEROTAMERSET_H
BALL::Rotamer::chi3
float chi3
Angle in degrees.
Definition: residueRotamerSet.h:69
BALL::ResidueRotamerSet::RotamerProbabilityGreaterThan_
Definition: residueRotamerSet.h:257
BALL::ResidueRotamerSet::movable_atoms_chi4_
std::vector< String > movable_atoms_chi4_
Definition: residueRotamerSet.h:289
BALL::ResidueRotamerSet::has_torsion_phi_
bool has_torsion_phi_
true if this residue rotamer set is backbone dependent
Definition: residueRotamerSet.h:298
BALL_EXPORT
#define BALL_EXPORT
Definition: COMMON/global.h:50
BALL::ResidueRotamerSet::valid_
bool valid_
Indicates whether the instance is valid
Definition: residueRotamerSet.h:277
BALL::ResidueRotamerSet::ConstIterator
std::vector< Rotamer >::const_iterator ConstIterator
Definition: residueRotamerSet.h:95
BALL::Residue
Definition: residue.h:36
BALL::HashSet< String >
BALL::ResidueRotamerSet::psi_
Angle psi_
The torsion psi.
Definition: residueRotamerSet.h:307
angle.h
vector3.h
BALL::ResidueRotamerSet::movable_atoms_chi3_
std::vector< String > movable_atoms_chi3_
Definition: residueRotamerSet.h:288
BALL::StringHashMap
Definition: stringHashMap.h:40
BALL_SIZE_TYPE
BALL::ResidueRotamerSet
Definition: residueRotamerSet.h:87
BALL::ResidueRotamerSet::has_torsion_psi_
bool has_torsion_psi_
true if this residue rotamer set is backbone dependent
Definition: residueRotamerSet.h:301
BALL::ResidueRotamerSet::movable_atoms_chi2_
std::vector< String > movable_atoms_chi2_
Definition: residueRotamerSet.h:287
BALL::ResidueRotamerSet::begin
Iterator begin()
Definition: residueRotamerSet.h:132
BALL::Rotamer::chi4
float chi4
Angle in degrees.
Definition: residueRotamerSet.h:72
BALL::Atom
Definition: atom.h:87
BALL
Definition: constants.h:12
BALL::ResidueRotamerSet::name_
String name_
Name of the residue (variant name)
Definition: residueRotamerSet.h:280
BALL::String
Definition: string.h:56
BALL::Rotamer
Definition: residueRotamerSet.h:37
BALL::PDB::Atom
char Atom[5]
Definition: PDBdefs.h:257
BALL::ResidueRotamerSet::phi_
Angle phi_
The torsion phi.
Definition: residueRotamerSet.h:304
BALL::Rotamer::P
float P
Probability.
Definition: residueRotamerSet.h:60
BALL::Rotamer::chi2
float chi2
Angle in degrees.
Definition: residueRotamerSet.h:66
BALL::Rotamer::chi1
float chi1
Angle in degrees.
Definition: residueRotamerSet.h:63
BALL::ResidueRotamerSet::iterator
std::vector< Rotamer >::iterator iterator
Definition: residueRotamerSet.h:99
BALL::ResidueRotamerSet::original_coordinates_
StringHashMap< Vector3 > original_coordinates_
Original coordinates of the template residue.
Definition: residueRotamerSet.h:295
BALL::ResidueRotamerSet::number_of_torsions_
Size number_of_torsions_
Number of valid torsions in the side chain.
Definition: residueRotamerSet.h:292
string.h
BALL::TAngle< float >
BALL::ResidueRotamerSet::begin
ConstIterator begin() const
Definition: residueRotamerSet.h:146
BALL::ResidueRotamerSet::end
Iterator end()
Definition: residueRotamerSet.h:139
BALL::ResidueRotamerSet::end
ConstIterator end() const
Definition: residueRotamerSet.h:153
BALL_CREATE
#define BALL_CREATE(name)
Definition: create.h:62
BALL::ResidueRotamerSet::rotamers_
std::vector< Rotamer > rotamers_
Array containing all rotamers.
Definition: residueRotamerSet.h:283
BALL::RTTI::getName
const char * getName()
Definition: rtti.h:97
BALL::ResidueRotamerSet::Iterator
std::vector< Rotamer >::iterator Iterator
Definition: residueRotamerSet.h:98
BALL::ResidueRotamerSet::const_iterator
std::vector< Rotamer >::const_iterator const_iterator
Definition: residueRotamerSet.h:96
BALL::ResidueRotamerSet::movable_atoms_chi1_
std::vector< String > movable_atoms_chi1_
Names of the movable atoms (names) for each of the torsions.
Definition: residueRotamerSet.h:286