00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "ResizeArray.h"
00022 #include "Molecule.h"
00023
00024 class AtomSel;
00025 class Matrix4;
00026 class MoleculeList;
00027
00028 #define MEASURE_NOERR 0
00029 #define MEASURE_ERR_NOSEL -1
00030 #define MEASURE_ERR_NOATOMS -2
00031 #define MEASURE_ERR_BADWEIGHTNUM -3
00032 #define MEASURE_ERR_NOWEIGHT -4
00033 #define MEASURE_ERR_NOCOM -4
00034 #define MEASURE_ERR_NOMINMAXCOORDS -4
00035 #define MEASURE_ERR_NORGYR -4
00036 #define MEASURE_ERR_BADWEIGHTSUM -5
00037 #define MEASURE_ERR_NOMOLECULE -6
00038 #define MEASURE_ERR_BADWEIGHTPARM -7
00039 #define MEASURE_ERR_NONNUMBERPARM -8
00040 #define MEASURE_ERR_MISMATCHEDCNT -9
00041 #define MEASURE_ERR_RGYRMISMATCH -10
00042 #define MEASURE_ERR_NOFRAMEPOS -11
00043 #define MEASURE_ERR_NONZEROJACOBI -12
00044 #define MEASURE_ERR_GENERAL -13
00045 #define MEASURE_ERR_NORADII -14
00046 #define MEASURE_ERR_BADORDERINDEX -15
00047 #define MEASURE_ERR_NOTSUP -16
00048 #define MEASURE_ERR_BADFRAMERANGE -17
00049 #define MEASURE_ERR_MISMATCHEDMOLS -18
00050 #define MEASURE_ERR_REPEATEDATOM -19
00051 #define MEASURE_ERR_NOFRAMES -20
00052 #define MEASURE_ERR_BADATOMID -21
00053 #define MEASURE_ERR_BADCUTOFF -22
00054 #define MEASURE_ERR_ZEROGRIDSIZE -23
00055
00056 #define MEASURE_BOND 2
00057 #define MEASURE_ANGLE 3
00058 #define MEASURE_DIHED 4
00059 #define MEASURE_IMPRP 5
00060 #define MEASURE_VDW 6
00061 #define MEASURE_ELECT 7
00062
00063
00064 enum {MEASURE_DIST_RMSD=0,
00065 MEASURE_DIST_FITRMSD,
00066 MEASURE_DIST_RGYRD,
00067 MEASURE_DIST_CUSTOM,
00068 MEASURE_NUM_DIST};
00069
00070 extern const char *measure_error(int errnum);
00071
00072
00073 extern int measure_move(const AtomSel *sel, float *framepos,
00074 const Matrix4 &mat);
00075
00076
00077 extern int measure_avpos(const AtomSel *sel, MoleculeList *mlist,
00078 int start, int end, int step, float *avpos);
00079
00080
00081
00082
00083 extern int measure_center(const AtomSel *sel, const float *framepos,
00084 const float *weight, float *com);
00085
00086
00087
00088
00089
00090 extern int measure_center_perresidue(MoleculeList *mlist, const AtomSel *sel,
00091 const float *framepos,
00092 const float *weight, float *com);
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104 extern int measure_dipole(const AtomSel *sel, MoleculeList *mlist,
00105 float *dipole, int unitsdebye, int usecenter);
00106
00107 extern int measure_hbonds(Molecule *mol, AtomSel *sel1, AtomSel *sel2,
00108 double cut, double maxangle, int *donlist,
00109 int *hydlist, int *acclist, int maxsize);
00110
00111
00112
00113
00114
00115
00116
00117 extern int measure_fit(const AtomSel *sel1, const AtomSel *sel2,
00118 const float *x, const float *y, const float *weight,
00119 const int *order, Matrix4 *mat);
00120
00121
00122
00123
00124
00125 extern int measure_minmax(int num, const int *on, const float *framepos,
00126 const float *radii,
00127 float *min_coord, float *max_coord);
00128
00129
00130
00131 extern int measure_rgyr(const AtomSel *sel, MoleculeList *mlist,
00132 const float *weight, float *rgyr);
00133
00134
00135
00136
00137 extern int measure_rmsd(const AtomSel *sel1, const AtomSel *sel2,
00138 int num, const float *f1, const float *f2,
00139 float *weight, float *rmsd);
00140
00141
00142
00143
00144 extern int measure_rmsd_perresidue(const AtomSel *sel1, const AtomSel *sel2,
00145 MoleculeList *mlist, int num,
00146 float *weight, float *rmsd);
00147
00148
00149
00150
00151 extern int measure_rmsd_qcp(VMDApp *app,
00152 const AtomSel *sel1, const AtomSel *sel2,
00153 int num, const float *f1, const float *f2,
00154 float *weight, float *rmsd);
00155
00156
00157
00158 extern int measure_rmsdmat_qcp(VMDApp *app,
00159 const AtomSel *sel, MoleculeList *mlist,
00160 int num, float *weight,
00161 int start, int end, int step,
00162 float *rmsd);
00163
00164
00165
00166
00167 extern int measure_rmsdmat_qcp_ooc(VMDApp *app,
00168 const AtomSel *sel, MoleculeList *mlist,
00169 int nfiles, const char **trjfileset,
00170 int num, float *weight,
00171 int start, int end, int step,
00172 int &framecount, float *&rmsd);
00173
00174
00175
00176 extern int FastCalcRMSDAndRotation(double *rot, double *A, float *rmsd,
00177 double E0, int len, double minScore);
00178
00179
00180 extern int measure_rmsf(const AtomSel *sel, MoleculeList *mlist,
00181 int start, int end, int step, float *rmsf);
00182
00183
00184 extern int measure_rmsf_perresidue(const AtomSel *sel, MoleculeList *mlist,
00185 int start, int end, int step, float *rmsf);
00186
00187 extern int measure_sumweights(const AtomSel *sel, int numweights,
00188 const float *weights, float *weightsum);
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200 extern int measure_sasa(const AtomSel *sel, const float *framepos,
00201 const float *radius, float srad, float *sasa, ResizeArray<float> *pts,
00202 const AtomSel *restrictsel, const int *nsamples);
00203
00204
00205 extern int measure_sasalist(MoleculeList *mlist,
00206 const AtomSel **sellist, int numsels,
00207 float srad, float *sasalist, const int *nsamples);
00208
00209
00210 extern int measure_sasa_perresidue(const AtomSel *sel, const float *framepos,
00211 const float *radius, float srad, float *sasa,
00212 ResizeArray<float> *sasapts, const AtomSel *restrictsel,
00213 const int *nsamples, int *rescount,MoleculeList *mlist);
00214
00215
00216
00217 extern int measure_cluster(AtomSel *sel, MoleculeList *mlist,
00218 const int numcluster, const int algorithm,
00219 const int likeness, const double cutoff,
00220 int *clustersize, int **clusterlist,
00221 int first, int last, int step, int selupdate,
00222 float *weights);
00223
00224
00225 extern int measure_clustsize(const AtomSel *sel, MoleculeList *mlist,
00226 const double cutoff, int *clustersize,
00227 int *clusternum, int *clusteridx,
00228 int minsize, int numshared, int usepbc);
00229
00230
00231 extern int measure_gofr(AtomSel *sel1, AtomSel *sel2,
00232 MoleculeList *mlist,
00233 const int count_h, double *gofr, double *numint,
00234 double *histog, const float delta,
00235 int first, int last, int step, int *framecntr,
00236 int usepbc, int selupdate);
00237
00238
00239 extern int measure_rdf(VMDApp *app,
00240 AtomSel *sel1, AtomSel *sel2,
00241 MoleculeList *mlist,
00242 const int count_h, double *gofr, double *numint,
00243 double *histog, const float delta,
00244 int first, int last, int step, int *framecntr,
00245 int usepbc, int selupdate);
00246
00247 int measure_geom(MoleculeList *mlist, int *molid, int *atmid, ResizeArray<float> *gValues,
00248 int frame, int first, int last, int defmolid, int geomtype);
00249
00250
00251 int calculate_bond(MoleculeList *mlist, int *molid, int *atmid, float *value);
00252
00253
00254 int calculate_angle(MoleculeList *mlist, int *molid, int *atmid, float *value);
00255
00256
00257 int calculate_dihed(MoleculeList *mlist, int *molid, int *atmid, float *value);
00258
00259
00260
00261 int check_mol(Molecule *mol, int a);
00262
00263
00264
00265 int normal_atom_coord(Molecule *m, int a, float *pos);
00266
00267 int measure_energy(MoleculeList *mlist, int *molid, int *atmid, int natoms, ResizeArray<float> *gValues,
00268 int frame, int first, int last, int defmolid, double *params, int geomtype);
00269 int compute_bond_energy(MoleculeList *mlist, int *molid, int *atmid, float *energy,
00270 float k, float x0);
00271 int compute_angle_energy(MoleculeList *mlist, int *molid, int *atmid, float *energy,
00272 float k, float x0, float kub, float s0);
00273 int compute_dihed_energy(MoleculeList *mlist, int *molid, int *atmid, float *energy,
00274 float k, int n, float delta);
00275 int compute_imprp_energy(MoleculeList *mlist, int *molid, int *atmid, float *energy,
00276 float k, float x0);
00277 int compute_vdw_energy(MoleculeList *mlist, int *molid, int *atmid, float *energy,
00278 float rmin1, float eps1, float rmin2, float eps2, float cutoff, float switchdist);
00279 int compute_elect_energy(MoleculeList *mlist, int *molid, int *atmid, float *energy,
00280 float q1, float q2, bool flag1, bool flag2, float cutoff);
00281
00282
00283
00284 int measure_pbc2onc(MoleculeList *mlist, int molid, int frame, const float *center, Matrix4 &transform);
00285
00286
00287 void get_transform_to_orthonormal_cell(const float *cell, const float center[3], Matrix4 &transform);
00288
00289
00290 int measure_pbc_neighbors(MoleculeList *mlist, AtomSel *sel, int molid,
00291 int frame, const Matrix4 *alignment,
00292 const float *center, const float *cutoff, const float *box,
00293 ResizeArray<float> *extcoord_array,
00294 ResizeArray<int> *indexmap_array);
00295
00296
00297 int compute_pbcminmax(MoleculeList *mlist, int molid, int frame,
00298 const float *center, const Matrix4 *transform,
00299 float *min, float *max);
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309 extern int measure_surface(AtomSel *sel, MoleculeList *mlist,
00310 const float *framepos,
00311 const double gridsz,
00312 const double radius,
00313 const double sel_dist,
00314 int **surface, int *n_surf);
00315
00316
00317
00318
00319
00320 extern int measure_inertia(AtomSel *sel, MoleculeList *mlist, const float *coor, float rcom[3],
00321 float priaxes[3][3], float itensor[4][4], float evalue[3]);
00322