GLYLIB
0.3.0b
|
00001 /** \file molecules.h 00002 \brief Header file for molecule structures 00003 00004 File begun May 2007 by Lachele Foley and modified continually ever since 00005 by Lachele Foley and others, including Mike Tessier. */ 00006 00007 #if !defined(GLYLIB_MOLECULES) 00008 #define GLYLIB_MOLECULES 00009 #include <geometries.h> 00010 #include <parameter_sets.h> 00011 00012 /** \addtogroup MAIN_STRUCTURES 00013 * @{ 00014 */ 00015 char *ATYPESFILE,*RTYPESFILE,*MTYPESFILE; /**< locations of type databases, */ 00016 /* to be set internally by programs, but globally visible */ 00017 00018 typedef struct { 00019 int i; /**< general index */ 00020 int m; /**< molecule index */ 00021 int r; /**< residue index */ 00022 int a; /**< atom index */ 00023 } molindex; /**< Index to describe position in a molecule */ 00024 typedef struct { 00025 int i; /**< general index */ 00026 int E; /**< ensemble index */ 00027 int A; /**< assembly index */ 00028 int m; /**< molecule index */ 00029 int r; /**< residue index */ 00030 int a; /**< atom index */ 00031 } ensindex; /**< Index to describe position in an ensemble */ 00032 typedef struct { 00033 int nP; /**< number of positions */ 00034 molindex *P; /**< the nP relevant positions */ 00035 double s; /**< size (e.g., total length of chain) */ 00036 } molindex_set; /**< Structure holding molecule indices (for rings and such) */ 00037 00038 /* 00039 Structures for making selections. 00040 */ 00041 typedef struct { 00042 int na, *ai; ///< na atom indices and the na indices 00043 } residue_tree_index; ///< for storing indices within a structure like E[ei].m[mi].r[ri].a[ai].i 00044 typedef struct { 00045 int nr, *ri; ///< nr residue indices and the nr indices 00046 residue_tree_index *r; ///< nr residue_tree_index structures 00047 } molecule_tree_index; ///< for storing indices within a structure like E[ei].m[mi].r[ri].a[ai].i 00048 typedef struct { 00049 int nm, *mi; ///< nm molecule indices and the nm indices 00050 molecule_tree_index *m; ///< nm molecule_tree_index structures 00051 } ensemble_tree_index; ///< for storing indices within a structure like E[ei].m[mi].r[ri].a[ai].i 00052 typedef struct { 00053 int posneg; ///< Is this a positive (1), negative (-1) or brand new (0) selection set? 00054 int nmN,nmi,nmn,*mn,*mi; ///< # of molecule names, numbers & indicies, nmn numbers and nmi indices 00055 char **mN; ///< nmN names 00056 int nrN,nri,nrn,*rn,*ri; ///< # of residue names, numbers & indicies, nrn numbers and nri indices 00057 char **rN; ///< nrN names 00058 int naN,nai,nan,*an,*ai; ///< # of atom names, numbers & indicies, nan numbers and nai indices 00059 char **aN; ///< naN names 00060 } moiety_selection; 00061 00062 00063 typedef struct { 00064 ensindex s; ///< "source" -- index to first atom in bond 00065 ensindex t; ///< "target" -- index to the other atom in the bond 00066 double o; ///< order of bond 00067 bond_type *typ; ///< pointer to type of bond 00068 int i; ///< index -- for example as alternative to *typ 00069 char *D; ///< free-form description 00070 } bond; ///< a generic bond structure for connections of any type 00071 typedef struct { 00072 int n; // number of bonds 00073 bond *b; // n of these 00074 } bondset; // set of consecutive bonds 00075 typedef struct { 00076 molindex s; ///< source atom in the bond 00077 molindex t; ///< target atom in the bond 00078 double o; ///< order 00079 bond_type *typ; ///< pointer to type of bond 00080 int i; ///< index -- for example as alternative to *typ 00081 char *D; ///< free-form description 00082 } molbond; ///< a bond within a molecule 00083 typedef struct { 00084 int n; // number of these 00085 molbond *b; // n of them 00086 char *D; // free-form description 00087 } molbondset; // set of consecutive molbonds 00088 00089 typedef struct { 00090 double d; /**< a distance, =-1 if these values not set */ 00091 double a; /**< a relevant angle */ 00092 double t; /**< a reference torsion angle (sets chirality at a node) */ 00093 } position_set; /**< structure for info about a particular atom in terms of internal coordinates */ 00094 typedef struct { 00095 char isorigin; /**< Y if yes, N if no */ 00096 ensindex ID; /**< whoami? -- here, i gives location in rT. */ 00097 int nmbi; /**< number incoming bonds */ 00098 molbond **mbi; /**< nmbi incoming bonds */ 00099 int nmbo; /**< number outgoing bonds */ 00100 molbond **mbo; /**< outgoing bonds */ 00101 int nOV; /**< number of open valences */ 00102 ensindex **OV; /**< nOV open valences */ 00103 } residue_node; 00104 typedef struct { 00105 char isorigin; /**< Y if yes, N if no */ 00106 ensindex ID; /**< whoami? -- here, i gives location in aT (or rT etc.) */ 00107 int ni; /**< number incoming bonds */ 00108 ensindex **i; /**< ni atoms making incoming bonds -- i gives locations in aT */ 00109 int no; /**< number outgoing bonds */ 00110 ensindex **o; /**< no atoms making outgoing bonds -- i gives locations in aT */ 00111 int nOV; /**< number of open valences */ 00112 ensindex **OV; /**< nOV open valences */ 00113 int nEC; /**< number of extra coordinates (e.g., lone pairs) defined */ 00114 ensindex **EC; /** nEC extra coordinates */ 00115 int nps; /**< total number of position sets */ 00116 ensindex *psi; /**< nps chirality ordered indices; others point into here if defined */ 00117 position_set *ps; /**< nps chirality ordered positions */ 00118 ensindex *tref; /**< grandparent atom to set torsion -- i gives location in aT */ 00119 double tors; /**< torsion to set with respect to grandparent */ 00120 } atom_node; /**< for non-redundant bonding descriptions. See documentation. */ 00121 00122 00123 typedef struct { 00124 molindex a,b,c; // three atoms in the angle 00125 double ang; // the angle 00126 angle_type *typ; // pointer to type of angle 00127 char *D;// free-form descriptor 00128 int i; // index -- for example as alternative to *typ 00129 } angle_index; // index to atoms in an angle 00130 typedef struct { 00131 molindex a,b,c,d; // four atoms defining the torsion 00132 double ang; // the angle 00133 torsion_type *typ; // pointer to type of torsion 00134 char *D;// free-form descriptor 00135 int i; // index -- for example as alternative to *typ 00136 } torsion_index; // index to atoms in an angle 00137 00138 /********** structure atom *************/ 00139 typedef struct { 00140 int n; ///< atom number or other identifying index 00141 char *N; ///< atom name 00142 char *T; ///< atom type name 00143 char *D; ///< free-form description 00144 char *E; ///< atom element 00145 double m; ///< atom mass -- units defined per program needs 00146 int t; ///< type number -- must correspond to assignments of "atype" (see) 00147 atype *typ; ///< pointer to atype structure 00148 molindex moli; ///< the molecule index for this atom (address) 00149 int nb; ///< number of bonds within this residue (deprecated, soon to go away) 00150 bond *b; ///< bond structures (nb of these) 00151 int nmb; ///< number of bonds to other residues or molecules 00152 molbond *mb; ///< nmb of these (pointers to the structures) 00153 int mTi; ///< Index into the molecule's connection tree for this atom (m.aT) 00154 int rTi; ///< Index into the residue's connection tree for this atom (r.aT) 00155 coord_3D x; ///< atom's main coordinates 00156 coord_3D xv; ///< atom's main velocity 00157 int nalt; ///< number of alternate coordinate sets 00158 coord_3D *xa; ///< nalt of alternate coords 00159 int nxva; ///< number of alternate velocities defined 00160 coord_3D *xva; ///< nxva alternate velocities 00161 int nvec; ///< number of vector sets 00162 vectormag_3D *v; ///< vector sets 00163 int nch; ///< number of charges 00164 double *ch; ///< nch charges for this atom 00165 int ni; ///< number of other indices 00166 int *i; ///< other indices, as needed (ni of these) 00167 int nd; ///< number of double-precision parameters 00168 double *d; ///< other parameters, as needed (nd of these) 00169 int nensi; ///< number of ensemble indices 00170 ensindex *ensi; ///< list of ensemble indices 00171 char *sres; ///< name of some other/original residue to which this atom belongs 00172 int nOD; ///< number of other descriptors 00173 char **OD; ///< the nOD descriptors 00174 int nVP; ///< number of void structures 00175 char *cID; ///< chain identifier 00176 void *VP; ///< nVP of these, whatever they may be 00177 } atom; ///< an actual atom in a residue/molecule 00178 00179 /********** structure residue *************/ 00180 typedef struct { 00181 int n; ///< residue number given in input file 00182 char *cID; /**< Chain identifier */ 00183 char *IC; ///< insertion code 00184 char *N; ///< residue name 00185 char *T; ///< residue type 00186 char *D; ///< free-form description for residue 00187 int t; ///< type number 00188 rtype *typ; ///< pointer to rtype structure 00189 molindex moli; ///< the molecule index for this residue (address -- set .a to -1 or 0) 00190 int na; ///< number of atoms in residue 00191 atom *a; ///< atom structures (na of these) 00192 atom_node *aT; ///< na of these (one per atom) 00193 double m; ///< molecular weight 00194 coord_3D COM; ///< center of mass for residue 00195 int nrb; ///< number of bonds between residues 00196 molbond *rb; ///< nrb of these descriptions of bonds 00197 int mTi; ///< Index into the molecule's connection tree for this residue (m.rT) 00198 int nbs; ///< number of bond sets 00199 molbondset *bs; ///< (consecutive bonds, use these for plotting, etc.) 00200 int nring; ///< number of simple rings (no cage structures, etc.) 00201 molindex_set *ring; ///< molecule indices for the nring rings 00202 // int nrbs; ///< number of ring bondsets defined 00203 // molbondset *rbs; ///< bondsets for rings 00204 int nrc; // number of ring/reference coordinate sets defined 00205 coord_3D *rc; ///< coordinates for ring/reference centers 00206 int nrp; ///< number of ring planes defined 00207 plane *rp; ///< equations for average/approximate/exact/etc. ring planes (where useful) 00208 // need something for more complex structures eventually 00209 int ni; ///< number of other indices 00210 int *i; ///< other indices, as needed (ni of these) 00211 int nd; ///< number of double-precision parameters 00212 double *d; ///< other parameters, as needed (nd of these) 00213 int nensi; ///< number of ensemble indices 00214 ensindex *ensi; ///< list of ensemble indices 00215 char *altname; ///< name of some other/original name for this residue 00216 int nOD; ///< number of other descriptors 00217 char **OD; ///< the nOD descriptors 00218 int nVP; ///< number of void structures 00219 void *VP; ///< nVP of these, whatever they may be 00220 } residue; ///< an actual residue in a molecule 00221 00222 /********** structure molecule *************/ 00223 typedef struct { 00224 int n; ///< molecule number given in an input file 00225 int i; ///< index 00226 char *Des; ///< Chain or other designation 00227 char *N; ///< free-form name for molecule 00228 char *T; ///< free-form type for molecule 00229 char *D; ///< free-form description for residue 00230 double m; ///< molecular weight 00231 char *cID; /**< Chain identifier */ 00232 int mi; ///< number corresponding to the index in the parent ensemble 00233 int Ei; ///< number corresponding to parent ensemble 00234 int t; ///< type number 00235 mtype *typ; ///< pointer to atype structure 00236 coord_3D COM; ///< center of mass for molecule 00237 int na; ///< total number of atoms in molecule 00238 atom **a; ///< na of these, but should point into residues 00239 atom_node *aT; ///< nat of these 00240 int nr; ///< number of residues 00241 residue *r; ///< pointers to residues 00242 residue_node *rT; ///< nr of these residue-level connection trees 00243 int nrbs; ///< number of sets of bonds between residues (for example, linear chains) 00244 molbondset *rbs; ///< nrbs of these sets 00245 int nrc; ///< number of additional reference (ring centers, for example) 00246 coord_3D *rc; ///< nrc of these 00247 int nBOX; ///< Number of box_info structures defined 00248 boxinfo *BOX; ///< The nBOX structures 00249 //coord_3D boxl,boxh; // box dimensions 00250 int noi; ///< number of other indices 00251 int *oi; ///< other indices, as needed (ni of these) 00252 int nd; ///< number of double-precision parameters 00253 double *d; ///< other parameters, as needed (nd of these) 00254 int nensi; ///< number of ensemble indices 00255 ensindex *ensi; ///< list of ensemble indices 00256 int nOD; ///< number of other descriptors 00257 char **OD; ///< the nOD descriptors 00258 int nVP; ///< number of void structures 00259 void *VP; ///< nVP of these, whatever they may be 00260 } molecule; 00261 00262 /********** structure dockinfo *************/ 00263 typedef struct{ 00264 int i; ///< index 00265 int n; ///< number of docked structures represented 00266 int numClusters; 00267 int *clusterRank; 00268 coord_3D RC, *TR; ///< reference coordinate ; translation for docked structure 00269 vectormag_3D *Q, *QN, *QN0; ///< Quaternion x,y,z,w ; Quaternion nx,ny,nz,angle 00270 ///< NOTE!! do -not- use typical vectormag_3D functions on these structures 00271 int nTors; ///< Number of Torsions 00272 double *Tors; ///< nTors torsions 00273 double *eFEB; ///< Estimated Free Energy of Binding, kcal/mol [=(1)+(3)] 00274 double *eKi, *Tmp; ///< Estimated Inhibition Constant, Ki & temperature, Kelvin 00275 double *fDE; ///< Final Docked Energy, kcal/mol [=(1)+(2)] or [=(1)+(2)+(3)-(4)] 00276 double *fIE; ///< (1) Final Intermolecular Energy 00277 double *fIEL; ///< (2) Final Internal Energy of Ligand 00278 double *TFE; ///< (3) Torsional Free Energy 00279 double *USE; ///< (4) Unbound System's Energy <Autodock 4.0 only> 00280 int nDIH; ///< number of dihedrals 00281 double *DIH; ///< the dihedrals 00282 char *D; ///<Free-form descriptor for the set 00283 char *DOCK_PROGRAM; ///<The docking program used, if known and relevant 00284 char *VERSION; ///<The version, or similar indentifier, of the above program 00285 molecule M; ///< to hold molecule info about the initial/docked structures 00286 } dockinfo; 00287 00288 /********** structure assembly *************/ 00289 typedef struct { 00290 int i; ///< index 00291 char *N; ///< name 00292 char *T; ///< type 00293 char *D; ///< description (free-form) (was *desc) 00294 double mass; ///< mass of assembly 00295 double TIME; ///< current/initial/reference time in the simulation 00296 coord_3D COM; ///< center of mass 00297 int nm; ///< number of molecule structures 00298 molecule **m; ///< nm of these 00299 atom_node *mT; ///< nm of these 00300 //int nmb; // number of bonds/connections between molecules (H-bonds, for example) 00301 //molbond *mb; // nmb of these descriptions of connection 00302 int nr; ///< number of residues 00303 residue **r; ///< nr of these -- probably best to point into molecules... 00304 residue_node *rT; ///< nr of these 00305 int na; ///< number of atoms 00306 atom **a; ///< na of these -- probably best to point into mol/res combos 00307 //int naT; ///< naT connection trees defined. // WHY naT??? 00308 atom_node *aT; ///< na of these 00309 int nb; ///< total number of bonds 00310 molbond *b; ///< the bonds 00311 int nANG; ///< # of angles 00312 angle_index *ANG; ///< nANG of these 00313 int nTOR; ///< # of torsions 00314 torsion_index *TOR; ///< nTOR of these 00315 int nPRM; ///< number of parameter sets 00316 parameter_set **PRM; ///< pointers to parameter sets 00317 int nmbs; ///< number of sets of connections between molecules 00318 molbondset *mbs; ///< nmbs of these sets 00319 int nBOX; ///< Number of box_info structures defined 00320 boxinfo *BOX; ///< The nBOX structures 00321 //coord_3D boxl,boxh; // simple box dimensions (limits low & high or just use one for size) 00322 //double boxang; // coord_3D is x, y and z -- angle (probably between XY and YZ planes in degrees, maybe). 00323 //char *boxtype; // type of simple box (cubic, trapezoidal, etc.) 00324 int nOD; ///< number of other descriptors 00325 char **OD; ///< the nOD descriptors 00326 int nensi; ///< number of ensemble indices 00327 ensindex *ensi; ///< list of ensemble indices 00328 int nVP; ///< number of void pointers 00329 void *VP; ///< void pointers 00330 } assembly;///< structure for groups of molecules within a larger structure 00331 00332 /********** structure ensemble *************/ 00333 typedef struct { 00334 int i; ///< index 00335 char *N; ///< name 00336 char *T; ///< type 00337 char *D; ///< free-form descriptor 00338 double mass; ///< mass of ensemble 00339 coord_3D COM; ///< center of mass 00340 int nm; ///< number of molecule structures 00341 molecule *m; ///< nm of these 00342 int nA; ///< number of assembly structures 00343 assembly **A; ///< nA of these 00344 int nBOX; ///< Number of box_info structures defined 00345 boxinfo *BOX; ///< The nBOX structures 00346 //coord_3D boxl,boxh; // box dimensions 00347 int nPRM; ///< number of parameter sets 00348 parameter_set **PRM; ///< pointer to parameter sets 00349 int nOD; ///< number of other descriptors 00350 char **OD; ///< the nOD descriptors 00351 int nensi; ///< number of ensemble indices 00352 ensindex *ensi; ///< list of ensemble indices 00353 int nVP; ///< number of void pointers 00354 void *VP; ///< void pointers 00355 } ensemble;///< structure for an entire system of molecules 00356 /** @}*/ 00357 00358 /*int NUMAT; trying a move to PDB.h, which is where this belongs. Would like to get rid of it soon */ 00359 00360 /** \addtogroup DEBUGGING 00361 * @{ 00362 */ 00363 /* The following is a set of functions intended primarily to facilitate 00364 debugging. But, they could easily be used for verbose data output within 00365 the program. They all follow the same basic format: 00366 00367 print_X(X *x, int level) 00368 00369 where X = one of the structures defined above (e.g., molecule, residue, 00370 bondset, atom, bond, atype, plane, vectormag_3D, coord_3D). 00371 *x = pointer to your structure 00372 level = the depth to print. This is only available on structures 00373 likely to contain arrays of other structures. level=0 only 00374 prints the top-level information. level=1 prints one level 00375 down of other structures, lists, etc. level=2 prints two 00376 levels down, etc. The value of level can be larger than 00377 the depth available -- the function will stop when it runs 00378 out of structures to print. 00379 */ 00380 void print_molecule(molecule*,int),print_residue(residue*,int); 00381 void print_bondset(bondset*,int),print_atom(atom*,int),print_bond(bond*); 00382 void print_atype(atype*,int),print_plane(plane*); 00383 void print_vectormag_3D(vectormag_3D*),print_coord_3D(coord_3D*); 00384 // 00385 void dprint_molecule(molecule*,int),dprint_residue(residue*,int); 00386 void dprint_bondset(bondset*,int); 00387 void dprint_molbondset(molbondset*,int); 00388 void dprint_atom(atom*,int),dprint_bond(bond*),dprint_molbond(molbond *mb); 00389 void dprint_atype(atype*,int),dprint_plane(plane*); 00390 void dprint_vectormag_3D(vectormag_3D*),dprint_coord_3D(coord_3D*); 00391 // 00392 void dXprint_molecule(molecule*,int),dXprint_residue(residue*,int); 00393 void dXprint_bondset(bondset*,int),dXprint_atom(atom*,int),dXprint_bond(bond*); 00394 void dXprint_molbondset(molbondset*,int),dXprint_molbond(molbond *mb); 00395 void dXprint_atype(atype*,int),dXprint_plane(plane*); 00396 void dXprint_vectormag_3D(vectormag_3D*),dXprint_coord_3D(coord_3D*); 00397 /** @}*/ 00398 00399 00400 /** \defgroup GEOMETRY Geometric Manipulations and Calculations 00401 00402 For functions that perform geometric manipulations or calculations on 00403 the chemical structures (e.g. assembly, molecule, etc.), it is often 00404 necessary to indicate which set of coordinates are to be used for the 00405 calculation. In most cases, it is also possible to perform the calculation 00406 on coordinates in one location, but leave those untouched and save the 00407 results to another location. The same applies to velocities and vectors. 00408 00409 Special variable names and meanings: 00410 00411 xs, vs, xvs: 00412 These are the source data on which to base the calculation. 00413 00414 xd, vd, xvd: 00415 These are the locations to which changed data should be stored. 00416 Note that this location can typically be the same as the source. 00417 00418 xt, vt, xvt: 00419 In these cases, two sets of coordinates are being compared to 00420 00421 The variables above can take on the following values: 00422 00423 -1 00424 This tells the function to use the main coordinate set. 00425 That is, use atom.x or atom.xv. This value is not relevant 00426 to vectors, where there is not a "main" vector. 00427 00428 0, 1, 2, ... 00429 A number greater than or equal to zero indicates the location 00430 in an array. These values apply to atom.xa[i], atom.xva[i] 00431 and atom.v[i]. 00432 00433 -2 00434 This is not available in all functions. It indicates that 00435 the entire array should be used. This applies to atom.xa[i], 00436 atom.xva[i] and atom.v[i]. 00437 00438 -3 00439 This is not available in all functions. It indicates that 00440 the main coordinates and the entire corresponding array should 00441 be used. This applies to { atom.x + atom.xa[i] } and to 00442 { atom.xv and atom.xva[i] }. It does not apply to atom.v[i]. 00443 00444 Information about vectors: 00445 00446 All of the functions that involve vectors will set the magnitude 00447 of the resulting vector without relying on the entry in the input 00448 vector. So, for example, there is no need to get_magnitude 00449 before normalizing or multiplying by a scalar. 00450 00451 This also means that the vector manipulation functions here are 00452 inefficient in that they recalculate the magnitude every time they 00453 are called. If you are doing many vector manipulations in which 00454 the magnitude is not relevant, you might consider making a similar 00455 set that does not recalculate the magnitude. 00456 */ 00457 /** \addtogroup GEOMETRY 00458 * @{ 00459 */ 00460 void translate_residue_by_XYZ(residue *r,int xs,int xd,coord_3D); 00461 void translate_molecule_by_XYZ(molecule *m,int xs,int xd,coord_3D); 00462 void translate_ensemble_by_XYZ(ensemble *e,int xs,int xd,coord_3D); 00463 void translate_zero_to_coord_M(molecule *m,int xs,int xd,coord_3D); 00464 coord_3D **atoms_to_coord_list(atom **atoms, int num_atoms); 00465 /** This function rotates the coordinate list such that the 00466 vector given by vectormag_3D points along the Z (Y, X, other) axis. 00467 The orientation of the orthogonal axes is arbitrary. */ 00468 void rotate_vector_to_Z_M(molecule* m,int xs,int xd,int vs,int vd,vectormag_3D vec); 00469 // The four integers are: 00470 // int#1 location of source coordinates (-1=x, 0,1,2,etc=xa[xs] 00471 // int#2 location of rotated coordinates (-1=x, 0,1,2,etc=xa[xs] 00472 // int#3 location of source vectors (-1=do not calc, 0,1,2,etc=v[xs] 00473 // int#4 location of rotated vectors (-1=do not calc, 0,1,2,etc=v[xs] 00474 void normalize_molecule_vectors(molecule *m,int vs,int vd); 00475 void normalize_ensemble_vectors(ensemble *e,int vs,int vd); 00476 // int #1 -- location of source vector 00477 // int #2 -- where to write vectors normalized to one (made unit vectors) 00478 void shift_molecule_atoms_by_vector_scale(molecule *m,int xs,int xd,int vr, double scale); 00479 vectormag_3D get_molecule_point_charge_dipole(molecule *m,int xs,int chgsrc, atype *AT); 00480 00481 void rollMolecule(molecule* m,double rad); //Rotates about x-axis using radians 00482 void pitchMolecule(molecule* m,double rad);//Rotates about y-axis using radians 00483 void yawMolecule(molecule* m,double rad); //Rotates about z-axis using radians 00484 void rollAssembly(assembly* a,double rad); //Rotates about x-axis using radians 00485 void pitchAssembly(assembly* a,double rad);//Rotates about y-axis using radians 00486 void yawAssembly(assembly* a,double rad); //Rotates about z-axis using radians 00487 00488 /** This function will return the distance from a point pt to a plane pt. If 00489 absl is set to 0, it returns a signed distance ("above" or "below"). If set 00490 to 1, it returns the absolute value.*/ 00491 double get_distance_from_point_to_plane(plane p, coord_3D pt, int absl); 00492 double get_angle_between_plane_and_vector(plane p, coord_3D pt1, coord_3D pt2); 00493 /** @}*/ 00494 00495 /** \addtogroup ANALYSIS 00496 * @{ 00497 */ 00498 // int#1 is xs, the location of the source coords 00499 void set_residue_COM(residue *r,atype *ATYPE,int xs); 00500 void set_molecule_COM(molecule *m,atype *ATYPE,int xs); 00501 void set_assembly_molecule_COM(assembly *a,atype *ATYPE,int xs); 00502 void set_ensemble_COM(ensemble *e,atype *ATYPE,int xs); 00503 coord_3D get_residue_COM(residue *r,atype *ATYPE,int xs); 00504 coord_3D get_molecule_COM(molecule *m,atype *ATYPE,int xs); 00505 coord_3D get_assembly_molecule_COM(assembly *a,atype *ATYPE,int xs); 00506 coord_3D get_ensemble_COM(ensemble *e,atype *ATYPE,int xs); 00507 // RMS between coordinate sets xs and xt 00508 double get_alt_rms_res(residue *r, int xs, int xt); // per residue 00509 double get_alt_rms_mol(molecule *m, int xs, int xt); // per molecule 00510 00511 void find_vdw_clashes_pairwize_between_Assemblies(assembly *A, int xsA, assembly *B, int xsB); 00512 /** @}*/ 00513 00514 /** \addtogroup INDEX_UTILS 00515 * @{ 00516 */ 00517 ensindex copy_moli_to_ensi(molindex moli); 00518 char is_consistent_ensi_moli(ensindex ensi, molindex moli); 00519 char is_consistent_moli_moli(molindex mone, molindex mtwo); 00520 char is_consistent_molbond_molbond(molbond mb1, molbond mb2); 00521 char is_consistent_molbond_molbond_inverse(molbond mb1, molbond mb2); 00522 char is_consistent_ensi_ensi(ensindex eone, ensindex etwo); 00523 void set_ensemble_molindexes(ensemble *E); 00524 void set_assembly_molindexes(assembly *A); 00525 void set_molecule_molindexes(molecule *m, int mi); 00526 void set_residue_molindexes(residue *r, int mi, int ri); 00527 /* 00528 Find atoms/residues named N -- searches for a.N or r.N 00529 */ 00530 molindex_set find_residue_atoms_by_N(residue *r, const char *name); /**< searches for a.N */ 00531 molindex_set find_molecule_atoms_by_N(molecule *m, const char *name); /**< searches for a.N */ 00532 molindex_set find_molecule_residues_by_N(molecule *m, const char *name); /**< searches for r.N */ 00533 molindex_set find_assembly_top_level_atoms_by_N(assembly *a, const char *name); /**< searches for a.N, saves i in A.a[i] to moli.i */ 00534 /* 00535 Find atoms/residues numbered n -- searches for a.n or r.n 00536 */ 00537 molindex_set find_residue_atoms_by_n(residue *r, int number); /**< searches for a.n */ 00538 molindex_set find_molecule_atoms_by_n(molecule *m, int number); /**< searches for a.n */ 00539 molindex_set find_molecule_residues_by_n(molecule *m, int number); /**< searches for r.n */ 00540 molindex_set find_assembly_top_level_atoms_by_n(assembly *a, int number); /**< searches for a.n, saves i in A.a[i] to moli.i */ 00541 /** @}*/ 00542 00543 00544 /** \addtogroup BONDING 00545 * @{ 00546 */ 00547 void set_molecule_atom_nodes_from_bonds(molecule *m); 00548 int follow_molecule_atom_nodes_from_bonds(molecule *m, int iTree, atom *a); 00549 void set_molecule_residue_molbonds(molecule *m); 00550 void set_residue_atom_nodes_from_bonds(residue *r); 00551 int follow_residue_atom_nodes_from_bonds(residue *r, int iTree, atom *a); 00552 void set_molecule_residue_nodes_from_bonds(molecule *m); 00553 int follow_molecule_residue_nodes_from_bonds(molecule *m, int iTree, residue *r); 00554 00555 void set_nbonds_for_atoms_in_assembly(assembly *A); 00556 /** @}*/ 00557 00558 00559 /** \addtogroup INITIALIZATION 00560 * @{ 00561 */ 00562 atype *ATYPE_init(); // initialize atom types -- for a few old programs only 00563 00564 void initialize_atype(atype *at); 00565 void initialize_rtype(rtype *rt); 00566 void initialize_mtype(mtype *mt); 00567 void initialize_types(types *t); 00568 void initialize_molindex(molindex *mi); 00569 void initialize_ensindex(ensindex *ei); 00570 void initialize_bond(bond *b); 00571 void initialize_bondset(bondset *bs); 00572 void initialize_molbond(molbond *mb); 00573 void initialize_molbondset(molbondset *mbs); 00574 void initialize_atom(atom *a); 00575 void initialize_residue(residue *r); 00576 void initialize_molecule(molecule *m); 00577 void initialize_dockinfo(dockinfo *di); 00578 void initialize_assembly(assembly *A); 00579 void initialize_ensemble(ensemble *E); 00580 /** @}*/ 00581 00582 00583 /** \addtogroup MEMORY_MANAGEMENT 00584 * @{ 00585 */ 00586 /* Functions that recursively free memory in themselves, with the exception of parameters */ 00587 void deallocateBondType(bond_type *btp); 00588 void deallocateMolbond(molbond *mlb); 00589 /* 00590 void deallocateAtomNode(atom_node *an); 00591 void deallocateResidueNode(residue_node *rn); 00592 */ 00593 void deallocateBond(bond *bnd); 00594 void deallocateBondset(bondset *bst); 00595 void deallocateAtom(atom *atm); 00596 void deallocateResidue(residue *res); 00597 void deallocateMolecule(molecule *mol); 00598 /** @}*/ 00599 00600 /** \addtogroup STRUCTURE_UTILS 00601 * @{ 00602 */ 00603 void set_atom_element_best_guess(atom *a); 00604 void add_assembly_to_ensemble( 00605 assembly *A, ///< pointer to the assembly being added (SEE DOCS) 00606 ensemble *E ///< pointer to the ensemble being grown 00607 ); 00608 /** @}*/ 00609 00610 #endif