BALL 1.5.0
Loading...
Searching...
No Matches
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
20namespace 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
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
60 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
95 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
115
118 ResidueRotamerSet(const Residue& residue, Size number_of_torsions);
119
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
163 const ResidueRotamerSet& operator = (const ResidueRotamerSet& residue_rotamer_set);
165
170 const String& getName() const;
171
173 bool isValid() const;
174
177
182
186 void setNumberOfTorsions(Size number_of_torsions);
187
192 const Rotamer& operator [] (Position index) const;
193
195 bool hasTorsionPhi() const;
196
199
201 void setTorsionPhi(const Angle& phi);
202
204 bool hasTorsionPsi() const;
205
208
210 void setTorsionPsi(const Angle& psi);
212
217 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
244
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
#define BALL_CREATE(name)
Definition create.h:62
char Atom[5]
Definition PDBdefs.h:257
Rotamer()
Default constructor.
float chi3
Angle in degrees.
Rotamer(float new_P, float new_chi1, float new_chi2=0.0, float new_chi3=0.0, float new_chi4=0.0)
float P
Probability.
float chi1
Angle in degrees.
Rotamer(const Rotamer &rotamer)
Copy constructor.
float chi4
Angle in degrees.
float chi2
Angle in degrees.
bool setRotamer(Residue &residue, const Rotamer &rotamer)
const String & getName() const
Get the name of the ResidueRotamerSet.
std::vector< String > movable_atoms_chi3_
void deleteRotamer(Iterator loc)
Delete the Rotamer at the given iterator location.
std::vector< Rotamer >::iterator iterator
void addMovable_(std::vector< String > &movable, const Atom &a, const HashSet< String > &assigned_atoms)
ConstIterator end() const
ConstIterator begin() const
std::vector< Rotamer > rotamers_
Array containing all rotamers.
void setName(const String &name)
Assign a new name.
void setTorsionPsi(const Angle &psi)
bool hasTorsionPhi() const
std::vector< String > movable_atoms_chi4_
bool hasTorsionPsi() const
Angle getTorsionPhi() const
bool has_torsion_phi_
true if this residue rotamer set is backbone dependent
void deleteRotamers(Iterator begin, Iterator end)
Delete the range of rotamers.
void setNumberOfTorsions(Size number_of_torsions)
String name_
Name of the residue (variant name)
bool has_torsion_psi_
true if this residue rotamer set is backbone dependent
void addRotamer(const Rotamer &rotamer)
Add a rotamer to the current set.
std::vector< String > movable_atoms_chi1_
Names of the movable atoms (names) for each of the torsions.
void setTorsionPhi(const Angle &phi)
Angle phi_
The torsion phi.
const Rotamer & getRotamer(Position index) const
Angle psi_
The torsion psi.
Size getNumberOfRotamers() const
Return the number of rotamers from this residue rotamer set.
Rotamer getRotamer(const Residue &residue) const
StringHashMap< Vector3 > original_coordinates_
Original coordinates of the template residue.
Angle getTorsionPsi() const
std::vector< Rotamer >::iterator Iterator
std::vector< Rotamer >::const_iterator const_iterator
bool valid_
Indicates whether the instance is valid
Size getNumberOfTorsions() const
Size number_of_torsions_
Number of valid torsions in the side chain.
std::vector< String > movable_atoms_chi2_
void sort()
Sort the rotamers descendingly according to their probability.
void setTorsionAngle_(Residue &residue, const std::vector< String > &movable, float torsion)
Set the torsion angles.
bool setTemplateResidue(const Residue &residue, Size number_of_torsions)
Set the template residue, name, base coordinates ...
bool isValid() const
Find out if the class instance is valid.
std::vector< Rotamer >::const_iterator ConstIterator
#define BALL_EXPORT