fparams.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <assert.h>
#include "utils.h"
#include "memhandler.h"

Go to the source code of this file.

Data Structures

struct  s_fparams

Defines

#define M_MIN_ASHAPE_SIZE_DEFAULT   3.0
#define M_MAX_ASHAPE_SIZE_DEFAULT   6.0
#define M_CLUST_MAX_DIST   1.73
#define M_REFINE_DIST   4.5
#define M_REFINE_MIN_PROP_APOL_AS   0.0
#define M_SLCLUST_MAX_DIST   2.5
#define M_SLCLUST_MIN_NUM_NEIGH   2
#define M_MC_ITER   3000
#define M_BASIC_VOL_DIVISION   -1
#define M_MIN_POCK_NB_ASPH   36
#define M__MIN_APOL_NEIGH_DEFAULT   3
#define M_DB_RUN   0
#define M_PAR_PDB_FILE   'f'
#define M_PAR_PDB_LIST   'F'
#define M_PAR_MAX_ASHAPE_SIZE   'M'
#define M_PAR_MIN_ASHAPE_SIZE   'm'
#define M_PAR_MIN_APOL_NEIGH   'A'
#define M_PAR_CLUST_MAX_DIST   'D'
#define M_PAR_SL_MAX_DIST   's'
#define M_PAR_SL_MIN_NUM_NEIGH   'n'
#define M_PAR_MC_ITER   'v'
#define M_PAR_BASIC_VOL_DIVISION   'b'
#define M_PAR_MIN_POCK_NB_ASPH   'i'
#define M_PAR_REFINE_DIST   'r'
#define M_PAR_REFINE_MIN_NAPOL_AS   'p'
#define M_PAR_DB_RUN   'd'
#define M_FP_USAGE   "\n\***** USAGE (fpocket) *****\n\\n\Pocket finding on a pdb - list of pdb - file(s): \n\\t./bin/fpocket -f pdb \n\\t./bin/fpocket -F pdb_list \n\\nOPTIONS (find standard parameters in brackets) \n\n\\t-m (float) : Minimum radius of an alpha-sphere. (3.0)\n\\t-M (float) : Maximum radius of an alpha-sphere. (6.0)\n\\t-A (int) : Minimum number of apolar neighbor for \n\\t an a-sphere to be considered as apolar. (3)\n\\t-i (int) : Minimum number of a-sphere per pocket. (30)\n\\t-D (float) : Maximum distance for first clustering \n\\t algorithm. (1.73)\n\\t-s (float) : Maximum distance for single linkage \n\\t clustering (2.5)\n\\t-n (integer): Minimum number of neighbor close from \n\\t each other (not merged otherwise). (3)\n\\t-r (float) : Maximum distance between two pockets \n\\t barycenter (merged otherwise). (4.5)\n\\t-p (float) : Minimum proportion of apolar sphere in \n\\t a pocket (remove otherwise) (0.0)\n\\t-v (integer): Number of Monte-Carlo iteration for the \n\\t calculation of each pocket volume. (2500)\n\\t-b (integer): Space approximation for the basic method \n\\t of the volume calculation. Not used by \n\\t default (Monte Carlo approximation is) \n\\t-d flag : Put this flag if you want to run fpocket for \n\\t database creation \n\\nSee the manual (man fpocket), or the full documentation for\n\more information.\n\***************************\n"

Functions

s_fparamsinit_def_fparams (void)
s_fparamsget_fpocket_args (int nargs, char **args)
int parse_clust_max_dist (char *str, s_fparams *p)
int parse_sclust_max_dist (char *str, s_fparams *p)
int parse_sclust_min_nneigh (char *str, s_fparams *p)
int parse_min_apol_neigh (char *str, s_fparams *p)
int parse_asph_min_size (char *str, s_fparams *p)
int parse_asph_max_size (char *str, s_fparams *p)
int parse_mc_niter (char *str, s_fparams *p)
int parse_basic_vol_div (char *str, s_fparams *p)
int parse_refine_dist (char *str, s_fparams *p)
int parse_refine_minaap (char *str, s_fparams *p)
int parse_min_pock_nb_asph (char *str, s_fparams *p)
int is_fpocket_opt (const char opt)
void free_fparams (s_fparams *p)
void print_pocket_usage (FILE *f)
void print_fparams (s_fparams *p, FILE *f)


Define Documentation

#define M__MIN_APOL_NEIGH_DEFAULT   3

Minimum number of atoms having a low electronegativity in order to declare an alpha sphere to be apolar 3

Definition at line 76 of file fparams.h.

Referenced by init_def_fparams().

#define M_BASIC_VOL_DIVISION   -1

Precision for "exact" volume integration, set to -1 if not used -1

Definition at line 72 of file fparams.h.

Referenced by init_def_fparams().

#define M_CLUST_MAX_DIST   1.73

Use first connection distance (see report) : 2.0

Definition at line 60 of file fparams.h.

Referenced by init_def_fparams().

#define M_DB_RUN   0

default value for running fpocket for populating a database, 0 default

Definition at line 78 of file fparams.h.

Referenced by init_def_fparams().

#define M_FP_USAGE   "\n\***** USAGE (fpocket) *****\n\\n\Pocket finding on a pdb - list of pdb - file(s): \n\\t./bin/fpocket -f pdb \n\\t./bin/fpocket -F pdb_list \n\\nOPTIONS (find standard parameters in brackets) \n\n\\t-m (float) : Minimum radius of an alpha-sphere. (3.0)\n\\t-M (float) : Maximum radius of an alpha-sphere. (6.0)\n\\t-A (int) : Minimum number of apolar neighbor for \n\\t an a-sphere to be considered as apolar. (3)\n\\t-i (int) : Minimum number of a-sphere per pocket. (30)\n\\t-D (float) : Maximum distance for first clustering \n\\t algorithm. (1.73)\n\\t-s (float) : Maximum distance for single linkage \n\\t clustering (2.5)\n\\t-n (integer): Minimum number of neighbor close from \n\\t each other (not merged otherwise). (3)\n\\t-r (float) : Maximum distance between two pockets \n\\t barycenter (merged otherwise). (4.5)\n\\t-p (float) : Minimum proportion of apolar sphere in \n\\t a pocket (remove otherwise) (0.0)\n\\t-v (integer): Number of Monte-Carlo iteration for the \n\\t calculation of each pocket volume. (2500)\n\\t-b (integer): Space approximation for the basic method \n\\t of the volume calculation. Not used by \n\\t default (Monte Carlo approximation is) \n\\t-d flag : Put this flag if you want to run fpocket for \n\\t database creation \n\\nSee the manual (man fpocket), or the full documentation for\n\more information.\n\***************************\n"

the usage print content

Definition at line 95 of file fparams.h.

Referenced by print_pocket_usage().

#define M_MAX_ASHAPE_SIZE_DEFAULT   6.0

Use max alpha sphere radius of : 6.0

Definition at line 58 of file fparams.h.

Referenced by init_def_fparams().

#define M_MC_ITER   3000

Number of iterations for the Monte Carlo volume calculation 3000

Definition at line 70 of file fparams.h.

Referenced by init_def_fparams().

#define M_MIN_ASHAPE_SIZE_DEFAULT   3.0

Use min alpha sphere radius of : 3.0

Definition at line 56 of file fparams.h.

Referenced by init_def_fparams().

#define M_MIN_POCK_NB_ASPH   36

Minimum number of alpha spheres for a pocket to be kept

Definition at line 74 of file fparams.h.

Referenced by init_def_fparams().

#define M_PAR_BASIC_VOL_DIVISION   'b'

flag for the space approximation of the MC

Definition at line 89 of file fparams.h.

Referenced by get_fpocket_args(), and is_fpocket_opt().

#define M_PAR_CLUST_MAX_DIST   'D'

flag for the first clustering distance

Definition at line 85 of file fparams.h.

Referenced by get_fpocket_args(), and is_fpocket_opt().

#define M_PAR_DB_RUN   'd'

flag for running fpocket as database run, more silent and special output is produced for automatic grabbing of results using other programs

Definition at line 93 of file fparams.h.

Referenced by get_fpocket_args().

#define M_PAR_MAX_ASHAPE_SIZE   'M'

flag for the maximum alpha sphere size

Definition at line 82 of file fparams.h.

Referenced by get_fpocket_args(), and is_fpocket_opt().

#define M_PAR_MC_ITER   'v'

flag for how many iterations for the monte carlo volume calculation algorithm

Definition at line 88 of file fparams.h.

Referenced by get_fpocket_args(), and is_fpocket_opt().

#define M_PAR_MIN_APOL_NEIGH   'A'

flag for the minimum number of apolar neighbours for an alpha sphere to be considered as apolar

Definition at line 84 of file fparams.h.

Referenced by get_fpocket_args(), and is_fpocket_opt().

#define M_PAR_MIN_ASHAPE_SIZE   'm'

flag for the minimum alpha sphere size

Definition at line 83 of file fparams.h.

Referenced by get_fpocket_args(), and is_fpocket_opt().

#define M_PAR_MIN_POCK_NB_ASPH   'i'

flag for the min number of alpha spheres in the pocket

Definition at line 90 of file fparams.h.

Referenced by get_fpocket_args(), and is_fpocket_opt().

#define M_PAR_PDB_FILE   'f'

flag to give a single pdb input file

Definition at line 80 of file fparams.h.

Referenced by get_fpocket_args().

#define M_PAR_PDB_LIST   'F'

flag to give a txt file containing paths to multiple pdb files

Definition at line 81 of file fparams.h.

Referenced by get_fpocket_args().

#define M_PAR_REFINE_DIST   'r'

flag for the refining distance

Definition at line 91 of file fparams.h.

Referenced by get_fpocket_args(), and is_fpocket_opt().

#define M_PAR_REFINE_MIN_NAPOL_AS   'p'

flag for minimum proportion of apolar alpha spheres

Definition at line 92 of file fparams.h.

Referenced by get_fpocket_args(), and is_fpocket_opt().

#define M_PAR_SL_MAX_DIST   's'

flag for the distance crit. of the multiple linkage clustering algorithm

Definition at line 86 of file fparams.h.

Referenced by get_fpocket_args(), and is_fpocket_opt().

#define M_PAR_SL_MIN_NUM_NEIGH   'n'

flag for the single linkage min neighbours

Definition at line 87 of file fparams.h.

Referenced by get_fpocket_args(), and is_fpocket_opt().

#define M_REFINE_DIST   4.5

use second connection distance (see report) : 4.5

Definition at line 62 of file fparams.h.

Referenced by init_def_fparams().

#define M_REFINE_MIN_PROP_APOL_AS   0.0

At least a proportion of M_REFINE_MIN_NAPOL_AS apolar alpha spheres in the pocket 0.0

Definition at line 64 of file fparams.h.

Referenced by init_def_fparams().

#define M_SLCLUST_MAX_DIST   2.5

Single linkage clustering connection distance 2.5

Definition at line 66 of file fparams.h.

Referenced by init_def_fparams().

#define M_SLCLUST_MIN_NUM_NEIGH   2

Minimum number of common neighbours for single linkage clustering 5

Definition at line 68 of file fparams.h.

Referenced by init_def_fparams().


Function Documentation

void free_fparams ( s_fparams p  ) 

## FUNCTION: free_fparams

## SPECIFICATION: Free parameters

## PARAMETRES: @ s_params *p: Pointer to the structure to free

## RETURN: void

Definition at line 562 of file fparams.c.

References my_free(), s_fparams::npdb, and s_fparams::pdb_lst.

Referenced by check_fpocket(), free_dparams(), free_mdparams(), free_tparams(), get_fpocket_args(), and main().

00563 {
00564     int i ;
00565     if(p) {
00566         if(p->npdb > 0 && p->pdb_lst != NULL) {
00567                 for (i = 0 ; i < p->npdb ; i++) {
00568                         if(p->pdb_lst[i] != NULL) my_free(p->pdb_lst[i]) ;
00569                 }
00570                 my_free(p->pdb_lst) ;
00571         }
00572         my_free(p) ;
00573     }
00574 }

s_fparams* get_fpocket_args ( int  nargs,
char **  args 
)

## FUNCTION: get_fpocket_args

## SPECIFICATION: This function analyse the user's command line and parse it to store parameters for the pocket finder programm.

## PARAMETRES: @ int nargs : Number of arguments @ char **args : Arguments of main program

## RETURN: s_params*: Pointer to parameters

Definition at line 88 of file fparams.c.

References s_fparams::db_run, free_fparams(), init_def_fparams(), M_MAX_PDB_NAME_LEN, M_PAR_BASIC_VOL_DIVISION, M_PAR_CLUST_MAX_DIST, M_PAR_DB_RUN, M_PAR_MAX_ASHAPE_SIZE, M_PAR_MC_ITER, M_PAR_MIN_APOL_NEIGH, M_PAR_MIN_ASHAPE_SIZE, M_PAR_MIN_POCK_NB_ASPH, M_PAR_PDB_FILE, M_PAR_PDB_LIST, M_PAR_REFINE_DIST, M_PAR_REFINE_MIN_NAPOL_AS, M_PAR_SL_MAX_DIST, M_PAR_SL_MIN_NUM_NEIGH, my_malloc(), s_fparams::npdb, parse_asph_max_size(), parse_asph_min_size(), parse_basic_vol_div(), parse_clust_max_dist(), parse_mc_niter(), parse_min_apol_neigh(), parse_min_pock_nb_asph(), parse_refine_dist(), parse_refine_minaap(), parse_sclust_max_dist(), parse_sclust_min_nneigh(), s_fparams::pdb_lst, s_fparams::pdb_path, and print_pocket_usage().

Referenced by check_fparams(), check_fpocket(), get_dpocket_args(), get_mdpocket_args(), get_tpocket_args(), and main().

00089 {
00090         int i,
00091                 npdb = 0,
00092                 status = 0 ;
00093 
00094         s_fparams *par = init_def_fparams() ;
00095         char *pdb_lst = NULL ;
00096 
00097         //read arguments by flags
00098         for (i = 1; i < nargs; i++) {
00099                 if (strlen(args[i]) == 2 && args[i][0] == '-' && i <= (nargs-1)) {
00100                     
00101                         switch (args[i][1]) {
00102                                 case M_PAR_MAX_ASHAPE_SIZE        : 
00103                                         status += parse_asph_max_size(args[++i], par) ;         break ;
00104                                 case M_PAR_MIN_ASHAPE_SIZE        : 
00105                                         status += parse_asph_min_size(args[++i], par) ;         break ;
00106                                 case M_PAR_MIN_APOL_NEIGH         : 
00107                                         status += parse_min_apol_neigh(args[++i], par) ;        break ;
00108                                 case M_PAR_CLUST_MAX_DIST         : 
00109                                         status += parse_clust_max_dist(args[++i], par) ;        break ;
00110                                 case M_PAR_SL_MAX_DIST            : 
00111                                         status += parse_sclust_max_dist(args[++i], par) ;       break ;
00112                                 case M_PAR_SL_MIN_NUM_NEIGH   : 
00113                                         status += parse_sclust_min_nneigh(args[++i], par) ; break ;
00114                                 case M_PAR_MC_ITER                        : 
00115                                         status += parse_mc_niter(args[++i], par) ;                      break ;
00116                                 case M_PAR_BASIC_VOL_DIVISION : 
00117                                         status += parse_basic_vol_div(args[++i], par) ;         break ;
00118                                 case M_PAR_MIN_POCK_NB_ASPH   : 
00119                                         status += parse_min_pock_nb_asph(args[++i], par) ;      break ;
00120                                 case M_PAR_REFINE_DIST            : 
00121                                         status += parse_refine_dist(args[++i], par) ;           break ;
00122                                 case M_PAR_REFINE_MIN_NAPOL_AS: 
00123                                         status += parse_refine_minaap(args[++i], par) ; 
00124                                         break ;
00125                                 case M_PAR_DB_RUN :
00126                                         par->db_run=1;
00127                                         break;
00128 
00129                                 case M_PAR_PDB_LIST :
00130                                         pdb_lst = args[++i] ; 
00131                                         break ;
00132 
00133                                 case M_PAR_PDB_FILE                       : 
00134                                                 if(npdb >= 1) fprintf(stderr, 
00135                                                         "! Only first input pdb will be used.\n") ;
00136                                                 else {
00137                                                         strcpy(par->pdb_path, args[++i]) ; npdb++ ;
00138                                                 }
00139                                                 break ;
00140                                 default: break ;
00141                         }
00142                 }
00143         }
00144         
00145         if(status > 0) {
00146                 free_fparams(par) ;
00147                 print_pocket_usage(stdout);
00148                 return NULL ;
00149         }
00150         
00151         par->npdb = npdb ;
00152 
00153         /* Handle a file containing a list of PDB */
00154         if(pdb_lst != NULL) {
00155                 FILE *f = fopen(pdb_lst, "r") ;
00156                 if(f != NULL) {
00157                         /* Count the number of lines */
00158                         int n = 0 ;
00159                         char cline [M_MAX_PDB_NAME_LEN + 1] ;
00160                         
00161                         while(fgets(cline, M_MAX_PDB_NAME_LEN, f) != NULL) {
00162                                 if(strcmp("\n", cline) != 0) {
00163                                         n ++ ;
00164                                 }
00165                         }
00166                         fclose(f) ;
00167                         if(n == 0) {
00168                                 return par ;
00169                         }
00170                         
00171                         /* Allocate memory and store each line */
00172                         par->pdb_lst = (char **)my_malloc(n*sizeof(char*)) ;
00173 
00174                         f = fopen (pdb_lst, "r") ; 
00175                         int i = 0, l = 0 ;
00176                         char *line;
00177                         while(fgets(cline, M_MAX_PDB_NAME_LEN, f) != NULL) {
00178                                 if(strcmp("\n", cline) != 0) {
00179                                         l = strlen(cline) ;
00180                                         if(cline[l-1] == '\n') {
00181                                                 l-- ;
00182                                                 cline[l] = '\0' ;
00183                                         }
00184                                         line = (char *) my_malloc((l+1)*sizeof(char)) ;
00185                                         memcpy (line, cline, l+1);
00186         
00187                                         par->pdb_lst[i] = line ;
00188                                         i ++ ;
00189                                 }
00190                         }
00191                         
00192                         par->npdb = n ;
00193                 }
00194         }
00195 
00196         return par;
00197 }

s_fparams* init_def_fparams ( void   ) 

## FUNCTION: init_def_fparams

## SPECIFICATION: Initialisation of default parameters

## PARAMETRES: void

## RETURN: s_fparams*: Pointer to allocated paramers.

Definition at line 48 of file fparams.c.

References s_fparams::asph_max_size, s_fparams::asph_min_size, s_fparams::basic_volume_div, s_fparams::clust_max_dist, s_fparams::db_run, s_fparams::flag_do_asa_and_volume_calculations, M__MIN_APOL_NEIGH_DEFAULT, M_BASIC_VOL_DIVISION, M_CLUST_MAX_DIST, M_DB_RUN, M_MAX_ASHAPE_SIZE_DEFAULT, M_MC_ITER, M_MIN_ASHAPE_SIZE_DEFAULT, M_MIN_POCK_NB_ASPH, M_REFINE_DIST, M_REFINE_MIN_PROP_APOL_AS, M_SLCLUST_MAX_DIST, M_SLCLUST_MIN_NUM_NEIGH, s_fparams::min_apol_neigh, s_fparams::min_pock_nb_asph, my_malloc(), s_fparams::nb_mcv_iter, s_fparams::npdb, s_fparams::pdb_lst, s_fparams::pdb_path, s_fparams::refine_clust_dist, s_fparams::refine_min_apolar_asphere_prop, s_fparams::sl_clust_max_dist, and s_fparams::sl_clust_min_nneigh.

Referenced by get_fpocket_args().

00049 {
00050         s_fparams *par = (s_fparams *) my_malloc(sizeof(s_fparams)) ;
00051 
00052         par->min_apol_neigh = M__MIN_APOL_NEIGH_DEFAULT ;
00053         par->asph_min_size = M_MIN_ASHAPE_SIZE_DEFAULT ;
00054         par->asph_max_size = M_MAX_ASHAPE_SIZE_DEFAULT ;
00055         par->sl_clust_max_dist = M_SLCLUST_MAX_DIST ;
00056         par->sl_clust_min_nneigh = M_SLCLUST_MIN_NUM_NEIGH ;
00057         par->pdb_path[0] = 0 ;
00058         par->basic_volume_div = M_BASIC_VOL_DIVISION ;
00059         par->nb_mcv_iter = M_MC_ITER ;
00060         par->min_pock_nb_asph = M_MIN_POCK_NB_ASPH ;
00061         par->refine_clust_dist = M_REFINE_DIST ;
00062         par->refine_min_apolar_asphere_prop = M_REFINE_MIN_PROP_APOL_AS ;
00063         par->clust_max_dist = M_CLUST_MAX_DIST ;
00064         par->npdb = 0 ;
00065         par->pdb_lst = NULL ;
00066         par->flag_do_asa_and_volume_calculations=1;
00067         par->db_run=M_DB_RUN;
00068 
00069         return par ;
00070 }

int is_fpocket_opt ( const char  opt  ) 

## FUNCTION: is_fpocket_opt

## SPECIFICATION: Say either or not a single letter code is a fpocket option (excluding input file/list option.)

## PARAMETRES: @ const char opt: The one letter code option.

## RETURN: integer: 1 if it's a valid option parmeter, 0 if not.

Definition at line 529 of file fparams.c.

References M_PAR_BASIC_VOL_DIVISION, M_PAR_CLUST_MAX_DIST, M_PAR_MAX_ASHAPE_SIZE, M_PAR_MC_ITER, M_PAR_MIN_APOL_NEIGH, M_PAR_MIN_ASHAPE_SIZE, M_PAR_MIN_POCK_NB_ASPH, M_PAR_REFINE_DIST, M_PAR_REFINE_MIN_NAPOL_AS, M_PAR_SL_MAX_DIST, and M_PAR_SL_MIN_NUM_NEIGH.

Referenced by get_dpocket_args(), get_mdpocket_args(), and get_tpocket_args().

00530 {
00531         if( opt == M_PAR_MAX_ASHAPE_SIZE ||
00532                 opt == M_PAR_MIN_ASHAPE_SIZE ||
00533                 opt == M_PAR_MIN_APOL_NEIGH ||
00534                 opt == M_PAR_CLUST_MAX_DIST ||
00535                 opt == M_PAR_SL_MAX_DIST ||
00536                 opt == M_PAR_SL_MIN_NUM_NEIGH ||
00537                 opt == M_PAR_MC_ITER ||
00538                 opt == M_PAR_BASIC_VOL_DIVISION ||
00539                 opt == M_PAR_MIN_POCK_NB_ASPH ||
00540                 opt == M_PAR_REFINE_DIST ||
00541                 opt == M_PAR_REFINE_MIN_NAPOL_AS) {
00542                 return 1 ;
00543         }
00544 
00545         return 0 ;
00546 }

int parse_asph_max_size ( char *  str,
s_fparams p 
)

## FUNCTION: parse_asph_max_size

## SPECIFICATION: Parsing function for the maximum radius of each alpha shpere

## PARAMETERS: @ char *str : The string to parse @ s_fparams *p : The structure than will contain the parsed parameter

## RETURN: int: 0 if the parameter is valid (here a valid float), 1 if not

Definition at line 358 of file fparams.c.

References s_fparams::asph_max_size, M_NO_SIGN, and str_is_float().

Referenced by get_fpocket_args().

00359 {
00360         if(str_is_float(str, M_NO_SIGN)) {
00361                 p->asph_max_size = (float) atof(str) ;
00362         }
00363         else {
00364                 fprintf(stdout, "! Invalid value (%s) given for the max radius of alpha shperes.\n", str) ;
00365                 return 1 ;
00366         }
00367 
00368         return 0 ;
00369 }

int parse_asph_min_size ( char *  str,
s_fparams p 
)

## FUNCTION: parse_asph_min_size

## SPECIFICATION: Parsing function for the minimum radius of each alpha shpere

## PARAMETERS: @ char *str: The string to parse @ s_fparams *p: The structure than will contain the parsed parameter

## RETURN: int: 0 if the parameter is valid (here a valid float), 1 if not

Definition at line 330 of file fparams.c.

References s_fparams::asph_min_size, M_NO_SIGN, and str_is_float().

Referenced by get_fpocket_args().

00331 {
00332         if(str_is_float(str, M_NO_SIGN)) {
00333                 p->asph_min_size = (float) atof(str) ;
00334         }
00335         else {
00336                 fprintf(stdout, "! Invalid value (%s) given for the min radius of alpha shperes.\n", str) ;
00337                 return 1 ;
00338         }
00339 
00340         return 0 ;
00341 }

int parse_basic_vol_div ( char *  str,
s_fparams p 
)

## FUNCTION: parse_basic_vol_div

## SPECIFICATION: Parsing function for the number of iteration for the basic volume calculation.

## PARAMETERS: @ char *str : The string to parse @ s_fparams *p : The structure than will contain the parsed parameter

## RETURN: int: 0 if the parameter is valid (here a valid integer), 1 if not

Definition at line 415 of file fparams.c.

References s_fparams::basic_volume_div, M_NO_SIGN, and str_is_number().

Referenced by get_fpocket_args().

00416 {
00417         if(str_is_number(str, M_NO_SIGN)) {
00418                 p->basic_volume_div = (int) atoi(str) ;
00419         }
00420         else {
00421                 fprintf(stdout, "! Invalid value (%s) given for the precision of the basic volume calculation.\n", str) ;
00422                 return 1 ;
00423         }
00424 
00425         return 0 ;
00426 }

int parse_clust_max_dist ( char *  str,
s_fparams p 
)

## FUNCTION: parse_clust_max_dist

## SPECIFICATION: Parsing function for the distance criteria first clustering algorithm.

## PARAMETERS: @ char *str : The string to parse @ s_fparams *p : The structure than will contain the parsed parameter

## RETURN: int: 0 if the parameter is valid (here a valid float), 1 if not

Definition at line 214 of file fparams.c.

References s_fparams::clust_max_dist, M_NO_SIGN, and str_is_float().

Referenced by get_fpocket_args().

00215 {
00216         if(str_is_float(str, M_NO_SIGN)) {
00217                 p->clust_max_dist = atof(str) ;
00218         }
00219         else {
00220                 fprintf(stdout, "! Invalid value (%s) given for the single linkage max dist.\n", str) ;
00221                 return 1 ;
00222         }
00223 
00224         return 0 ;
00225 }

int parse_mc_niter ( char *  str,
s_fparams p 
)

## FUNCTION: parse_mc_niter

## SPECIFICATION: Parsing function for the number of iteration for the Monte Carlo volume calculation.

## PARAMETERS: @ char *str : The string to parse @ s_fparams *p : The structure than will contain the parsed parameter

## RETURN: int: 0 if the parameter is valid (here a valid float), 1 if not

Definition at line 387 of file fparams.c.

References M_NO_SIGN, s_fparams::nb_mcv_iter, and str_is_float().

Referenced by get_fpocket_args().

00388 {
00389         if(str_is_float(str, M_NO_SIGN)) {
00390                 p->nb_mcv_iter = (int) atoi(str) ;
00391         }
00392         else {
00393                 fprintf(stdout, "! Invalid value (%s) given for the number of monte-carlo iteration for the volume.\n", str) ;
00394                 return 1 ;
00395         }
00396 
00397         return 0 ;
00398 }

int parse_min_apol_neigh ( char *  str,
s_fparams p 
)

## FUNCTION: parse_min_apol_neigh

## SPECIFICATION: Parsing function for the minimum number of apolar contacted atom for an alpha sphere to be considered as apolar.

## PARAMETERS: @ char *str : The string to parse @ s_fparams *p : The structure than will contain the parsed parameter

## RETURN: int: 0 if the parameter is valid (here a valid int), 1 if not

Definition at line 300 of file fparams.c.

References M_NO_SIGN, s_fparams::min_apol_neigh, and str_is_number().

Referenced by get_fpocket_args().

00301 {
00302         if(str_is_number(str, M_NO_SIGN)) {
00303                 p->min_apol_neigh = (int) atoi(str) ;
00304                 if(p->min_apol_neigh < 0) p->min_apol_neigh = 0 ;
00305                 if(p->min_apol_neigh > 4) p->min_apol_neigh = 4 ;
00306         }
00307         else {
00308                 fprintf(stdout, "! Invalid value (%s) given for the min radius of alpha shperes.\n", str) ;
00309                 return 1 ;
00310         }
00311 
00312         return 0 ;
00313 }

int parse_min_pock_nb_asph ( char *  str,
s_fparams p 
)

## FUNCTION: parse_min_pock_nb_asph

## SPECIFICATION: Parsing function for the minimum number of alpha sphere per pocket.

## PARAMETERS: @ char *str : The string to parse @ s_fparams *p : The structure than will contain the parsed parameter

## RETURN: int: 0 if the parameter is valid (here a valid integer), 1 if not

Definition at line 499 of file fparams.c.

References M_NO_SIGN, s_fparams::min_pock_nb_asph, and str_is_number().

Referenced by get_fpocket_args().

00500 {
00501         if(str_is_number(str, M_NO_SIGN)) {
00502                 p->min_pock_nb_asph = (int) atoi(str) ;
00503         }
00504         else {
00505                 fprintf(stdout, "! Invalid value (%s) given for the refine distance.\n", str) ;
00506                 return 1 ;
00507         }
00508 
00509         return 0 ;
00510 }

int parse_refine_dist ( char *  str,
s_fparams p 
)

## FUNCTION: parse_refine_dist

## SPECIFICATION: Parsing function for the distance in the refine algorithm

## PARAMETERS: @ char *str : The string to parse @ s_fparams *p : The structure than will contain the parsed parameter

## RETURN: int: 0 if the parameter is valid (here a valid float), 1 if not

Definition at line 443 of file fparams.c.

References M_NO_SIGN, s_fparams::refine_clust_dist, and str_is_float().

Referenced by get_fpocket_args().

00444 {
00445         if(str_is_float(str, M_NO_SIGN)) {
00446                 p->refine_clust_dist = (float) atof(str) ;
00447         }
00448         else {
00449                 fprintf(stdout, "! Invalid value (%s) given for the refine distance.\n", str) ;
00450                 return 1 ;
00451         }
00452 
00453         return 0 ;
00454 }

int parse_refine_minaap ( char *  str,
s_fparams p 
)

## FUNCTION: parse_refine_min_apol

## SPECIFICATION: Parsing function for the minimum number of apolar sphere per pocket.

## PARAMETERS: @ char *str : The string to parse @ s_fparams *p : The structure than will contain the parsed parameter

## RETURN: int: 0 if the parameter is valid (here a valid integer), 1 if not

Definition at line 471 of file fparams.c.

References M_NO_SIGN, s_fparams::refine_min_apolar_asphere_prop, and str_is_float().

Referenced by get_fpocket_args().

00472 {
00473         if(str_is_float(str, M_NO_SIGN)) {
00474                 p->refine_min_apolar_asphere_prop = (float) atof(str) ;
00475         }
00476         else {
00477                 fprintf(stdout, "! Invalid value (%s) given for the refine distance.\n", str) ;
00478                 return 1 ;
00479         }
00480 
00481         return 0 ;
00482 }

int parse_sclust_max_dist ( char *  str,
s_fparams p 
)

## FUNCTION: parse_sclust_max_dist

## SPECIFICATION: Parsing function for the distance criteria in the single linkage clustering.

## PARAMETERS: @ char *str : The string to parse @ s_fparams *p : The structure than will contain the parsed parameter

## RETURN: int: 0 if the parameter is valid (here a valid float), 1 if not

Definition at line 243 of file fparams.c.

References M_NO_SIGN, s_fparams::sl_clust_max_dist, and str_is_float().

Referenced by get_fpocket_args().

00244 {
00245         if(str_is_float(str, M_NO_SIGN)) {
00246                 p->sl_clust_max_dist = atof(str) ;
00247         }
00248         else {
00249                 fprintf(stdout, "! Invalid value (%s) given for the single linkage max dist.\n", str) ;
00250                 return 1 ;
00251         }
00252 
00253         return 0 ;
00254 }

int parse_sclust_min_nneigh ( char *  str,
s_fparams p 
)

## FUNCTION: parse_sclust_min_nneigh

## SPECIFICATION: Parsing function for the number of neighbours in the single linkage clustering.

## PARAMETERS: @ char *str : The string to parse @ s_fparams *p : The structure than will contain the parsed parameter

## RETURN: int: 0 if the parameter is valid (here a valid int), 1 if not

Definition at line 271 of file fparams.c.

References M_NO_SIGN, s_fparams::sl_clust_min_nneigh, and str_is_number().

Referenced by get_fpocket_args().

00272 {
00273         if(str_is_number(str, M_NO_SIGN)) {
00274                 p->sl_clust_min_nneigh = atoi(str) ;
00275         }
00276         else {
00277                 fprintf(stdout, "! Invalid value (%s) given for the single linkage max dist.\n", str) ;
00278                 return 1 ;
00279         }
00280 
00281         return 0 ;
00282 }

void print_fparams ( s_fparams p,
FILE *  f 
)

## FUNCTION: print_fparams

## SPECIFICATION: Print function

## PARAMETRES: @ s_fparams *p : Parameters to print @ FILE *f : Buffer to write in

## RETURN:

Definition at line 611 of file fparams.c.

References s_fparams::asph_max_size, s_fparams::asph_min_size, s_fparams::basic_volume_div, s_fparams::clust_max_dist, s_fparams::min_apol_neigh, s_fparams::nb_mcv_iter, s_fparams::pdb_path, s_fparams::refine_clust_dist, s_fparams::refine_min_apolar_asphere_prop, s_fparams::sl_clust_max_dist, and s_fparams::sl_clust_min_nneigh.

00612 {
00613         if(p) {
00614                 fprintf(f, "==============\nParameters of fpocket: \n");
00615                 fprintf(f, "> Minimum alpha sphere radius: %f\n", p->asph_min_size);
00616                 fprintf(f, "> Maximum alpha sphere radius: %f\n", p->asph_max_size);
00617                 fprintf(f, "> Minimum number of apolar neighbor: %d\n", p->min_apol_neigh);
00618                 fprintf(f, "> Maximum distance for first clustering algorithm: %f \n", p->clust_max_dist) ;
00619                 fprintf(f, "> Single linkage clustering distance: %f\n", p->sl_clust_max_dist);
00620                 fprintf(f, "> Single linkage clustering neighbor: %d\n", p->sl_clust_min_nneigh);
00621                 fprintf(f, "> Refine clustering distance: %f\n", p->refine_clust_dist);
00622                 fprintf(f, "> Min number of apolar sphere in refine to keep a pocket: %f\n", p->refine_min_apolar_asphere_prop) ;
00623                 fprintf(f, "> Monte carlo iterations: %d\n", p->nb_mcv_iter);
00624                 fprintf(f, "> Basic method for volume calculation: %d\n", p->basic_volume_div);
00625                 fprintf(f, "> PDB file: %s\n", p->pdb_path);
00626                 fprintf(f, "==============\n");
00627         }
00628         else fprintf(f, "> No parameters detected\n");
00629 }

void print_pocket_usage ( FILE *  f  ) 

## FUNCTION: print_pocket_usage

## SPECIFICATION: Displaying usage of the programm in the given buffer

## PARAMETRES: @ FILE *f: buffer to print in

## RETURN: void

Definition at line 590 of file fparams.c.

References M_FP_USAGE.

Referenced by get_fpocket_args(), and main().

00591 {
00592         f = (f == NULL) ? stdout:f ;
00593 
00594         fprintf(f, M_FP_USAGE) ;
00595 }


Generated on Mon Jun 7 16:44:23 2010 for fpocket by  doxygen 1.5.6