00001 00002 #include "../headers/fpocket.h" 00003 00004 /* 00005 00006 ## GENERAL INFORMATION 00007 ## 00008 ## FILE fpocket.c 00009 ## AUTHORS P. Schmidtke and V. Le Guilloux 00010 ## LAST MODIFIED 01-04-08 00011 ## 00012 ## SPECIFICATIONS 00013 ## 00014 ## Top function(s) to use for looking for pockets in a given protein. 00015 ## This function will call successively all function necessary to 00016 ## perform pocket detection using voronoi vertices. 00017 ## 00018 ## No output is writen, just the list of pockets are returned. 00019 ## 00020 ## MODIFICATIONS HISTORY 00021 ## 00022 ## 09-02-09 (v) Drop tiny pocket step added 00023 ## 28-11-08 (v) Comments UTD 00024 ## 01-04-08 (v) Added comments and creation of history 00025 ## 01-01-08 (vp) Created (random date...) 00026 ## 00027 ## TODO or SUGGESTIONS 00028 ## 00029 00030 */ 00031 00032 00033 /* 00034 COPYRIGHT DISCLAIMER 00035 00036 Vincent Le Guilloux, Peter Schmidtke and Pierre Tuffery, hereby 00037 disclaim all copyright interest in the program “fpocket” (which 00038 performs protein cavity detection) written by Vincent Le Guilloux and Peter 00039 Schmidtke. 00040 00041 Vincent Le Guilloux 28 November 2008 00042 Peter Schmidtke 28 November 2008 00043 Pierre Tuffery 28 November 2008 00044 00045 GNU GPL 00046 00047 This file is part of the fpocket package. 00048 00049 fpocket is free software: you can redistribute it and/or modify 00050 it under the terms of the GNU General Public License as published by 00051 the Free Software Foundation, either version 3 of the License, or 00052 (at your option) any later version. 00053 00054 fpocket is distributed in the hope that it will be useful, 00055 but WITHOUT ANY WARRANTY; without even the implied warranty of 00056 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00057 GNU General Public License for more details. 00058 00059 You should have received a copy of the GNU General Public License 00060 along with fpocket. If not, see <http://www.gnu.org/licenses/>. 00061 00062 **/ 00063 00064 00065 /** 00066 ## FUNCTION: 00067 pockets search_pocket 00068 00069 ## SPECIFICATION: 00070 This function will call all functions needed for the pocket finding algorith 00071 and will return the list of pockets found on the protein. 00072 00073 ## PARAMETRES: 00074 @ s_pdb *pdb : The pdb data of the protein to handle. 00075 @ s_fparams : Parameters of the algorithm 00076 00077 ## RETURN: 00078 A chained list of pockets found, sorted according to the current critera 00079 (the default is a scoring function) 00080 00081 */ 00082 c_lst_pockets* search_pocket(s_pdb *pdb, s_fparams *params,s_pdb *pdb_w_lig) 00083 { 00084 /* 00085 clock_t b, e ; 00086 time_t bt, et ; 00087 */ 00088 c_lst_pockets *pockets = NULL ; 00089 00090 /* Calculate and read voronoi vertices comming from qhull */ 00091 /* 00092 fprintf(stdout,"========= fpocket algorithm begins =========\n") ; 00093 00094 fprintf(stdout, "> Calculating vertices ...\n"); 00095 00096 bt = time(NULL) ; 00097 */ 00098 s_lst_vvertice *lvert = load_vvertices(pdb, params->min_apol_neigh, 00099 params->asph_min_size, 00100 params->asph_max_size) ; 00101 /* 00102 et = time(NULL) ; 00103 fprintf(stdout, "> Vertices successfully calculated in apox. %f sec.\n", 00104 (float) (et-bt)) ; 00105 */ 00106 00107 if(lvert == NULL) { 00108 fprintf(stderr, "! Vertice calculation failed!\n"); 00109 return NULL ; 00110 } 00111 /* First clustering */ 00112 /* fprintf(stdout,"> Basic clustering ...\n"); 00113 00114 b = clock() ; 00115 */ 00116 pockets = clusterPockets(lvert, params); 00117 00118 00119 if(pockets) { 00120 pockets->vertices = lvert ; 00121 /* 00122 e = clock() ; 00123 fprintf(stdout, "> Clustering OK in %f sec.\n", 00124 ((double)e - b) / CLOCKS_PER_SEC) ; 00125 */ 00126 00127 /* Clustering refinment */ 00128 00129 /* 00130 b = clock() ; 00131 fprintf(stdout,"> Cluster refinment steps: \n"); 00132 */ 00133 reIndexPockets(pockets) ; 00134 00135 /* 00136 drop_tiny(pockets) ; 00137 reIndexPockets(pockets) ; 00138 */ 00139 00140 /* 00141 fprintf(stdout,"\t* 2nd refinment step -> clustering : based on barycenters...\n"); 00142 */ 00143 refinePockets(pockets, params) ; /* Refine clustering (rapid) */ 00144 reIndexPockets(pockets) ; 00145 00146 /* 00147 fprintf(stdout,"\t* 3rd refinment step -> single linkage clusturing...\n"); 00148 */ 00149 pck_final_clust(pockets, params,pdb,pdb_w_lig); /* Single Linkage Clustering */ 00150 reIndexPockets(pockets) ; 00151 00152 /* Descriptors calculation */ 00153 /* 00154 fprintf(stdout,"> Calculating descriptors and score...\n"); 00155 b = clock() ; 00156 */ 00157 00158 set_pockets_descriptors(pockets,pdb,params,pdb_w_lig); 00159 00160 /* 00161 e = clock() ; 00162 fprintf(stdout, "> Descriptors found in %f sec.\n", ((double)e - b) / CLOCKS_PER_SEC) ; 00163 00164 fprintf(stdout,"> 4th refinment step -> dropping small and polar pockets...\n"); 00165 */ 00166 00167 /* Drop small and too polar binding pockets */ 00168 dropSmallNpolarPockets(pockets, params); 00169 reIndexPockets(pockets) ; 00170 /* 00171 e = clock() ; 00172 fprintf(stdout, "> Refinment OK in %f sec.\n", ((double)e - b) / CLOCKS_PER_SEC) ; 00173 */ 00174 00175 /* Sorting pockets */ 00176 sort_pockets(pockets, M_SCORE_SORT_FUNCT) ; 00177 /*sort_pockets(pockets, M_NASPH_SORT_FUNCT) ;*/ 00178 00179 reIndexPockets(pockets) ; 00180 /* 00181 fprintf(stdout,"===== fpocket algorithm ends =====\n"); 00182 */ 00183 } 00184 00185 return pockets ; 00186 } 00187