Victor
 All Data Structures Functions Variables Friends Pages
RamachandranData.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 _RAMACHANDRANDATA_H_
19 #define _RAMACHANDRANDATA_H_
20 
21 // Includes:
22 #include <vector>
23 #include <Debug.h>
24 
25 namespace Victor { namespace Lobo {
26 
27  // Global constants, typedefs, etc. (to avoid):
28 
34  inline double sqr(double x) {
35  return x*x;
36  }
37 
43  public:
44  // CONSTRUCTORS/DESTRUCTOR:
47  virtual ~RamachandranData();
48 
49  // PREDICATES:
50  double getRandomPhi(bool noAdvance = false);
51  double getRandomPsi(bool noAdvance = false);
52 
53  static double getAngleTol() {
54  return (PHI_ANGLE_TOL + PSI_ANGLE_TOL) / 2.0;
55  }
56 
57  // MODIFIERS:
58  void copy(const RamachandranData& orig);
59  void load(istream& input);
60  void save(ostream& output);
61  void cluster(double cutoff);
62 
63  static void setAngleTol(float t) {
64  PHI_ANGLE_TOL = t;
65  PSI_ANGLE_TOL = t;
66  }
67 
68  static void setPhiAngleTol(float t) {
69  PHI_ANGLE_TOL = t;
70  }
71 
72  static void setPsiAngleTol(float t) {
73  PSI_ANGLE_TOL = t;
74  }
75 
76  // OPERATORS:
78 
79  private:
80 
81  // ATTRIBUTES:
82  static float PHI_ANGLE_TOL;
83  static float PSI_ANGLE_TOL;
84 
85  unsigned long nextRama;
86  vector<double> ramaPhi;
87  vector<double> ramaPsi;
88 
89  // HELPERS:
90 
91  double pGetRand();
92 
93  };
94 
95 
96  // ---------------------------------------------------------------------------
97  // RamachandranData
98  // -----------------x-------------------x-------------------x-----------------
99 
105  inline double RamachandranData::pGetRand() {
106  double tmp = 0.0;
107  for (unsigned int i = 0; i < 12; i++)
108  tmp += static_cast<double> (rand()) / RAND_MAX;
109 
110  return tmp - 6;
111  }
112 
113 }} // namespace
114 
115 #endif //_RAMACHANDRANDATA_H_
RamachandranData()
Definition: RamachandranData.cc:34
double getRandomPsi(bool noAdvance=false)
Definition: RamachandranData.cc:75
virtual ~RamachandranData()
Definition: RamachandranData.cc:47
double getRandomPhi(bool noAdvance=false)
Definition: RamachandranData.cc:59
void copy(const RamachandranData &orig)
Definition: RamachandranData.cc:94
This struct implements the container for ramachandran plot-like phi/psi angle combinations for the Lo...
Definition: RamachandranData.h:42
void cluster(double cutoff)
Definition: RamachandranData.cc:151
RamachandranData & operator=(const RamachandranData &orig)
Definition: RamachandranData.cc:189
void load(istream &input)
Definition: RamachandranData.cc:106
void save(ostream &output)
Definition: RamachandranData.cc:134