-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathVpoly.h
59 lines (48 loc) · 2 KB
/
Vpoly.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
/***************************************************
* HEADER: Voronoi polyhedron set of programs
* Vsurfaces, Vcontacts, and Vvolumes, for
* calculating solvent accessible surfaces,
* atom-atom contacts, and atom volumes.
* An analytical solution is used for all
* calculations.
***************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define CELLSIZE 7.0 // set to (maximum contact radius x 2)
#define PI 3.14159265 // pi.
#define Rw 1.4 // radius of water
// ------------------------- structure definitions ----------------------
struct atom {
int atomnum; // record number from PDB
float coor[3]; // xyz coordinates of atom
char atomname[5]; // name of atom, CA, etc
char res[4]; // residue name from PDB
char chain;
int resnum;
float radius; // radius of atom
int boxnum; // the box number atom is assigned to.
char source; // source of atom, protein, ligand,
float SAS; // solvent exposed surface area
float vol; // atom volume
char done; // flag if atom contacts have already been calculated
};
struct atomindex {
int nument; // number of entries in box
int first; // location of first entry in PDBlist
};
struct contactlist {
int index; // index to PDB atom
double area; // contact area, square angstroms
double dist; // distance to atom zero
char flag; // to keep or not. 'X' == omit.
};
// ----------------- Global variables -----------------
struct atom *PDB; // pointer to PDB array (dynamically allocated)
struct atomindex *box; // index to PDB atoms within cubic grid
int *PDBlist; // list of atoms ordered by box number
struct contactlist contlist[100]; // list of possible atom contacts
// ----------------- prototype definitions ------------------
struct atom *read_PDB(char *FILE_ptr, struct atom *PDB, long int *totatoms);
int index_protein(int totatoms);