1
/* Copyright (C) 2000 Damir Zucic */
3
/*=============================================================================
8
Exclude exposed polar residues which are below the plane.
11
(1) Pointer to RuntimeS structure.
12
(2) The complex index (1 = bottom, 2 = top).
15
(1) Some exposed polar residues excluded from the list.
19
(1) Positive on success.
20
(2) Negative on failure.
22
========includes:============================================================*/
27
#include <X11/Xutil.h>
29
#include <X11/Xatom.h>
34
/*======function prototypes:=================================================*/
36
void ErrorMessage_ (char *, char *, char *,
37
char *, char *, char *, char *);
38
double ScalarProduct_ (VectorS *, VectorS *);
40
/*======exclude distant residues from the list:==============================*/
42
int ExcludeDistant_ (RuntimeS *runtimeSP, int docking_complexI)
44
int exposed_polarN, exposed_polarI;
45
MolComplexS *curr_mol_complexSP;
47
ExposedResidueS *exposed_polarSP;
48
double plane_center_x, plane_center_y, plane_center_z;
49
VectorS normal_vectorS;
50
ExposedResidueS *curr_exposedSP;
55
/* Check the complex index and prepare the pointers: */
56
if (docking_complexI == 1)
58
exposed_polarN = runtimeSP->exposed_polar1N;
59
curr_mol_complexSP = runtimeSP->mol_complex1SP;
60
exposed_atomIP = runtimeSP->exposed_atom1IP;
61
exposed_polarSP = runtimeSP->exposed_polar1SP;
63
else if (docking_complexI == 2)
65
exposed_polarN = runtimeSP->exposed_polar2N;
66
curr_mol_complexSP = runtimeSP->mol_complex2SP;
67
exposed_atomIP = runtimeSP->exposed_atom2IP;
68
exposed_polarSP = runtimeSP->exposed_polar2SP;
72
ErrorMessage_ ("garlic", "RepresentativeAtoms_", "",
73
"Bad macromolecular complex index!\n",
78
/* Copy the plane center position (plane belongs to bottom complex): */
79
plane_center_x = curr_mol_complexSP->planeS.center_x[0];
80
plane_center_y = curr_mol_complexSP->planeS.center_y;
81
plane_center_z = curr_mol_complexSP->planeS.center_z[0];
83
/* Copy the normal vector (plane belongs to bottom complex): */
84
normal_vectorS.x = curr_mol_complexSP->planeS.normal_x[0];
85
normal_vectorS.y = curr_mol_complexSP->planeS.normal_y;
86
normal_vectorS.z = curr_mol_complexSP->planeS.normal_z[0];
89
for (exposed_polarI = 0; exposed_polarI < exposed_polarN; exposed_polarI++)
91
/* Pointer to the current exposed polar residue: */
92
curr_exposedSP = exposed_polarSP + exposed_polarI;
94
/* Pointer to the representative atom: */
95
curr_atomSP = curr_mol_complexSP->atomSP +
96
curr_exposedSP->representative_atomI;
98
/* Copy the atomic coordinates: */
99
x = curr_atomSP->raw_atomS.x[0];
100
y = curr_atomSP->raw_atomS.y;
101
z = curr_atomSP->raw_atomS.z[0];
103
/* Position of the atom relative to the plane center: */
104
curr_vectorS.x = x - plane_center_x;
105
curr_vectorS.y = y - plane_center_y;
106
curr_vectorS.z = z - plane_center_z;
108
/* Check the sign of the scalar product: */
109
if (ScalarProduct_ (&curr_vectorS, &normal_vectorS) < 0)
111
curr_exposedSP->excludedF = 1;
115
/* Return positive value on success: */
119
/*===========================================================================*/