-
Notifications
You must be signed in to change notification settings - Fork 3
/
eval.h
277 lines (237 loc) · 10.8 KB
/
eval.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
/*
$Id: eval.h,v 1.32 2014/06/12 01:44:07 mp Exp $
AutoDock
Copyright (C) 2009 The Scripps Research Institute. All rights reserved.
AutoDock is a Trade Mark of The Scripps Research Institute.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/********************************************************************
The header file for the eval class
rsh 09/06/95
********************************************************************/
#ifndef _EVAL_H
#define _EVAL_H
#include <stdio.h>
#include "structs.h"
#include "rep.h"
#include "qmultiply.h"
#include "cnv_state_to_coords.h"
#include "trilinterp.h"
#include "eintcal.h"
#include "energy.h"
#ifdef DEBUG
extern FILE *logFile;
#endif
#if defined(USING_COLINY)
void make_state_from_rep(const double *const x, const int n, State *const now);
#endif
void make_state_from_rep(const Representation *const *const rep, State *const stateNow, int outlev, FILE *logFile);
class Eval
{
private:
// the following are constant for a particular receptor-ligand docking
// and so can be shared read-only by concurrent evaluations:
unsigned int num_evals;
int natom, Nnb;
int *Nnb_array;
GridMapSetInfo *info;
MapType *map;
Boole B_calcIntElec, B_isGaussTorCon, B_ShowTorE;
unsigned short *US_TorE, (*US_torProfile)[NTORDIVS]; // unused? M Pique
int *type, (*tlist)[MAX_ATOMS];
NonbondParam *nonbondlist;
Real *charge, *abs_charge, *qsp_abs_charge;
Real (*crd)[SPACE], (*vt)[SPACE];
EnergyTables *ptr_ad_energy_tables;
Boole *B_isTorConstrained;
Molecule mol;
int *ignore_inter; // [MAX_ATOMS] gmm 2002-05-21, for CA, CB in flexible sidechains
Boole B_include_1_4_interactions; // gmm 2005-01-8, for scaling 1-4 nonbonds
Real scale_1_4; // gmm 2005-01-8, for scaling 1-4 nonbonds
Real scale_eintermol; // for scaling intermolecular energy term
//ParameterEntry *parameterArray;
Real unbound_internal_FE;
Boole B_compute_intermol_energy; // use for computing unbound state
Boole B_use_non_bond_cutoff; // set this to FALSE if we are computing unbound extended conformations
Boole B_have_flexible_residues;
int true_ligand_atoms;
int outlev;
// the following are not constant for a particular ligand docking
// and so must be allocated in cases of concurrent evaluations:
State stateNow;
Real (*crdpdb)[SPACE];
EnergyComponent *peratomE; // output if not NULL - intermolecular energies
GroupEnergy *group_energy;
FILE *logFile;
public:
Eval(void);
void setup( /* not const */ Real init_crd[MAX_ATOMS][SPACE], // not const since pointers are copied, not contents
/* not const */ Real init_charge[MAX_ATOMS],
/* not const */ Real init_abs_charge[MAX_ATOMS],
/* not const */ Real init_qsp_abs_charge[MAX_ATOMS],
/* not const */ int init_type[MAX_ATOMS], int init_natom,
GridMapSetInfo *init_info,
MapType *init_map,
EnergyComponent *peratomE, // output if not NULL - intermolecular energies
/* not const */ NonbondParam *init_nonbondlist,
/* not const */ EnergyTables *init_ptr_ad_energy_tables,
const int init_Nnb,
int *init_Nnb_array,
GroupEnergy *init_group_energy,
const Boole init_B_calcIntElec,
const Boole init_B_isGaussTorCon,
/* not const */ Boole init_B_isTorConstrained[MAX_TORS],
const Boole init_B_ShowTorE,
/* not const */ unsigned short init_US_TorE[MAX_TORS],
/* not const */ unsigned short init_US_torProfile[MAX_TORS][NTORDIVS],
/* not const */ Real init_vt[MAX_TORS][SPACE],
/* not const */ int init_tlist[MAX_TORS+1][MAX_ATOMS],
/* not const */ Real init_crdpdb[MAX_ATOMS][SPACE],
const State& stateInit,
const Molecule& molInit,
/* not const */ int init_ignore_inter[MAX_ATOMS], // values are copied
const Boole init_B_include_1_4_interactions, // gmm 2005-01-8, for scaling 1-4 nonbonds
ConstReal init_scale_1_4, // gmm 2005-01-8, for scaling 1-4 nonbonds
ConstReal init_scale_eintermol,
ConstReal init_unbound_internal_FE,
const Boole init_B_use_non_bond_cutoff, // set this to FALSE if we are computing unbound extended conformations
const Boole init_B_have_flexible_residues,
int init_true_ligand_atoms,
int init_outlev,
FILE *init_logFile
);
void update_crdpdb( Real init_crdpdb[MAX_ATOMS][SPACE],
Real init_vt[MAX_TORS][SPACE] );
double operator()(const Representation *const *const );
double operator()(const Representation *const *const , int); // GMM - allows calculation of a particular term of the total energy
#if defined(USING_COLINY)
double operator()(double*, int);
#endif
double eval(); // WEH - a basic change that facilitates the use of Coliny
double eval(const int); // GMM - allows calculation of a particular term of the total energy
unsigned int evals(void);
void reset(void);
int write(const Representation *const *const rep, const int true_ligand_atoms, const int outlev, FILE *logFile);
void compute_intermol_energy(const Boole init_B_compute_intermol_energy); // for computing unbound state
};
inline Eval::Eval(void)
: num_evals(0)
{
}
inline void Eval::setup(/* not const */ Real init_crd[MAX_ATOMS][SPACE], // not const since pointers are copied, not values
/* not const */ Real init_charge[MAX_ATOMS],
/* not const */ Real init_abs_charge[MAX_ATOMS],
/* not const */ Real init_qsp_abs_charge[MAX_ATOMS],
/* not const */ int init_type[MAX_ATOMS],
const int init_natom,
GridMapSetInfo *const init_info,
MapType *init_map,
EnergyComponent *init_peratomE, // output if not NULL - intermolecular energies
/* not const */ NonbondParam *const init_nonbondlist,
/* not const */ EnergyTables *const init_ptr_ad_energy_tables,
const int init_Nnb,
int *init_Nnb_array,
GroupEnergy *init_group_energy,
const Boole init_B_calcIntElec,
const Boole init_B_isGaussTorCon,
/* not const */ Boole init_B_isTorConstrained[MAX_TORS], // values are not copied but pointers
const Boole init_B_ShowTorE,
/* not const */ unsigned short init_US_TorE[MAX_TORS],
/* not const */ unsigned short init_US_torProfile[MAX_TORS][NTORDIVS],
/* not const */ Real init_vt[MAX_TORS][SPACE],
/* not const */ int init_tlist[MAX_TORS+1][MAX_ATOMS],
/* not const */ Real init_crdpdb[MAX_ATOMS][SPACE],
const State& stateInit,
const Molecule& molInit,
/* not const */ int init_ignore_inter[MAX_ATOMS],
const Boole init_B_include_1_4_interactions,
ConstReal init_scale_1_4,
ConstReal init_scale_eintermol,
ConstReal init_unbound_internal_FE,
const Boole init_B_use_non_bond_cutoff, // set this to FALSE if we are computing unbound extended conformations
const Boole init_B_have_flexible_residues,
int init_true_ligand_atoms,
int init_outlev,
FILE *init_logFile
)
{
register int i;
crd = init_crd;
charge = init_charge;
abs_charge = init_abs_charge;
qsp_abs_charge = init_qsp_abs_charge;
type = init_type;
natom = init_natom;
map = init_map;
nonbondlist = init_nonbondlist;
ptr_ad_energy_tables = init_ptr_ad_energy_tables;
Nnb = init_Nnb;
Nnb_array= init_Nnb_array;
group_energy= init_group_energy;
B_calcIntElec = init_B_calcIntElec;
B_isGaussTorCon = init_B_isGaussTorCon;
B_isTorConstrained = init_B_isTorConstrained;
B_ShowTorE = init_B_ShowTorE;
US_TorE = init_US_TorE;
US_torProfile = init_US_torProfile;
vt = init_vt;
tlist = init_tlist;
crdpdb = init_crdpdb;
// set all of the components of the State, one at a time...
copyState( &stateNow, stateInit );
#ifdef DEBUG
pr(logFile, "\n\nstateNow:\n");
printState( logFile, stateNow, 2 );
#endif
num_evals = 0;
ignore_inter = init_ignore_inter;
peratomE = init_peratomE;
static EnergyComponent zeroEC;
for (i=0; i<MAX_ATOMS; i++) {
peratomE[i] = zeroEC;
}
mol = molInit;
B_include_1_4_interactions = init_B_include_1_4_interactions;
scale_1_4 = init_scale_1_4;
scale_eintermol = init_scale_eintermol;
//parameterArray = init_parameterArray;
unbound_internal_FE = init_unbound_internal_FE;
info = init_info;
map = init_map;
B_compute_intermol_energy = TRUE; // default is "Yes, calculate the intermolecular energy".
B_use_non_bond_cutoff = init_B_use_non_bond_cutoff; // set this to FALSE if we are computing unbound extended conformations
B_have_flexible_residues = init_B_have_flexible_residues;
true_ligand_atoms = init_true_ligand_atoms;
outlev = init_outlev;
logFile = init_logFile;
}
inline void Eval::update_crdpdb( Real init_crdpdb[MAX_ATOMS][SPACE],
Real init_vt[MAX_TORS][SPACE])
{
crdpdb = init_crdpdb;
vt = init_vt;
}
inline void Eval::compute_intermol_energy(const Boole init_B_compute_intermol_energy)
// For computing the conformation and the internal energy of the unbound state.
{
B_compute_intermol_energy = init_B_compute_intermol_energy;
}
inline unsigned int Eval::evals(void)
{
return(num_evals);
}
inline void Eval::reset(void)
{
num_evals = 0;
}
#endif