00001 00002 /* 00003 COPYRIGHT DISCLAIMER 00004 00005 Vincent Le Guilloux, Peter Schmidtke and Pierre Tuffery, hereby 00006 disclaim all copyright interest in the program “fpocket” (which 00007 performs protein cavity detection) written by Vincent Le Guilloux and Peter 00008 Schmidtke. 00009 00010 Vincent Le Guilloux 28 November 2008 00011 Peter Schmidtke 28 November 2008 00012 Pierre Tuffery 28 November 2008 00013 00014 GNU GPL 00015 00016 This file is part of the fpocket package. 00017 00018 fpocket is free software: you can redistribute it and/or modify 00019 it under the terms of the GNU General Public License as published by 00020 the Free Software Foundation, either version 3 of the License, or 00021 (at your option) any later version. 00022 00023 fpocket is distributed in the hope that it will be useful, 00024 but WITHOUT ANY WARRANTY; without even the implied warranty of 00025 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00026 GNU General Public License for more details. 00027 00028 You should have received a copy of the GNU General Public License 00029 along with fpocket. If not, see <http://www.gnu.org/licenses/>. 00030 00031 */ 00032 00033 #ifndef DH_MDPBASE 00034 #define DH_MDPBASE 00035 00036 /* ----------------------------- INCLUDES ------------------------------------*/ 00037 00038 #include <stdio.h> 00039 #include <stdlib.h> 00040 #include <unistd.h> 00041 #include <string.h> 00042 #include <ctype.h> 00043 #include <limits.h> 00044 #include <assert.h> 00045 #include <math.h> 00046 00047 #include "fpocket.h" 00048 #include "fpout.h" 00049 #include "writepocket.h" 00050 #include "tpocket.h" 00051 #include "dparams.h" 00052 #include "descriptors.h" 00053 #include "neighbor.h" 00054 #include "pocket.h" 00055 #include "cluster.h" 00056 #include "refine.h" 00057 #include "aa.h" 00058 #include "utils.h" 00059 #include "mdparams.h" 00060 #include "memhandler.h" 00061 00062 /* ---------------------------------MACROS----------------------------------*/ 00063 00064 #define M_MDP_GRID_RESOLUTION 1.0 /**< grid resolution in Angstroems*/ 00065 #define M_MDP_CUBE_SIDE 2.0 /**< size of the side of the cube to count vvertices*/ 00066 #define M_MDP_WP_ATOM_DIST 4.0 /**< max distance for constructing the atom set of the pocket with voronoi vertices*/ 00067 #define M_MDP_ATOM_DENSITY_DIST 2.0 /**< max distance (for each dimension) for mapping pocket densities to neighbouring atoms*/ 00068 #define M_MIN_G_DENS 20.0 /**< minimum density of alpha spheres around a grid point for it to be taken into account for further processing using */ 00069 /* -------------------------------STRUCTURES--------------------------------*/ 00070 00071 /** 00072 Structure handle for the md concat object 00073 */ 00074 typedef struct s_mdconcat 00075 { 00076 float **vertpos; /**< nx4 array of alpha sphere center + radius */ 00077 size_t n_vertpos; /**< number of vertices in all snapshots*/ 00078 int n_snapshots; /**< number of snapshots of the trajectory*/ 00079 } s_mdconcat ; 00080 00081 /** 00082 Structure handle for the grid 00083 */ 00084 typedef struct s_mdgrid 00085 { 00086 float ***gridvalues; /**< values of the md grid (i.e. number of alpha spheres nearby*/ 00087 float *origin; /**< origin of the grid (3 positons, xyz)*/ 00088 int nx,ny,nz; /**< gridsize at the x, y, z axis*/ 00089 float resolution; /**< resolution of the grid; in general 1A*/ 00090 int n_snapshots; /**< number of snapshots of the trajectory*/ 00091 } s_mdgrid; 00092 00093 00094 typedef struct s_min_max_pockets 00095 { 00096 float minx; /**< minimum x coordinate for all pockets in one snapshot*/ 00097 float miny; /**< minimum y coordinate for all pockets in one snapshot*/ 00098 float minz; /**< minimum z coordinate for all pockets in one snapshot*/ 00099 float maxx; /**< maximum x coordinate for all pockets in one snapshot*/ 00100 float maxy; /**< maximum y coordinate for all pockets in one snapshot*/ 00101 float maxz; /**< maximum z coordinate for all pockets in one snapshot*/ 00102 } s_min_max_pockets; 00103 00104 /* -------------------------------PROTOTYPES--------------------------------*/ 00105 00106 void store_vertice_positions(s_mdconcat *m,c_lst_pockets *pockets); 00107 s_min_max_pockets *float_get_min_max_from_pockets(c_lst_pockets *pockets); 00108 void calculate_md_dens_grid(s_mdgrid *g,c_lst_pockets *pockets,s_mdparams *par); 00109 void update_md_grid(s_mdgrid *g, s_mdgrid *refg, c_lst_pockets *pockets,s_mdparams *par); 00110 void project_grid_on_atoms(s_mdgrid *g,s_pdb *pdb); 00111 s_mdconcat *init_md_concat(void); 00112 void reset_grid(s_mdgrid *g); 00113 s_mdgrid *init_md_grid(c_lst_pockets *pockets); 00114 void normalize_grid(s_mdgrid *g, int n); 00115 void alloc_first_md_concat(s_mdconcat *m,size_t n); 00116 void realloc_md_concat(s_mdconcat *m,size_t n); 00117 void free_mdconcat(s_mdconcat *m); 00118 00119 00120 #endif