Compare commits

..

12 Commits
4.0.2 ... 4.1

Author SHA1 Message Date
Peter Schmidtke
9c7be61644 Merge pull request #86 from jordansafer/master
Fix header typo for easier parsing
2023-02-22 04:16:15 -05:00
Peter Schmidtke
f05cdb7cdd Merge pull request #97 from Discngine/mypocket
Adding support for definition of explicit pockets
2023-02-22 04:04:43 -05:00
pschmidtke
115128de62 fix for mmcif structures & explicit pockets 2023-02-22 10:01:48 +01:00
pschmidtke
ee1cc7373f missing voronoi.c 2023-02-20 14:20:43 +01:00
pschmidtke
ac18b146ff functional in PDB format 2023-02-20 14:16:06 +01:00
pschmidtke
9c2cbca91a parameter parsing finished 2023-02-20 08:00:22 +01:00
pschmidtke
c00ab205b6 backup 2023-02-18 22:39:41 +01:00
pschmidtke
86a4a97ac7 first steps in fparams 2023-02-16 07:23:36 +01:00
pschmidtke
ce4997d6e6 introducing P parameter (WIP) 2023-02-13 09:27:34 +01:00
pschmidtke
a0bbee64f8 Explicit pockets with various alternates handling 2023-02-02 11:43:24 +01:00
Peter Schmidtke
d82104b99a Dropping for security reasons 2022-10-24 13:47:59 +02:00
Jordan Safer
5ef19079e9 Fix header typo for easier parsing 2022-10-11 12:18:32 -04:00
14 changed files with 681 additions and 624 deletions

View File

@@ -1,24 +0,0 @@
FROM centos:7
#RUN yum -y install epel-release && yum -y update && yum -y install gcc gcc-c++ make netcdf-devel; yum clean all
RUN yum -y install gcc gcc-c++ make netcdf-devel; yum clean all
# all of this mess is essentially to have a minimalistic build at the end
COPY makefile /opt/fpocket/
COPY src /opt/fpocket/src
COPY man /opt/fpocket/man
COPY headers /opt/fpocket/headers
COPY obj /opt/fpocket/obj
COPY scripts /opt/fpocket/scripts
COPY bin /opt/fpocket/bin
COPY plugins/LINUXAMD64 /opt/fpocket/plugins/LINUXAMD64
COPY plugins/include /opt/fpocket/plugins/include
COPY plugins/noarch /opt/fpocket/plugins/noarch
WORKDIR /opt/fpocket
RUN make; make install; make clean
WORKDIR /WORKDIR
CMD ["fpocket"]

View File

@@ -452,10 +452,11 @@ The simplest way to run fpocket is either by providing a single pdb file, or by
-b (none): (NOT USED BY DEFAULT) This option allows the user to choose a discrete algorithm to calculate the volume of each pocket instead of the Monte Carlo method. This algorithm puts each pocket into a grid of dimension (1/N*X ; 1/N*Y ; 1/N*Z), N being the value given using this option, and X, Y and Z being the box dimensions, determined using coordinates of vertices. Then, a triple iteration on each dimensions is used to estimate the volume, checking if each points given by the iteration is in one of the pockets vertices. This parameter defines the grid discretization. If this parameter is used, this algorithm will be used instead of the Monte Carlo algorithm.
Warning: Although this algorithm could be more accurate, a high value might dramatically slow down the program, as this algorithm has a maximum complexity of N*N*N*nb_vertices, and a minimum of N*N*N !!!
-d (none): Option allowing you to output pockets and properties in a condensed format. This will put to the stdout pocket properties in a tab separated string and write pocket files in a subfolder
-r string: (None) This parameter allows you to run fpocket in a restricted mode. Let's suppose you have a very shallow or large pocket with a ligand inside and the automatic pocket prediction always splits up you pocket or you have only a part of the pocket found. Specifying your ligand residue with -r allows you to detect and characterize you ligand binding site explicitly. For instance for `1UYD.pdb` you can specify `-r 1224:PU8:A` (residue number of the ligand: residue name of the ligand: chain of the ligand)
-P string: (None) Binding site delimited by the user through the input. You can inidcate which amino-acids are part of the binding site you'd like to "identify" and calculate descriptors for. fpocket will run its usual alpha-sphere detection and clustering will be guided to collect all alpha spheres in contact with residues of interest. You should enter a string of residues with residue numbers, insertion codes & chain codes: 'residuenumber1:insertioncode1:chaincode1.residuenumber2:insertioncode2:chaincode2.residuenumber3:insertioncode3:chaincode3'. Insertion codes can be empty. `-P 107::A.138::A.51::A.98::A.55::A.93::A` for instance for part of the HSP90 binding site of 4cwr. NB: If you use an mmcif file as input, you need to use the automatically assigned residue number instead of author defined number for this to work.
-y string: (filename) EXPERIMENTAL: here you can specify a topology filename in the Amber prmtop format. This can then be used by fpocket & mdpocket to calculate energy grids for your pockets. NB: you have to specify the -x flag to run energy calculations

View File

@@ -148,6 +148,5 @@ If you manage to build for other architectures and it works, I'd be happy to acc
## Read next
* [Getting Started](GETTINGSTARTED.md)
* [Getting Started & Advanced Features](GETTINGSTARTED.md)
* [Advanced Features](ADVANCED.md)

View File

@@ -40,6 +40,4 @@ We are happy about positive, negative, in any way constructive feedback.
* [Installation](INSTALLATION.md)
* [Getting Started](GETTINGSTARTED.md)
* [Advanced Features](ADVANCED.md)
* [Getting Started](GETTINGSTARTED.md)

View File

@@ -30,84 +30,88 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/* Options of the pocket finder program */
/* standard parameters */
#define M_MIN_ASHAPE_SIZE_DEFAULT 3.4 /**< Use min alpha sphere radius of : 3.0 */ /*3.2, 2.6, */
#define M_MIN_ASHAPE_SIZE_DEFAULT 3.4/**< Use min alpha sphere radius of : 3.0 */ /*3.2, 2.6, */
#define M_MAX_ASHAPE_SIZE_DEFAULT 6.2 /**< Use max alpha sphere radius of : 6.0 */ /*7.0, 7.4, */
#define M_MAX_ASHAPE_SIZE_DEFAULT 6.2/**< Use max alpha sphere radius of : 6.0 */ /*7.0, 7.4, */
#define M_CLUST_MAX_DIST 2.4 /**< Use first connection distance (see report) : 2.0 */ /*1.8, 11.2, */
#define M_CLUST_MAX_DIST 2.4/**< Use first connection distance (see report) : 2.0 */ /*1.8, 11.2, */
#define M_REFINE_DIST 4.5 /**< use second connection distance (see report) : 4.5 */
#define M_REFINE_DIST 4.5/**< use second connection distance (see report) : 4.5 */
#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 */
#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 */
#define M_MC_ITER 300 /**< Number of iterations for the Monte Carlo volume calculation 3000 */
#define M_MC_ITER 300/**< Number of iterations for the Monte Carlo volume calculation 3000 */
#define M_BASIC_VOL_DIVISION -1 /**< Precision for "exact" volume integration, set to -1 if not used -1 */
#define M_BASIC_VOL_DIVISION -1/**< Precision for "exact" volume integration, set to -1 if not used -1 */
#define M_MIN_POCK_NB_ASPH 15 /**< Minimum number of alpha spheres for a pocket to be kept */
#define M_MIN_POCK_NB_ASPH 15/**< Minimum number of alpha spheres for a pocket to be kept */
#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 */
#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 */
#define M_DISTANCE_MEASURE 'e' /**< By default use euclidean distance measure for clustering*/
#define M_CLUSTERING_METHOD 's' /**< Clustering method to be used for alpha sphere clustering*/ /*s*/
#define M_DB_RUN 0 /**< default value for running fpocket for populating a database, 0 default*/
#define M_DB_RUN 0 /**< default value for running fpocket for populating a database, 0 default*/
#define M_MAX_CHAINS_DELETE 20
#define M_MAX_CHAINS_DELETE 20
#define M_MIN_AS_DENSITY 0.7
#define M_PAR_PDB_FILE 'f' /**< flag to give a single pdb input file*/
#define M_PAR_LONG_PDB_FILE "file" /**< flag to give a single pdb input file*/
#define M_MIN_N_EXPLICIT_POCKET 4 /**default value for minimum number of atoms part of the explicit pocket for an alpha sphere (between 0 and 4)*/
#define M_PAR_PDB_LIST 'F' /**< flag to give a txt file containing paths to multiple pdb files*/
#define M_PAR_LONG_PDB_LIST "fileList" /**< flag to give a txt file containing paths to multiple pdb files*/
#define M_PAR_PDB_FILE 'f' /**< flag to give a single pdb input file*/
#define M_PAR_LONG_PDB_FILE "file" /**< flag to give a single pdb input file*/
#define M_PAR_MAX_ASHAPE_SIZE 'M' /**< flag for the maximum alpha sphere size*/
#define M_PAR_LONG_MAX_ASHAPE_SIZE "max_alpha_size" /**< flag for the maximum alpha sphere size*/
#define M_PAR_PDB_LIST 'F' /**< flag to give a txt file containing paths to multiple pdb files*/
#define M_PAR_LONG_PDB_LIST "fileList" /**< flag to give a txt file containing paths to multiple pdb files*/
#define M_PAR_MIN_ASHAPE_SIZE 'm' /**< flag for the minimum alpha sphere size*/
#define M_PAR_LONG_MIN_ASHAPE_SIZE "min_alpha_size" /**< flag for the minimum alpha sphere size*/
#define M_PAR_MAX_ASHAPE_SIZE 'M' /**< flag for the maximum alpha sphere size*/
#define M_PAR_LONG_MAX_ASHAPE_SIZE "max_alpha_size" /**< flag for the maximum alpha sphere size*/
#define M_PAR_MIN_APOL_NEIGH 'A' /**< flag for the minimum number of apolar neighbours for an alpha sphere to be considered as apolar*/
#define M_PAR_LONG_MIN_APOL_NEIGH "number_apol_asph_pocket" /**< flag for the minimum number of apolar neighbours for an alpha sphere to be considered as apolar*/
#define M_PAR_MIN_ASHAPE_SIZE 'm' /**< flag for the minimum alpha sphere size*/
#define M_PAR_LONG_MIN_ASHAPE_SIZE "min_alpha_size" /**< flag for the minimum alpha sphere size*/
#define M_PAR_CLUST_MAX_DIST 'D' /**< flag for clustering distance*/
#define M_PAR_LONG_CLUST_MAX_DIST "clustering_distance" /**< flag for clustering distance*/
#define M_PAR_MIN_APOL_NEIGH 'A' /**< flag for the minimum number of apolar neighbours for an alpha sphere to be considered as apolar*/
#define M_PAR_LONG_MIN_APOL_NEIGH "number_apol_asph_pocket" /**< flag for the minimum number of apolar neighbours for an alpha sphere to be considered as apolar*/
#define M_PAR_MC_ITER 'v' /**< flag for how many iterations for the monte carlo volume calculation algorithm*/
#define M_PAR_LONG_MC_ITER "iterations_volume_mc" /**< flag for how many iterations for the monte carlo volume calculation algorithm*/
#define M_PAR_CLUST_MAX_DIST 'D' /**< flag for clustering distance*/
#define M_PAR_LONG_CLUST_MAX_DIST "clustering_distance" /**< flag for clustering distance*/
#define M_PAR_BASIC_VOL_DIVISION 'b'/**< flag for the space approximation of the MC*/
#define M_PAR_MIN_POCK_NB_ASPH 'i' /**< flag for the min number of alpha spheres in the pocket*/
#define M_PAR_LONG_MIN_POCK_NB_ASPH "min_spheres_per_pocket" /**< flag for the min number of alpha spheres in the pocket*/
#define M_PAR_MC_ITER 'v' /**< flag for how many iterations for the monte carlo volume calculation algorithm*/
#define M_PAR_LONG_MC_ITER "iterations_volume_mc" /**< flag for how many iterations for the monte carlo volume calculation algorithm*/
#define M_PAR_REFINE_MIN_NAPOL_AS 'p'/**< flag for minimum proportion of apolar alpha spheres*/
#define M_PAR_LONG_REFINE_MIN_NAPOL_AS "ratio_apol_spheres_pocket"/**< flag for minimum proportion of apolar alpha spheres*/
#define M_PAR_BASIC_VOL_DIVISION 'b' /**< flag for the space approximation of the MC*/
#define M_PAR_MIN_POCK_NB_ASPH 'i' /**< flag for the min number of alpha spheres in the pocket*/
#define M_PAR_LONG_MIN_POCK_NB_ASPH "min_spheres_per_pocket" /**< flag for the min number of alpha spheres in the pocket*/
#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*/
#define M_PAR_LONG_DB_RUN "pocket_descr_stdout" /**<flag for running fpocket as database run, more silent and special output is produced for automatic grabbing of results using other programs*/
#define M_PAR_REFINE_MIN_NAPOL_AS 'p' /**< flag for minimum proportion of apolar alpha spheres*/
#define M_PAR_LONG_REFINE_MIN_NAPOL_AS "ratio_apol_spheres_pocket" /**< flag for minimum proportion of apolar alpha spheres*/
#define M_PAR_CLUSTERING_METHOD 'C' /**<flag for specifying the clustering method to use for alpha sphere clustering*/
#define M_PAR_LONG_CLUSTERING_METHOD "clustering_method" /**<flag for specifying the clustering method to use for alpha sphere clustering*/
#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*/
#define M_PAR_LONG_DB_RUN "pocket_descr_stdout" /**<flag for running fpocket as database run, more silent and special output is produced for automatic grabbing of results using other programs*/
#define M_PAR_DISTANCE_MEASURE 'e' /**<flag for specifying the distance measure*/
#define M_PAR_CLUSTERING_METHOD 'C' /**<flag for specifying the clustering method to use for alpha sphere clustering*/
#define M_PAR_LONG_CLUSTERING_METHOD "clustering_method" /**<flag for specifying the clustering method to use for alpha sphere clustering*/
#define M_PAR_DISTANCE_MEASURE 'e' /**<flag for specifying the distance measure*/
#define M_PAR_LONG_DISTANCE_MEASURE "clustering_measure" /**<flag for specifying the distance measure*/
#define M_PAR_GRID_CALCULATION 'x' /**<flag for specifying the distance measure*/
#define M_PAR_GRID_CALCULATION 'x' /**<flag for specifying the distance measure*/
#define M_PAR_LONG_GRID_CALCULATION "calculate_interaction_grids" /**<flag for specifying the distance measure*/
#define M_PAR_TOPOLOGY 'y' /**<flag for specifying a molecular topology suitable for FF calculations*/
#define M_PAR_TOPOLOGY 'y' /**<flag for specifying a molecular topology suitable for FF calculations*/
#define M_PAR_LONG_TOPOLOGY "topology_file" /**<flag for specifying a molecular topology suitable for FF calculations*/
#define M_PAR_MODEL_FLAG 'l' /**<flag for analyzing a specific model in multimodel structures*/
#define M_PAR_MODEL_FLAG 'l' /**<flag for analyzing a specific model in multimodel structures*/
#define M_PAR_MODEL_FLAG_LONG "model_number" /**<flag for anamyzing a specific model in multimodel structures*/
#define M_PAR_CUSTOM_LIGAND 'r' /**flag, to define detection of explicit pockets around the specified ligand*/
#define M_PAR_CUSTOM_LIGAND_LONG "custom_ligand"
#define M_PAR_CUSTOM_POCKET 'P' /** flag to define a specific location to calculate the binding site on*/
#define M_PAR_CUSTOM_POCKET_LONG "custom_pocket"
#define M_PAR_DROP_CHAINS 'c' /**flag, to define which chain are dropped before the pocket detection*/
#define M_PAR_DROP_CHAINS_LONG "drop_chains"
@@ -120,8 +124,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#define M_PAR_WRITE_MODE 'w' /**flag, to define which chains are defined as a ligand*/
#define M_PAR_WRITE_MODE_LONG "write_mode"
#define M_PAR_MIN_N_EXPLICIT_POCKET 'u'
#define M_PAR_MIN_N_EXPLICIT_POCKET_LONG "min_n_explicit_pocket"
#define M_FP_USAGE "\n\
***** USAGE (fpocket) *****\n\
@@ -164,78 +168,82 @@ Pocket finding on a pdb - list of pdb - file(s): \n\
\t c : centroid linkage clustering\n\
\nSee the manual (man fpocket), or the full documentation for\n\
more information.\n\
***************************\n",M_PAR_PDB_FILE,M_PAR_LONG_PDB_FILE,M_PAR_PDB_LIST,M_PAR_LONG_PDB_LIST /**< the usage print content*/
***************************\n", \
M_PAR_PDB_FILE, M_PAR_LONG_PDB_FILE, M_PAR_PDB_LIST, M_PAR_LONG_PDB_LIST /**< the usage print content*/
/* --------------------------- PUBLIC STRUCTURES ---------------------------- */
/**
Structure containing all necessary parameters that can be changed by the user.
This structure is commun to both programs (validation and pocket finding),
This structure is commun to both programs (validation and pocket finding),
even if the pocked finding programm doesn't need some parameters.
*/
typedef struct s_fparams
{
char pdb_path[M_MAX_PDB_NAME_LEN] ; /**< The pdb file */
char topology_path[M_MAX_PDB_NAME_LEN]; /**< a putative topology file*/
char custom_ligand[M_MAX_PDB_NAME_LEN]; /**container for custom pocket detection using a particular ligand*/
char **pdb_lst ;
char xlig_chain_code[3];
char xlig_resname[3];
int xlig_resnumber;
char distance_measure;
char clustering_method;
int npdb ; /**< number of pdb files*/
short fpocket_running;
int flag_do_asa_and_volume_calculations; /**<if 1, asa and volume calculations are performed(slower), if 0, not*/
int db_run; /**< flag for running fpocket for db population*/
int model_number; /**<number of model to be analyzed>*/
unsigned short flag_do_grid_calculations; /**< if 1 do grid calculations and output these*/
int min_apol_neigh, /**< Min number of apolar neighbours for an a-sphere
to be an apolar a-sphere */
nb_mcv_iter, /**< Number of iteration for the Monte Carlo volume
calculation */
basic_volume_div, /**< Box division factor for basic volume calculation */
min_pock_nb_asph; /**< Minimump number of alpha spheres per pocket */
char pdb_path[M_MAX_PDB_NAME_LEN]; /**< The pdb file */
char topology_path[M_MAX_PDB_NAME_LEN]; /**< a putative topology file*/
char custom_ligand[M_MAX_PDB_NAME_LEN]; /**container for custom pocket detection using a particular ligand*/
char custom_pocket_arg[M_MAX_CUSTOM_PÖCKET_LEN];
char **pdb_lst;
char xlig_chain_code[3];
char xlig_resname[3];
int xlig_resnumber;
int xpocket_n; /**number of residues defining the pocket to consider*/
char *xpocket_chain_code;
char *xpocket_insertion_code;
unsigned short *xpocket_residue_number;
char distance_measure;
char clustering_method;
int min_n_explicit_pocket_atoms; /**Minimum numer of atoms in contact with an alpha sphere part of the explicitly defined pocket in order to be considered as valid*/
int npdb; /**< number of pdb files*/
short fpocket_running;
int flag_do_asa_and_volume_calculations; /**<if 1, asa and volume calculations are performed(slower), if 0, not*/
int db_run; /**< flag for running fpocket for db population*/
int model_number; /**<number of model to be analyzed>*/
unsigned short flag_do_grid_calculations; /**< if 1 do grid calculations and output these*/
int min_apol_neigh, /**< Min number of apolar neighbours for an a-sphere
to be an apolar a-sphere */
nb_mcv_iter, /**< Number of iteration for the Monte Carlo volume
calculation */
basic_volume_div, /**< Box division factor for basic volume calculation */
min_pock_nb_asph; /**< Minimump number of alpha spheres per pocket */
float clust_max_dist, /**< First clustering distance criteria */
refine_min_apolar_asphere_prop, /**< Min proportion of apolar alpha
spheres for each pocket */
float clust_max_dist, /**< First clustering distance criteria */
refine_min_apolar_asphere_prop, /**< Min proportion of apolar alpha
spheres for each pocket */
asph_min_size, /**< Minimum size of alpha spheres to keep */
min_as_density, /**<Minimum alpha sphere density for a pocket to be retained*/
asph_max_size ; /**< Maximum size of alpha spheres to keep */
asph_min_size, /**< Minimum size of alpha spheres to keep */
min_as_density, /**<Minimum alpha sphere density for a pocket to be retained*/
asph_max_size; /**< Maximum size of alpha spheres to keep */
char chain_delete[M_MAX_CHAINS_DELETE]; /*chosen chain to delete before calculation*/
char chain_as_ligand[M_MAX_CHAINS_DELETE];
int chain_is_kept;/* To choose if we keep the chains or not*/
int chain_is_kept; /* To choose if we keep the chains or not*/
char write_par[10]; /*write mode : d -> default | b -> both pdb and mmcif | p ->pdb | m -> mmcif*/
} s_fparams ;
} s_fparams;
/* ------------------------------- PROTOTYPES ------------------------------- */
s_fparams* init_def_fparams(void) ;
s_fparams* get_fpocket_args(int nargs, char **args) ;
s_fparams *init_def_fparams(void);
s_fparams *get_fpocket_args(int nargs, char **args);
int parse_clust_max_dist(char *str, s_fparams *p) ;
int parse_clust_max_dist(char *str, s_fparams *p);
int parse_clustering_method(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_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_distance_measure(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 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) ;
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) ;
void free_fparams(s_fparams *p);
void print_pocket_usage(FILE *f);
void print_fparams(s_fparams *p, FILE *f);
#endif

View File

@@ -34,7 +34,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/* ------------------------------- PUBLIC MACROS ---------------------------- */
#define M_MAX_PDB_NAME_LEN 200 /**< maximum pdb filename length*/
#define M_MAX_CUSTOM_PÖCKET_LEN 8000 /** maximum length for a custom pocket string*/
#define M_SIGN 1
#define M_NO_SIGN 0

View File

@@ -8,7 +8,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
*/
#ifndef DH_VORONOI
#define DH_VORONOI
@@ -27,7 +26,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#include "calc.h"
#include "utils.h"
#include "../src/qhull/src//qvoronoi/qvoronoi.h"
#include "../src/qhull/src/qconvex/qconvex.h"
@@ -36,62 +34,61 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/* ----------------------------------MACROS--------------------------------- */
#define M_VORONOI_SUCCESS 0 /**< alpha sphere type - hydrophobic alpha sphere */
#define M_APOLAR_AS 0 /**< alpha sphere type - hydrophilic alpha sphere */
#define M_POLAR_AS 1
#define M_APOLAR_AS 0 /**< alpha sphere type - hydrophilic alpha sphere */
#define M_POLAR_AS 1
#define M_PREC_TOLERANCE 1e-3 /**< tolerance for coordinate imprecion during alpha sphere search*/
#define M_BUFSIZE 1e6 /**< buffer size*/
#define M_N_REPLICAS 1 /**< currently not used anymore : number of times we do the voronoi tesselation for translated coordinates to avoid precision problems with qhull */
#define M_BUFSIZE 1e6 /**< buffer size*/
#define M_N_REPLICAS 1 /**< currently not used anymore : number of times we do the voronoi tesselation for translated coordinates to avoid precision problems with qhull */
/* --------------------------------STRUCTURES-------------------------------- */
/**
Container of the Voronoi vertice
*/
typedef struct s_vvertice
typedef struct s_vvertice
{
int resid ; /**< residue ID*/
int id, /**< vertice ID*/
seen, /**< Say if we have seen this vertice during a neighbor search */
qhullId, /**< ID of the vertice in qhull output*/
type ; /**< 0 if apolar contacts, 1 if polar */
int resid; /**< residue ID*/
int id, /**< vertice ID*/
seen, /**< Say if we have seen this vertice during a neighbor search */
qhullId, /**< ID of the vertice in qhull output*/
type; /**< 0 if apolar contacts, 1 if polar */
float ray ; /**< Ray of voronoi vertice */
float x, /**< X coord */
y, /**< Y coord */
z ; /**< Z coord */
int sort_x; /**< Index in the sorted tab by X coord */
int apol_neighbours; /**< number of neighbouring apolar alpha spheres */
float ray; /**< Ray of voronoi vertice */
float x, /**< X coord */
y, /**< Y coord */
z; /**< Z coord */
int vneigh[4] ; /**< vertice neighbours (4 contact atoms)*/
s_atm *neigh[4] ; /**< The theorical 4 contacted atoms */
float bary[3] ; /**< Barycenter of the pocket */
float electrostatic_energy; /**<estimate of electrostatic energy around the alpha sphere */
int sort_x; /**< Index in the sorted tab by X coord */
int apol_neighbours; /**< number of neighbouring apolar alpha spheres */
} s_vvertice ;
int vneigh[4]; /**< vertice neighbours (4 contact atoms)*/
s_atm *neigh[4]; /**< The theorical 4 contacted atoms */
float bary[3]; /**< Barycenter of the pocket */
float electrostatic_energy; /**<estimate of electrostatic energy around the alpha sphere */
} s_vvertice;
/**
vertice list container
*/
typedef struct s_lst_vvertice
{
s_vvertice *vertices ; /**< List of voronoi vertices */
s_vvertice **pvertices ; /**< list of pointers to vertices*/
s_vvertice *vertices; /**< List of voronoi vertices */
s_vvertice **pvertices; /**< list of pointers to vertices*/
/* Indexes of heavy atoms used as input for qhull in the s_pdb list of atoms */
int *h_tr;
int *h_tr;
/* Size of h_tr */
int n_h_tr;
int n_h_tr;
int *tr, /**< translation of voronoi vertice indices*/
nvert, /**< no of vertices*/
qhullSize ; /**< number of vertices in qhull*/
} s_lst_vvertice ;
int *tr, /**< translation of voronoi vertice indices*/
nvert, /**< no of vertices*/
qhullSize; /**< number of vertices in qhull*/
} s_lst_vvertice;
/**
* clusterlib vertice info container
@@ -99,63 +96,57 @@ typedef struct s_lst_vvertice
typedef struct s_clusterlib_vertices
{
double ** pos; /**< Positions (xyz) of Voronoi vertices*/
int ** mask; /**< Mask for position array*/
double weight[3]; /**< column (coordinate weights for distance matrix calculation*/
int transpose; /**< cluster by rows (transpose=0) or column(transpose=1)*/
char dist; /**< char defining distance measure used*/
char method; /**< char defining method used (clustering)*/
double **pos; /**< Positions (xyz) of Voronoi vertices*/
int **mask; /**< Mask for position array*/
double weight[3]; /**< column (coordinate weights for distance matrix calculation*/
int transpose; /**< cluster by rows (transpose=0) or column(transpose=1)*/
char dist; /**< char defining distance measure used*/
char method; /**< char defining method used (clustering)*/
} s_clusterlib_vertices ;
} s_clusterlib_vertices;
/* -----------------------------PROTOTYPES----------------------------------- */
s_lst_vvertice* load_vvertices_DEPRECATED(s_pdb *pdb, int min_apol_neigh,
float ashape_min_size, float ashape_max_size,
float xshift,float yshift, float zshift) ;
s_lst_vvertice* load_vvertices(s_pdb *pdb, int min_apol_neigh, float asph_min_size, float asph_max_size,float xshift,float yshift,float zshift);
s_lst_vvertice *load_vvertices(s_pdb *pdb, s_fparams *params, float xshift, float yshift, float zshift);
void fill_vvertices(s_lst_vvertice *lvvert, const char fpath[], s_atm *atoms, int natoms,
int min_apol_neigh, float asph_min_size, float asph_max_size,
float xshift, float yshift, float zshift,float avg_bfactor,s_pdb *pdb) ;
s_fparams *params,
float xshift, float yshift, float zshift, float avg_bfactor, s_pdb *pdb);
void add_missing_vvertices(s_lst_vvertice *lvvert, const char fpath[], s_atm *atoms,
int min_apol_neigh, float asph_min_size, float asph_max_size,
float xshift, float yshift,float zshift, float avg_bfactor,s_pdb *pdb);
void add_missing_vvertices(s_lst_vvertice *lvvert, const char fpath[], s_atm *atoms,
s_fparams *params,
float xshift, float yshift, float zshift, float avg_bfactor, s_pdb *pdb);
unsigned short check_if_similar_vertice_in_list(s_vvertice *v, s_lst_vvertice *lvvert);
void add_vertice_to_vertice_list(s_lst_vvertice *lvvert,s_vvertice *v);
void copy_vertice(s_vvertice *v1,s_vvertice *v2, int n);
void add_vertice_to_vertice_list(s_lst_vvertice *lvvert, s_vvertice *v);
void copy_vertice(s_vvertice *v1, s_vvertice *v2, int n);
float testVvertice(float xyz[3], int curNbIdx[4], s_atm *atoms,
float min_asph_size, float max_asph_size,
s_lst_vvertice *lvvert,
float xshift, float yshift, float zshift,float avg_bfactor,s_pdb *pdb);
float testVvertice(float xyz[3], int curNbIdx[4], s_atm *atoms,
s_fparams *params,
s_lst_vvertice *lvvert,
float xshift, float yshift, float zshift, float avg_bfactor, s_pdb *pdb);
float atom_in_explicit_pocket(s_atm *cura, s_fparams *params);
s_lst_vvertice *compare_vvertice_shifted_lists(s_lst_vvertice *lvvert,
s_lst_vvertice *list_shifted,float xshift,float yshift,float zshift);
s_lst_vvertice *list_shifted, float xshift, float yshift, float zshift);
double **get_3d_array_from_vvertice_list(s_lst_vvertice *lvvert);
s_clusterlib_vertices *prepare_vertices_for_cluster_lib(s_lst_vvertice *lvvert,char c_method,char d_method);
void set_barycenter(s_vvertice *v) ;
int is_in_lst_vert(s_vvertice **lst_vert, int nb_vert, int v_id) ;
s_clusterlib_vertices *prepare_vertices_for_cluster_lib(s_lst_vvertice *lvvert, char c_method, char d_method);
void set_barycenter(s_vvertice *v);
int is_in_lst_vert(s_vvertice **lst_vert, int nb_vert, int v_id);
int is_in_lst_vert_p(s_vvertice **lst_vert, int nb_vert, s_vvertice *vert);
void write_pqr_vert(FILE *f, s_vvertice *v, int i) ;
void write_pdb_vert(FILE *f, s_vvertice *v, int i) ;
void write_pqr_vert(FILE *f, s_vvertice *v, int i);
void write_pdb_vert(FILE *f, s_vvertice *v, int i);
void write_mmcif_vert(FILE *f, s_vvertice *v, int i);
float get_verts_volume_ptr(s_vvertice **verts, int nvert, int niter,float correct);
float get_verts_volume_ptr(s_vvertice **verts, int nvert, int niter, float correct);
float get_convex_hull_volume(s_vvertice **verts, int nvert);
void print_vvertices(FILE *f, s_lst_vvertice *lvvert) ;
void free_vert_lst(s_lst_vvertice *lvvert) ;
void print_vvertices(FILE *f, s_lst_vvertice *lvvert);
void free_vert_lst(s_lst_vvertice *lvvert);
void transferClustersToVertices(int **clusterIds,s_lst_vvertice *lvert);
void transferClustersToVertices(int **clusterIds, s_lst_vvertice *lvert);
double frand_a_b(double a, double b);
int free_cluster_lib_vertices(s_clusterlib_vertices *clusterlib_vertices, int nvert);

View File

@@ -35,7 +35,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
## 27-11-08 (v) PDB file check moved in fpmain + minor modif + relooking
## 01-04-08 (v) Added comments and creation of history
## 01-01-08 (vp) Created (random date...)
##
##
## TODO or SUGGESTIONS
##
## (v) Check and update if necessary comments of each function!!
@@ -46,18 +46,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/**
## FUNCTION:
init_def_fparams
## SPECIFICATION:
Initialisation of default parameters
## PARAMETRES: void
## RETURN:
## RETURN:
s_fparams*: Pointer to allocated paramers.
*/
char write_mode[10] = "d"; /*write mode : d -> default | b -> both pdb and mmcif |
char write_mode[10] = "d"; /*write mode : d -> default | b -> both pdb and mmcif |
p ->pdb | m -> mmcif*/
s_fparams *init_def_fparams(void)
@@ -87,34 +87,40 @@ s_fparams *init_def_fparams(void)
par->xlig_resnumber = -1;
par->chain_is_kept = 0;
par->write_par[0] = 'd';
par->xpocket_n = 0;
par->min_n_explicit_pocket_atoms = M_MIN_N_EXPLICIT_POCKET;
return par;
}
/**
## FUNCTION:
## FUNCTION:
get_fpocket_args
## SPECIFICATION:
## 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:
## RETURN:
s_params*: Pointer to parameters
*/
s_fparams *get_fpocket_args(int nargs, char **args)
{
int status = 0;
s_fparams *par = init_def_fparams(); /*default param initialy*/
int c = 0;
int apti = 0;
int pti = 0;
short j = 0;
short xflag;
opterr = 0;
char *pt;
char *apt;
char *residue_string[M_MAX_CUSTOM_PÖCKET_LEN];
short custom_ligand_i = 0;
static struct option fplong_options[] = {/*long options args located in fparams.h*/
@@ -133,6 +139,8 @@ s_fparams *get_fpocket_args(int nargs, char **args)
{"topology_file", required_argument, 0, M_PAR_TOPOLOGY},
{"model_number", required_argument, 0, M_PAR_MODEL_FLAG},
{"custom_ligand", required_argument, 0, M_PAR_CUSTOM_LIGAND},
{"custom_pocket", required_argument, 0, M_PAR_CUSTOM_POCKET},
{M_PAR_MIN_N_EXPLICIT_POCKET_LONG, required_argument, 0, M_PAR_MIN_N_EXPLICIT_POCKET},
{M_PAR_DROP_CHAINS_LONG, required_argument, 0, M_PAR_DROP_CHAINS}, /*drop chains*/
{M_PAR_CHAIN_AS_LIGAND_LONG, required_argument, 0, M_PAR_CHAIN_AS_LIGAND}, /*chain as ligand*/
{M_PAR_KEEP_CHAINS_LONG, required_argument, 0, M_PAR_KEEP_CHAINS}, /*chain as ligand*/
@@ -145,7 +153,7 @@ s_fparams *get_fpocket_args(int nargs, char **args)
/* getopt_long stores the option index here. */
int option_index = 0;
optarg = 0;
c = getopt_long(nargs, args, "f:m:M:i:p:D:C:e:dxp:v:y:l:r:c:a:k:w:",
c = getopt_long(nargs, args, "f:m:M:i:p:D:C:e:dxp:v:y:l:r:P:u:c:a:k:w:",
fplong_options, &option_index);
// printf("C: %d nargs : %d optindex:%d\n", c, nargs, option_index);
@@ -154,7 +162,6 @@ s_fparams *get_fpocket_args(int nargs, char **args)
case 0:
break;
case M_PAR_WRITE_MODE: /*write mode : d -> default | b -> both pdb and mmcif | p ->pdb | m -> mmcif*/
status++;
if (optarg[0] != 'd' && optarg[0] != 'b' && optarg[0] != 'p' && optarg[0] != 'm' && strcmp(optarg, "both") && strcmp(optarg, "pdb") && strcmp(optarg, "cif") && strcmp(optarg, "mmcif"))
@@ -166,26 +173,20 @@ s_fparams *get_fpocket_args(int nargs, char **args)
{
strcpy(par->write_par, "mmcif");
strcpy(write_mode, par->write_par);
}
else
{
strcpy(par->write_par, optarg);
strcpy(write_mode, par->write_par);
}
}
break;
case M_PAR_CHAIN_AS_LIGAND: /*option with -a "name of the chain" to be specified as a ligand*/
/*select the chains as ligand*/
status++;
strcpy(par->chain_as_ligand, optarg); /*par->chain_as_ligand contains the arg given in cmd line*/
const char *separatorss = ","; /* defining separators*/
const char *separatorss = ","; /* defining separators*/
pt = strtok(par->chain_as_ligand, separatorss);
int nn = 0;
while (pt != NULL)
@@ -195,30 +196,26 @@ s_fparams *get_fpocket_args(int nargs, char **args)
pt = strtok(NULL, separatorss);
}
par->xlig_resnumber = 0;
//printf("lig %s\n",par->chain_as_ligand);
break;
// printf("lig %s\n",par->chain_as_ligand);
break;
case M_PAR_DROP_CHAINS: /*option with -c "name of the chains"*/
/*drop the selected chains from the pdb file*/
strcpy(par->chain_delete, optarg); /*par->custom_ligand contains the arg given in cmd line*/
//printf("%s and %s",par->custom_ligand,optarg);
// printf("%s and %s",par->custom_ligand,optarg);
const char *separators = ",:"; /* defining separators for drop chains args*/
pt = strtok(par->chain_delete, separators);
int n = 0;
while (pt != NULL)
{
strncpy(&(par->chain_delete[n]), pt,1);
strncpy(&(par->chain_delete[n]), pt, 1);
n++;
pt = strtok(NULL, separators);
}
par->chain_is_kept = 0;
//printf("%s\n",par->chain_delete);
// printf("%s\n",par->chain_delete);
status++;
break;
@@ -226,7 +223,7 @@ s_fparams *get_fpocket_args(int nargs, char **args)
/*drop the selected chains from the pdb file*/
strcpy(par->chain_delete, optarg); /*par->custom_ligand contains the arg given in cmd line*/
//printf("%s and %s",par->custom_ligand,optarg);
// printf("%s and %s",par->custom_ligand,optarg);
const char *separator = ",:"; /* defining separators for drop chains args*/
pt = strtok(par->chain_delete, separator);
int nk = 0;
@@ -236,21 +233,21 @@ s_fparams *get_fpocket_args(int nargs, char **args)
nk++;
pt = strtok(NULL, separator);
}
//printf("%s\n",par->chain_delete);
// printf("%s\n",par->chain_delete);
par->chain_is_kept = 1;
status++;
break;
case M_PAR_CUSTOM_LIGAND:
//parse ligand specification that has to be given as
//residuenumber:residuename:chain_code
//for 1uyd for instance 1224:PU8:A
// parse ligand specification that has to be given as
// residuenumber:residuename:chain_code
// for 1uyd for instance 1224:PU8:A
status++;
strcpy(par->custom_ligand, optarg);
//printf("%s and %s",par->custom_ligand,optarg);
// printf("%s and %s",par->custom_ligand,optarg);
pt = strtok(par->custom_ligand, ":");
while (pt != NULL)
@@ -268,6 +265,55 @@ s_fparams *get_fpocket_args(int nargs, char **args)
}
break;
case M_PAR_CUSTOM_POCKET:
// parse pocket specification that has to be given as
// residuenumber1:insertion_code1:chain_code1.residuenumber2:insertion_code2:chain_code2& ....
// for 1uyd for instance 127::A.128::A
status++;
strcpy(par->custom_pocket_arg, optarg);
char *rest = par->custom_pocket_arg;
char *rest2;
/*count residues first*/
while ((pt = strtok_r(rest, ".", &rest)))
par->xpocket_n++;
par->xpocket_chain_code = (char *)my_malloc(par->xpocket_n * sizeof(char));
par->xpocket_insertion_code = (char *)my_malloc(par->xpocket_n * sizeof(char));
par->xpocket_residue_number = (unsigned short *)my_malloc(par->xpocket_n * sizeof(unsigned short));
pti = 0;
strcpy(par->custom_pocket_arg, optarg);
rest = par->custom_pocket_arg;
while ((pt = strtok_r(rest, ".", &rest)))
{
strcpy(&residue_string, pt);
rest2 = residue_string;
apti = 0;
while (apt = strtok_r(rest2, ":", &rest2))
{
switch (apti)
{
case 0:
par->xpocket_residue_number[pti] = (unsigned short)atoi(apt); // fprintf(stdout,"residuenumber: %d\n", atoi(apt));
case 1:
strncpy(&(par->xpocket_insertion_code[pti]), apt, 1);
case 2:
strncpy(&(par->xpocket_chain_code[pti]), apt, 1);
}
apti++;
}
pti++;
}
break;
case M_PAR_MIN_N_EXPLICIT_POCKET:
status++;
par->min_n_explicit_pocket_atoms = (int)atoi(optarg);
break;
case M_PAR_PDB_FILE:
// printf("option -f with value `%s'\n", optarg);
status++;
@@ -301,7 +347,7 @@ s_fparams *get_fpocket_args(int nargs, char **args)
break;
case M_PAR_DISTANCE_MEASURE:
// printf("option -e with value %s\n", optarg);
//strcpy(par->distance_measure,optarg); /*might be problematic*/
// strcpy(par->distance_measure,optarg); /*might be problematic*/
strncpy(&(par->distance_measure), optarg, 1);
status++;
@@ -335,7 +381,7 @@ s_fparams *get_fpocket_args(int nargs, char **args)
status++;
break;
case M_PAR_MODEL_FLAG:
//printf("option -l with value %s", optarg);
// printf("option -l with value %s", optarg);
par->model_number = (int)atoi(optarg);
status++;
break;
@@ -348,39 +394,45 @@ s_fparams *get_fpocket_args(int nargs, char **args)
{
strcpy(par->write_par, "m");
strcpy(write_mode, par->write_par);
//printf("%c", write_mode[0]);
// printf("%c", write_mode[0]);
}
else if (strstr(par->pdb_path, ".pdb") && par->write_par[0] == 'd')
{
strcpy(par->write_par, "p");
strcpy(write_mode, par->write_par);
}
if (par->xpocket_n > 0 && par->xlig_resnumber > -1)
{
fprintf(stderr, "\n\033[1mERROR:\033[0m you specified an explicit ligand (-r) AND an explicit pocke (-P) in the same fpocket run. This is currently not allowed, please use either the one or the other.\n\n");
return NULL;
}
return (par);
/* if(status){
return(par);
}
else {
return(NULL);
}*/
}
/**
## FUNCTION:
## FUNCTION:
get_fpocket_args
## SPECIFICATION:
## 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:
## RETURN:
s_params*: Pointer to parameters
*/
s_fparams *DEPR_get_fpocket_args(int nargs, char **args)
{
@@ -391,7 +443,7 @@ s_fparams *DEPR_get_fpocket_args(int nargs, char **args)
s_fparams *par = init_def_fparams();
char *pdb_lst = NULL;
//read arguments by flags
// read arguments by flags
for (i = 1; i < nargs; i++)
{
if (strlen(args[i]) == 2 && args[i][0] == '-' && i <= (nargs - 1))
@@ -520,19 +572,19 @@ s_fparams *DEPR_get_fpocket_args(int nargs, char **args)
}
/**
## FUNCTION:
## FUNCTION:
parse_clust_max_dist
## SPECIFICATION:
## 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:
## RETURN:
int: 0 if the parameter is valid (here a valid float), 1 if not
*/
int parse_clust_max_dist(char *str, s_fparams *p)
{
@@ -550,19 +602,19 @@ int parse_clust_max_dist(char *str, s_fparams *p)
}
/**
## FUNCTION:
## FUNCTION:
parse_sclust_max_dist
## SPECIFICATION:
## 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:
## RETURN:
int: 0 if the parameter is valid (here a valid float), 1 if not
*/
int parse_clustering_method(char *str, s_fparams *p)
{
@@ -595,20 +647,20 @@ int parse_distance_measure(char *str, s_fparams *p)
}
/**
## FUNCTION:
## FUNCTION:
parse_min_apol_neigh
## SPECIFICATION:
## 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:
## RETURN:
int: 0 if the parameter is valid (here a valid int), 1 if not
*/
int parse_min_apol_neigh(char *str, s_fparams *p)
{
@@ -630,19 +682,19 @@ int parse_min_apol_neigh(char *str, s_fparams *p)
}
/**
## FUNCTION:
## FUNCTION:
parse_asph_min_size
## SPECIFICATION:
## 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:
## RETURN:
int: 0 if the parameter is valid (here a valid float), 1 if not
*/
int parse_asph_min_size(char *str, s_fparams *p)
{
@@ -660,19 +712,19 @@ int parse_asph_min_size(char *str, s_fparams *p)
}
/**
## FUNCTION:
## FUNCTION:
parse_asph_max_size
## SPECIFICATION:
## 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:
## RETURN:
int: 0 if the parameter is valid (here a valid float), 1 if not
*/
int parse_asph_max_size(char *str, s_fparams *p)
{
@@ -690,20 +742,20 @@ int parse_asph_max_size(char *str, s_fparams *p)
}
/**
## FUNCTION:
## FUNCTION:
parse_mc_niter
## SPECIFICATION:
## 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:
## RETURN:
int: 0 if the parameter is valid (here a valid float), 1 if not
*/
int parse_mc_niter(char *str, s_fparams *p)
{
@@ -721,19 +773,19 @@ int parse_mc_niter(char *str, s_fparams *p)
}
/**
## FUNCTION:
## FUNCTION:
parse_basic_vol_div
## SPECIFICATION:
## 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:
## RETURN:
int: 0 if the parameter is valid (here a valid integer), 1 if not
*/
int parse_basic_vol_div(char *str, s_fparams *p)
{
@@ -751,19 +803,19 @@ int parse_basic_vol_div(char *str, s_fparams *p)
}
/**
## FUNCTION:
## FUNCTION:
parse_refine_min_apol
## SPECIFICATION:
## 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:
## RETURN:
int: 0 if the parameter is valid (here a valid integer), 1 if not
*/
int parse_refine_minaap(char *str, s_fparams *p)
{
@@ -781,19 +833,19 @@ int parse_refine_minaap(char *str, s_fparams *p)
}
/**
## FUNCTION:
## FUNCTION:
parse_min_pock_nb_asph
## SPECIFICATION:
## 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:
## RETURN:
int: 0 if the parameter is valid (here a valid integer), 1 if not
*/
int parse_min_pock_nb_asph(char *str, s_fparams *p)
{
@@ -813,17 +865,17 @@ int parse_min_pock_nb_asph(char *str, s_fparams *p)
/**
## 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.
*/
int is_fpocket_opt(const char opt)
@@ -846,18 +898,18 @@ int is_fpocket_opt(const char opt)
}
/**
## FUNCTION:
## FUNCTION:
free_fparams
## SPECIFICATION:
## SPECIFICATION:
Free parameters
## PARAMETRES:
## PARAMETRES:
@ s_params *p: Pointer to the structure to free
## RETURN:
## RETURN:
void
*/
void free_fparams(s_fparams *p)
{
@@ -878,18 +930,18 @@ void free_fparams(s_fparams *p)
}
/**
## FUNCTION:
## FUNCTION:
print_pocket_usage
## SPECIFICATION:
## SPECIFICATION:
Displaying usage of the programm in the given buffer
## PARAMETRES:
@ FILE *f: buffer to print in
## RETURN:
void
*/
void print_pocket_usage(FILE *f)
{
@@ -916,7 +968,15 @@ void print_pocket_usage(FILE *f)
fprintf(f, "\n\n\033[1mOptional input parameters\033[0m\n");
fprintf(f, "\t-%c --%s (int)\t\t\t: Number of Model to analyze.\t\n", M_PAR_MODEL_FLAG, M_PAR_MODEL_FLAG_LONG);
fprintf(f, "\t-%c --%s (string)\t\t: File name of a topology file (Amber prmtop).\t\n", M_PAR_TOPOLOGY, M_PAR_LONG_TOPOLOGY);
fprintf(f, "\t-%c --%s (string)\t\t: String specifying a ligand like: residuenumber:residuename:chain_code (ie. 1224:PU8:A).\t\n", M_PAR_CUSTOM_LIGAND, M_PAR_CUSTOM_LIGAND_LONG);
fprintf(f, "\t-%c --%s (string)\t\t: String specifying a ligand like: \n\
\t\t\t\t\t\t residuenumber:residuename:chain_code (ie. 1224:PU8:A).\t\n",
M_PAR_CUSTOM_LIGAND, M_PAR_CUSTOM_LIGAND_LONG);
fprintf(f, "\t-%c --%s (string)\t\t: String specifying a pocket like: \n\
\t\t\t\t\t\t residuenumber1:insertion_code1('-' if empty):chain_code1.residuenumber2:insertion_code2:chain_code2 (ie. 138:-:A.139:-:A).\t\n",
M_PAR_CUSTOM_POCKET, M_PAR_CUSTOM_POCKET_LONG);
fprintf(f, "\t-%c --%s (int)\t: If explicit pocket provided, minimum number \n\
\t\t\t\t\t\t of atoms of an alpha sphere that have to be in the selected pocket.\t\n",
M_PAR_MIN_N_EXPLICIT_POCKET, M_PAR_MIN_N_EXPLICIT_POCKET_LONG);
fprintf(f, "\t-%c --%s (char)\t\t: Character specifying a chain as a ligand\t\n", M_PAR_CHAIN_AS_LIGAND, M_PAR_CHAIN_AS_LIGAND_LONG);
fprintf(f, "\n\n\033[1mOptional pocket detection parameters\033[0m (default parameters) \n\
@@ -952,7 +1012,7 @@ void print_pocket_usage(FILE *f)
\t\t\t\t\t\t able to keep up to (%d) chains (ie : -k A,B,C,E)\n",
M_PAR_KEEP_CHAINS, M_PAR_KEEP_CHAINS_LONG, M_MAX_CHAINS_DELETE);
fprintf(f, "\t-%c --%s (char)\t\t: consider this chain as a ligand explicitly (i.e. -%c D)\n",
M_PAR_CHAIN_AS_LIGAND, M_PAR_CHAIN_AS_LIGAND_LONG,M_PAR_CHAIN_AS_LIGAND);
M_PAR_CHAIN_AS_LIGAND, M_PAR_CHAIN_AS_LIGAND_LONG, M_PAR_CHAIN_AS_LIGAND);
fprintf(f, "\t-%c --%s (char)\t\t\t: Writing mode to be used after pocket detection, \n\
\t\t\t\t\t\t d -> default (same format outpout as input)\n\
\t\t\t\t\t\t b or both -> both pdb and mmcif | p or pdb ->pdb | m or cif or mmcif-> mmcif\n",
@@ -961,18 +1021,18 @@ void print_pocket_usage(FILE *f)
}
/*write mode : d -> default | b -> both pdb and mmcif | p ->pdb | m -> mmcif*/
/**
## FUNCTION:
## FUNCTION:
print_fparams
## SPECIFICATION:
## SPECIFICATION:
Print function
## PARAMETRES:
@ s_fparams *p : Parameters to print
@ FILE *f : Buffer to write in
## RETURN:
## RETURN:
*/
void print_fparams(s_fparams *p, FILE *f)
{

View File

@@ -30,7 +30,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
## 27-11-08 (v) PDB file check moved here instead of fparams
## 01-04-08 (v) Added comments and creation of history
## 01-01-08 (vp) Created (random date...)
##
##
## TODO or SUGGESTIONS
##
@@ -38,11 +38,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
/**
## FUNCTION:
int main(int argc, char *argv[])
int main(int argc, char *argv[])
## SPECIFICATION:
Main program!
Main program!
*/
int main(int argc, char *argv[])
@@ -50,10 +50,10 @@ int main(int argc, char *argv[])
s_fparams *params = get_fpocket_args(argc, argv);
params->fpocket_running = 1;
/* If parameters parsing is ok */
if (params)
{
params->fpocket_running = 1;
if (!params->db_run)
fprintf(stdout, "***** POCKET HUNTING BEGINS ***** \n");
// print_fparams(params,stdout);
@@ -103,20 +103,20 @@ int main(int argc, char *argv[])
return 0;
}
/**
## FUNCTION:
process_pdb
## SPECIFICATION:
Handle a single pdb: check the pdb name, load data, and launch fpocket if
the pdb file have been successfully read.
## FUNCTION:
process_pdb
## SPECIFICATION:
Handle a single pdb: check the pdb name, load data, and launch fpocket if
the pdb file have been successfully read.
## PARAMETRES:
@ char *pdbname : Name of the pdb
@ s_fparams *params : Parameters of the algorithm. See fparams.c/.h
## RETURN:
void
@ char *pdbname : Name of the pdb
@ s_fparams *params : Parameters of the algorithm. See fparams.c/.h
## RETURN:
void
*/
void process_pdb(char *pdbname, s_fparams *params)
{
@@ -140,15 +140,14 @@ void process_pdb(char *pdbname, s_fparams *params)
if (DEBUG)
print_number_of_objects_in_memory();
s_pdb *pdb = open_file_format(pdbname, NULL, M_DONT_KEEP_LIG, params->model_number, params);
s_pdb *pdb_w_lig = open_file_format(pdbname, NULL, M_KEEP_LIG, params->model_number, params);
s_pdb *pdb_w_lig = open_file_format(pdbname, NULL, M_KEEP_LIG, params->model_number, params);
// s_pdb *pdb = open_mmcif(pdbname, NULL, M_DONT_KEEP_LIG, params->model_number, params);
// s_pdb *pdb_w_lig = open_mmcif(pdbname, NULL, M_KEEP_LIG, params->model_number, params);
// s_pdb *pdb = open_mmcif(pdbname, NULL, M_DONT_KEEP_LIG, params->model_number, params);
// s_pdb *pdb_w_lig = open_mmcif(pdbname, NULL, M_KEEP_LIG, params->model_number, params);
//s_pdb *pdb = rpdb_open(pdbname, NULL, M_DONT_KEEP_LIG, params->model_number, params);
//s_pdb *pdb_w_lig = rpdb_open(pdbname, NULL, M_KEEP_LIG, params->model_number, params);
// s_pdb *pdb = rpdb_open(pdbname, NULL, M_DONT_KEEP_LIG, params->model_number, params);
// s_pdb *pdb_w_lig = rpdb_open(pdbname, NULL, M_KEEP_LIG, params->model_number, params);
if (DEBUG)
print_number_of_objects_in_memory();
@@ -160,15 +159,15 @@ void process_pdb(char *pdbname, s_fparams *params)
if (pdb)
{
/* Actual reading of pdb data and then calculation */
read_file_format(pdb, NULL, M_DONT_KEEP_LIG, params->model_number, params);
read_file_format(pdb_w_lig, NULL, M_KEEP_LIG, params->model_number, params);
//read_mmcif(pdb, NULL, M_DONT_KEEP_LIG, params->model_number, params);
//read_mmcif(pdb_w_lig, NULL, M_KEEP_LIG, params->model_number, params);
// read_mmcif(pdb, NULL, M_DONT_KEEP_LIG, params->model_number, params);
// read_mmcif(pdb_w_lig, NULL, M_KEEP_LIG, params->model_number, params);
//rpdb_read(pdb, NULL, M_DONT_KEEP_LIG, params->model_number, params);
//rpdb_read(pdb_w_lig, NULL, M_KEEP_LIG, params->model_number, params);
// rpdb_read(pdb, NULL, M_DONT_KEEP_LIG, params->model_number, params);
// rpdb_read(pdb_w_lig, NULL, M_KEEP_LIG, params->model_number, params);
// fprintf(stdout,"Init coordinate grid\n");
create_coord_grid(pdb);
@@ -177,7 +176,7 @@ void process_pdb(char *pdbname, s_fparams *params)
/*free_pdb_atoms(pdb);
free_pdb_atoms(pdb_w_lig);
if(DEBUG)print_number_of_objects_in_memory();
return(NULL);*/
c_lst_pockets *pockets = search_pocket(pdb, params, pdb_w_lig);
@@ -230,23 +229,21 @@ void process_pdb(char *pdbname, s_fparams *params)
s_pdb *open_file_format(char *fpath, const char *ligan, const int keep_lig, int model_number, s_fparams *par)
{
s_pdb *pdb;
if (strstr(par->pdb_path, ".cif")) /*strstr finds the substring and here we search for the file extension we want */
pdb = open_mmcif(fpath, NULL, keep_lig, par->model_number, par);
if (strstr(par->pdb_path, ".cif")) /*strstr finds the substring and here we search for the file extension we want */
pdb = open_mmcif(fpath, NULL, keep_lig, par->model_number, par);
else if (strstr(par->pdb_path, ".pdb"))
pdb = rpdb_open(fpath, NULL, keep_lig, par->model_number, par);
return pdb;
}
void read_file_format(s_pdb *pdb, const char *ligan, const int keep_lig, int model_number, s_fparams *par)
{
if (strstr(par->pdb_path, ".cif")){ /*strstr finds the substring and here we search for the file extension we want */
read_mmcif(pdb, NULL, keep_lig, par->model_number, par);
if (strstr(par->pdb_path, ".cif"))
{ /*strstr finds the substring and here we search for the file extension we want */
read_mmcif(pdb, NULL, keep_lig, par->model_number, par);
}
else if (strstr(par->pdb_path, ".pdb"))
rpdb_read(pdb, NULL, keep_lig, par->model_number, par);
}

View File

@@ -1,5 +1,5 @@
#include "../headers/fpocket.h"
#include "../headers/fpocket.h"
/*
* Copyright <2012> <Vincent Le Guilloux,Peter Schmidtke, Pierre Tuffery>
* Copyright <2013-2018> <Peter Schmidtke, Vincent Le Guilloux>
@@ -32,31 +32,31 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
## 28-11-08 (v) Comments UTD
## 01-04-08 (v) Added comments and creation of history
## 01-01-08 (vp) Created (random date...)
##
##
## TODO or SUGGESTIONS
##
*/
/**
## FUNCTION:
## FUNCTION:
pockets search_pocket
## SPECIFICATION:
## SPECIFICATION:
This function will call all functions needed for the pocket finding algorith
and will return the list of pockets found on the protein.
## PARAMETRES:
@ s_pdb *pdb : The pdb data of the protein to handle.
@ s_fparams : Parameters of the algorithm
## RETURN:
A chained list of pockets found, sorted according to the current critera
(the default is a scoring function)
*/
c_lst_pockets* search_pocket(s_pdb *pdb, s_fparams *params, s_pdb *pdb_w_lig) {
c_lst_pockets *search_pocket(s_pdb *pdb, s_fparams *params, s_pdb *pdb_w_lig)
{
clock_t b, e;
time_t bt, et;
@@ -66,21 +66,22 @@ c_lst_pockets* search_pocket(s_pdb *pdb, s_fparams *params, s_pdb *pdb_w_lig) {
s_clusterlib_vertices *clusterlib_vertices = NULL;
Node *cluster_tree = NULL;
/* Calculate and read voronoi vertices comming from qhull */
// fprintf(stdout, "========= fpocket algorithm begins =========\n");
if (DEBUG) {
if (DEBUG)
{
fprintf(stdout, "> Calculating vertices ...\n");
}
bt = clock();
// s_lst_vvertice *lvert = load_vvertices(pdb, params->min_apol_neigh,
// params->asph_min_size,
// params->asph_max_size, 0.0, 0.0, 0.0);
s_lst_vvertice *lvert = load_vvertices(pdb, params->min_apol_neigh,
params->asph_min_size,
params->asph_max_size, 0.0, 0.0, 0.0);
s_lst_vvertice *lvert = load_vvertices(pdb, params, 0.0, 0.0, 0.0);
/*if(lvert->nvert>8000){*/
/* params->asph_max_size=7.6;
@@ -96,112 +97,129 @@ c_lst_pockets* search_pocket(s_pdb *pdb, s_fparams *params, s_pdb *pdb_w_lig) {
params->min_pock_nb_asph=M_MIN_POCK_NB_ASPH;
}*/
if (DEBUG) {
if (DEBUG)
{
fprintf(stdout, "distance measure : %c\n", params->clustering_method);
fprintf(stdout, "%d vertices\n", lvert->nvert);
fprintf(stdout, "needing %.5f s to read the vertices", (double) (clock() - b) / CLOCKS_PER_SEC);
fprintf(stdout, "needing %.5f s to read the vertices", (double)(clock() - b) / CLOCKS_PER_SEC);
}
if (DEBUG) {
if (DEBUG)
{
fprintf(stdout, "Preparing for clustering\n");
}
if (DEBUG) print_number_of_objects_in_memory();
if (params->xlig_resnumber == -1) {
if (DEBUG)
print_number_of_objects_in_memory();
if (params->xlig_resnumber == -1 && params->xpocket_n == 0)
{
clusterlib_vertices = prepare_vertices_for_cluster_lib(lvert, params->clustering_method, params->distance_measure);
if (DEBUG) fprintf(stdout, "Clustering\n");
if (DEBUG)
fprintf(stdout, "Clustering\n");
// fprintf(stdosut,"distance measure : %c\n",clusterlib_vertices->method);
if (DEBUG) print_number_of_objects_in_memory();
if (DEBUG)
print_number_of_objects_in_memory();
cluster_tree = treecluster(lvert->nvert,
3,
clusterlib_vertices->pos,
clusterlib_vertices->mask,
clusterlib_vertices->weight,
clusterlib_vertices->transpose,
clusterlib_vertices->dist,
clusterlib_vertices->method,
NULL);
if (DEBUG) print_number_of_objects_in_memory();
if (cluster_tree == NULL) {
3,
clusterlib_vertices->pos,
clusterlib_vertices->mask,
clusterlib_vertices->weight,
clusterlib_vertices->transpose,
clusterlib_vertices->dist,
clusterlib_vertices->method,
NULL);
if (DEBUG)
print_number_of_objects_in_memory();
if (cluster_tree == NULL)
{
fprintf(stderr, "Error in creating clustering tree, return NULL pointer...breaking up");
return (0);
}
int **clusterIds = cuttree_distance(lvert->nvert, cluster_tree, params->clust_max_dist);
//int i;
if (DEBUG) print_number_of_objects_in_memory();
// int i;
if (DEBUG)
print_number_of_objects_in_memory();
transferClustersToVertices(clusterIds, lvert);
if (DEBUG) fprintf(DEBUG_STREAM, "freeing clusterlib vertices now\n");
if (DEBUG)
fprintf(DEBUG_STREAM, "freeing clusterlib vertices now\n");
free_cluster_lib_vertices(clusterlib_vertices, lvert->nvert);
free_cluster_tree(cluster_tree);
free_cluster_ids(clusterIds, lvert->nvert);
}
if (lvert == NULL) {
if (lvert == NULL)
{
fprintf(stderr, "! Vertice calculation failed!\n");
return NULL;
}
pockets = assign_pockets(lvert);
if (DEBUG) {
if (DEBUG)
{
fprintf(DEBUG_STREAM, "After pocket assignment :\n");
fflush(DEBUG_STREAM);
print_number_of_objects_in_memory();
fprintf(DEBUG_STREAM, "\tpocket : %p :\n\tpocket vertice list : %p\n", pockets, pockets->vertices);
fflush(DEBUG_STREAM);
}
apply_clustering(pockets, params);
if (DEBUG) {
if (DEBUG)
{
fprintf(DEBUG_STREAM, "applied clustering to pockets");
print_number_of_objects_in_memory();
}
if (pockets) {
if (pockets)
{
reIndexPockets(pockets);
// fprintf(stdout, "> Calculating descriptors and score...\n");
if (DEBUG)print_number_of_objects_in_memory();
if (DEBUG)
print_number_of_objects_in_memory();
set_pockets_descriptors(pockets, pdb, params, pdb_w_lig);
if (DEBUG) print_number_of_objects_in_memory();
if (DEBUG)
print_number_of_objects_in_memory();
/* Drop small and too polar binding pockets */
if (DEBUG) {
if (DEBUG)
{
print_number_of_objects_in_memory();
fprintf(DEBUG_STREAM, "drop small and polar clusters\n");
}
dropSmallNpolarPockets(pockets, params);
if (DEBUG) print_number_of_objects_in_memory();
if (DEBUG)
print_number_of_objects_in_memory();
reIndexPockets(pockets);
if (DEBUG) print_number_of_objects_in_memory();
if (DEBUG)
print_number_of_objects_in_memory();
/* Sorting pockets */
if (DEBUG) print_number_of_objects_in_memory();
if (DEBUG)
print_number_of_objects_in_memory();
sort_pockets(pockets, M_SCORE_SORT_FUNCT);
if (DEBUG) print_number_of_objects_in_memory();
if (DEBUG)
print_number_of_objects_in_memory();
//sort_pockets(pockets, M_NASPH_SORT_FUNCT) ;
// sort_pockets(pockets, M_NASPH_SORT_FUNCT) ;
if (DEBUG) print_number_of_objects_in_memory();
if (DEBUG)
print_number_of_objects_in_memory();
reIndexPockets(pockets);
if (DEBUG) print_number_of_objects_in_memory();
if (DEBUG)
print_number_of_objects_in_memory();
// int i;
if (params->fpocket_running && params->flag_do_grid_calculations && params->topology_path) calculate_pocket_energy_grids(pockets, params, pdb);
//params->fpocket_running &&
if (params->fpocket_running && params->flag_do_grid_calculations && params->topology_path)
calculate_pocket_energy_grids(pockets, params, pdb);
// params->fpocket_running &&
}
return pockets;
}

View File

@@ -115,10 +115,10 @@ s_pdb *open_mmcif(char *fpath, const char *ligan, const int keep_lig, int model_
if (par->xlig_resnumber > -1)
{
if ((at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == par->xlig_chain_code[0] && at_in[i].resid_auth == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]))
{
pdb->n_xlig_atoms++;
}
// if ((at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == par->xlig_chain_code[0] && at_in[i].resid_auth == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]))
// {
// pdb->n_xlig_atoms++;
// }
if (is_ligand(par->chain_as_ligand, at_in[i].chain[0]))
{
@@ -126,6 +126,14 @@ s_pdb *open_mmcif(char *fpath, const char *ligan, const int keep_lig, int model_
}
}
}
if (par->xlig_resnumber > -1)
{
if ((at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == par->xlig_chain_code[0] && at_in[i].resid_auth == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]))
{
pdb->n_xlig_atoms++;
}
}
}
else if (at_in[i].modelnumber == model_number && !strncmp(at_in[i].atom_type, "HETATM", 6) || (!strncmp(at_in[i].atom_type, "ATOM", 4) && is_ligand(par->chain_as_ligand, at_in[i].chain[0])))
{
@@ -169,18 +177,19 @@ s_pdb *open_mmcif(char *fpath, const char *ligan, const int keep_lig, int model_
}
}
}
if (par->xlig_resnumber > -1)
{
if ((at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == par->xlig_chain_code[0] && at_in[i].resid_auth == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]))
{
pdb->n_xlig_atoms++;
}
}
if (is_ligand(par->chain_as_ligand, at_in[i].chain[0]))
{
pdb->n_xlig_atoms++;
}
}
if (par->xlig_resnumber > -1)
{
if ((at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == par->xlig_chain_code[0] && at_in[i].resid_auth == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]))
{
pdb->n_xlig_atoms++;
}
}
}
}
@@ -285,17 +294,6 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
if (at_in[i].altloc[0] == ' ' || at_in[i].altloc[0] == 'A' || at_in[i].altloc[0] == '1')
{ /*if within first occurence*/
/* Enter this if when arg in command line is -r */
if (pdb->n_xlig_atoms)
{
if (at_in[i].chain[0] == params->xlig_chain_code[0] && at_in[i].resid == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2])
{
*(pdb->xlig_x + i_explicit_ligand_atom) = ts_in.coords[3 * i];
*(pdb->xlig_y + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 1];
*(pdb->xlig_z + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 2];
i_explicit_ligand_atom++;
}
}
/* Enter this if when arg in command line is -a */
if (is_ligand(params->chain_as_ligand, at_in[i].chain[0]))
@@ -358,6 +356,7 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
strcpy(atom->res_name, at_in[i].resname);
strncpy(atom->chain, at_in[i].chain, 2);
atom->res_id = at_in[i].resid;
// fprintf(stdout, " here : %c\n", at_in[i].insertion[0]);
atom->pdb_insert = at_in[i].insertion[0];
atom->x = ts_in.coords[(3 * i)];
atom->y = ts_in.coords[(3 * i) + 1];
@@ -434,25 +433,24 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
}
}
}
if (pdb->n_xlig_atoms)
{
if (at_in[i].chain[0] == params->xlig_chain_code[0] && at_in[i].resid == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2])
{
*(pdb->xlig_x + i_explicit_ligand_atom) = ts_in.coords[3 * i];
*(pdb->xlig_y + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 1];
*(pdb->xlig_z + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 2];
i_explicit_ligand_atom++;
}
}
}
else if (at_in[i].modelnumber == model_number && !strncmp(at_in[i].atom_type, "HETATM", 6) || (!strncmp(at_in[i].atom_type, "ATOM", 4) && is_ligand(params->chain_as_ligand, at_in[i].chain[0])))
{
if (at_in[i].altloc[0] == ' ' || at_in[i].altloc[0] == 'A' || at_in[i].altloc[0] == '1')
{ /*first occurence*/
if (pdb->n_xlig_atoms)
{
if ((at_in[i].chain[0] == params->xlig_chain_code[0] && at_in[i].resid == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == params->xlig_chain_code[0] && at_in[i].resid_auth == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2]))
{
// if (params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2]) {
*(pdb->xlig_x + i_explicit_ligand_atom) = ts_in.coords[3 * i];
*(pdb->xlig_y + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 1];
*(pdb->xlig_z + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 2];
i_explicit_ligand_atom++;
}
}
if (is_ligand(params->chain_as_ligand, at_in[i].chain[0]))
{
*(pdb->xlig_x + i_explicit_ligand_atom) = ts_in.coords[3 * i];
@@ -617,6 +615,19 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
}
}
}
if (pdb->n_xlig_atoms)
{
if ((at_in[i].chain[0] == params->xlig_chain_code[0] && at_in[i].resid == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == params->xlig_chain_code[0] && at_in[i].resid_auth == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2]))
{
// if (params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2]) {
*(pdb->xlig_x + i_explicit_ligand_atom) = ts_in.coords[3 * i];
*(pdb->xlig_y + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 1];
*(pdb->xlig_z + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 2];
i_explicit_ligand_atom++;
}
}
}
else if (strncmp(at_in[i].atom_type, "CRYST1", 6) == 0)
{

View File

@@ -901,11 +901,11 @@ s_pdb *rpdb_open(char *fpath, const char *ligan, const int keep_lig, int model_n
// if (resb[0] == par->xlig_resname[0] && resb[1] == par->xlig_resname[1] && resb[2] == par->xlig_resname[2]) {
// fprintf(stdout,"%s\t%s\n",buf[16],par->xlig_chain_code);
if (buf[21] == par->xlig_chain_code[0] && resnbuf == par->xlig_resnumber && par->xlig_resname[0] == resb[0] && par->xlig_resname[1] == resb[1] && par->xlig_resname[2] == resb[2])
{
pdb->n_xlig_atoms++;
fprintf(stdout, "%d\n", pdb->n_xlig_atoms);
}
// if (buf[21] == par->xlig_chain_code[0] && resnbuf == par->xlig_resnumber && par->xlig_resname[0] == resb[0] && par->xlig_resname[1] == resb[1] && par->xlig_resname[2] == resb[2])
// {
// pdb->n_xlig_atoms++;
// fprintf(stdout, "%d\n", pdb->n_xlig_atoms);
// }
if (is_ligand(par->chain_as_ligand, buf[21]))
{
@@ -914,7 +914,18 @@ s_pdb *rpdb_open(char *fpath, const char *ligan, const int keep_lig, int model_n
}
}
}
if (x < 9990 && y < 9990 && z < 9990)
{
if (par->xlig_resnumber > -1)
{
if (buf[21] == par->xlig_chain_code[0] && resnbuf == par->xlig_resnumber && par->xlig_resname[0] == resb[0] && par->xlig_resname[1] == resb[1] && par->xlig_resname[2] == resb[2])
{
pdb->n_xlig_atoms++;
}
}
}
}
else if (!strncmp(buf, "HETATM", 6) || (!strncmp(buf, "ATOM ", 5) && is_ligand(par->chain_as_ligand, buf[21])))
{
if (chains_to_delete(par->chain_delete, buf[21], par->chain_is_kept))
@@ -969,25 +980,39 @@ s_pdb *rpdb_open(char *fpath, const char *ligan, const int keep_lig, int model_n
/*handle explicit ligand input here*/
if (par->xlig_resnumber > -1)
{
if (buf[21] == par->xlig_chain_code[0] && resnbuf == par->xlig_resnumber && par->xlig_resname[0] == resb[0] && par->xlig_resname[1] == resb[1] && par->xlig_resname[2] == resb[2])
{
pdb->n_xlig_atoms++;
}
}
// if (par->xlig_resnumber > -1)
// {
// if (buf[21] == par->xlig_chain_code[0] && resnbuf == par->xlig_resnumber && par->xlig_resname[0] == resb[0] && par->xlig_resname[1] == resb[1] && par->xlig_resname[2] == resb[2])
// {
// pdb->n_xlig_atoms++;
// }
// }
if (is_ligand(par->chain_as_ligand, buf[21]))
{
pdb->n_xlig_atoms++;
// fprintf(stdout, "H%d\t", pdb->n_xlig_atoms);
}
}
if (x < 9990 && y < 9990 && z < 9990)
{
rpdb_extract_atm_resname(buf, resb);
resnbuf = rpdb_extract_atm_resumber(buf);
if (par->xlig_resnumber > -1)
{
if (buf[21] == par->xlig_chain_code[0] && resnbuf == par->xlig_resnumber && par->xlig_resname[0] == resb[0] && par->xlig_resname[1] == resb[1] && par->xlig_resname[2] == resb[2])
{
pdb->n_xlig_atoms++;
}
}
}
}
/*
else if (!strncmp(buf, "HEADER", 6))
strncpy(pdb->header, buf, M_PDB_BUF_LEN) ;
*/
*/
else if (model_read == 1 && !strncmp(buf, "ENDMDL", 6))
model_read = 0;
@@ -1023,7 +1048,6 @@ s_pdb *rpdb_open(char *fpath, const char *ligan, const int keep_lig, int model_n
pdb->latm_lig = (s_atm **)my_calloc(natm_lig, sizeof(s_atm *));
else
pdb->latm_lig = NULL;
pdb->natoms = natoms;
pdb->nhetatm = nhetatm;
pdb->natm_lig = natm_lig;
@@ -1128,15 +1152,15 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb
resnbuf = rpdb_extract_atm_resumber(pdb_line);
}
/* Enter this if when arg in command line is -r */
if (pdb->n_xlig_atoms)
{
if (pdb_line[21] == params->xlig_chain_code[0] && resnbuf == params->xlig_resnumber && params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2])
{
// if (pdb->n_xlig_atoms)
// {
// if (pdb_line[21] == params->xlig_chain_code[0] && resnbuf == params->xlig_resnumber && params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2])
// {
rpdb_extract_atom_coordinates(pdb_line, (pdb->xlig_x + i_explicit_ligand_atom), (pdb->xlig_y + i_explicit_ligand_atom), (pdb->xlig_z + i_explicit_ligand_atom));
i_explicit_ligand_atom++;
}
}
// rpdb_extract_atom_coordinates(pdb_line, (pdb->xlig_x + i_explicit_ligand_atom), (pdb->xlig_y + i_explicit_ligand_atom), (pdb->xlig_z + i_explicit_ligand_atom));
// i_explicit_ligand_atom++;
// }
// }
/* Enter this if when arg in command line is -a */
if (is_ligand(params->chain_as_ligand, pdb_line[21]))
@@ -1228,6 +1252,21 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb
}
}
}
if (tmpx < 9990 && tmpy < 9990 && tmpz < 9990)
{
if (pdb->n_xlig_atoms)
{
rpdb_extract_atm_resname(pdb_line, resb);
resnbuf = rpdb_extract_atm_resumber(pdb_line);
if (pdb_line[21] == params->xlig_chain_code[0] && resnbuf == params->xlig_resnumber && params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2])
{
rpdb_extract_atom_coordinates(pdb_line, (pdb->xlig_x + i_explicit_ligand_atom), (pdb->xlig_y + i_explicit_ligand_atom), (pdb->xlig_z + i_explicit_ligand_atom));
i_explicit_ligand_atom++;
}
}
}
}
else if (strncmp(pdb_line, "HETATM", 6) == 0 || (strncmp(pdb_line, "ATOM ", 5) == 0 && is_ligand(params->chain_as_ligand, pdb_line[21])))
{
@@ -1244,17 +1283,17 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb
resnbuf = rpdb_extract_atm_resumber(pdb_line);
}
if (pdb->n_xlig_atoms)
{
if (pdb_line[21] == params->xlig_chain_code[0] && resnbuf == params->xlig_resnumber && params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2])
{
// if (params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2]) {
// if (pdb->n_xlig_atoms)
// {
// if (pdb_line[21] == params->xlig_chain_code[0] && resnbuf == params->xlig_resnumber && params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2])
// {
// // if (params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2]) {
rpdb_extract_atom_coordinates(pdb_line, (pdb->xlig_x + i_explicit_ligand_atom), (pdb->xlig_y + i_explicit_ligand_atom), (pdb->xlig_z + i_explicit_ligand_atom));
// rpdb_extract_atom_coordinates(pdb_line, (pdb->xlig_x + i_explicit_ligand_atom), (pdb->xlig_y + i_explicit_ligand_atom), (pdb->xlig_z + i_explicit_ligand_atom));
i_explicit_ligand_atom++;
}
}
// i_explicit_ligand_atom++;
// }
// }
if (is_ligand(params->chain_as_ligand, pdb_line[21]))
{
@@ -1375,6 +1414,23 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb
}
}
}
if (tmpx < 9990 && tmpy < 9990 && tmpz < 9990)
{
if (pdb->n_xlig_atoms)
{
resnbuf = rpdb_extract_atm_resumber(pdb_line);
rpdb_extract_atm_resname(pdb_line, resb);
if (pdb_line[21] == params->xlig_chain_code[0] && resnbuf == params->xlig_resnumber && params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2])
{
rpdb_extract_atom_coordinates(pdb_line, (pdb->xlig_x + i_explicit_ligand_atom), (pdb->xlig_y + i_explicit_ligand_atom), (pdb->xlig_z + i_explicit_ligand_atom));
i_explicit_ligand_atom++;
}
}
}
}
else if (strncmp(pdb_line, "CRYST1", 6) == 0)
{

View File

@@ -44,115 +44,6 @@ double frand_a_b(double a, double b)
return (rand() / (double)RAND_MAX) * (b - a) + a;
}
/**
## FUNCTION:
s_lst_vvertice
## SPECIFICATION:
Calculate voronoi vertices using an ensemble of atoms, and then load resulting
vertices into a s_lst_vvertice structure. The function call an external
programm qvoronoi, part of qhull programme which can be download at:
http://www.qhull.org/download/
or installed with apt-get install qhull-bin
## PARAMETRES:
@ s_pdb *pdb : PDB informations
@ int min_apol_neigh : Number of apolar neighbor of a vertice to be
considered as apolar
@ float asph_min_size : Minimum size of voronoi vertices to retain
@ float asph_max_size : Maximum size of voronoi vertices to retain
## RETURN:
s_lst_vvertice * :The structure containing the list of vertices.
*/
s_lst_vvertice *load_vvertices_DEPRECATED(s_pdb *pdb, int min_apol_neigh, float asph_min_size, float asph_max_size, float xshift, float yshift, float zshift)
{
int i,
nb_h = 0;
s_atm *ca = NULL;
s_lst_vvertice *lvvert = NULL;
char tmpn1[250] = "";
char tmpn2[250] = "";
const char *env = getenv("TMPDIR");
pid_t pid = getpid();
if (!env)
env = "/tmp/";
sprintf(tmpn1, "%s/qvoro_in_fpocket_%d.dat", env, pid);
sprintf(tmpn2, "%s/qvoro_out_fpocket_%d.dat", env, pid);
srand(time(NULL));
FILE *fvoro = fopen(tmpn1, "w+");
FILE *ftmp = fopen(tmpn2, "w");
if (fvoro != NULL)
{
lvvert = (s_lst_vvertice *)my_malloc(sizeof(s_lst_vvertice));
lvvert->h_tr = NULL;
/* Loop a first time to get out how many heavy atoms are in the file */
for (i = 0; i < pdb->natoms; i++)
{
ca = (pdb->latoms) + i;
if (strcmp(ca->symbol, "H") != 0)
{
lvvert->h_tr = (int *)my_realloc(lvvert->h_tr, sizeof(int) * (i - nb_h + 1));
lvvert->h_tr[i - nb_h] = i;
}
else
nb_h++;
}
lvvert->n_h_tr = i - nb_h;
/* Write the header for qvoronoi */
fprintf(fvoro, "3 rbox D3\n%d\n", lvvert->n_h_tr);
/* Loop a second time for the qvoronoi input coordinates */
for (i = 0; i < pdb->natoms; i++)
{
ca = (pdb->latoms) + i;
if (strcmp(ca->symbol, "H") != 0)
{
fprintf(fvoro, "%.6f %.6f %.6f\n", ca->x + xshift, ca->y + yshift, ca->z + zshift);
}
}
fflush(fvoro);
rewind(fvoro);
// int status = system("qvoronoi p i Pp Fn < voro_tmp.dat > voro.tmp") ;
run_qvoronoi(fvoro, ftmp);
int status = M_VORONOI_SUCCESS;
if (status == M_VORONOI_SUCCESS)
{
fill_vvertices(lvvert, tmpn2, pdb->latoms, pdb->natoms,
min_apol_neigh, asph_min_size, asph_max_size, xshift, yshift, zshift, pdb->avg_bfactor, pdb);
}
else
{
my_free(lvvert);
lvvert = NULL;
fprintf(stderr, "! Voronoi command failed with status %d...\n", status);
}
}
else
{
fprintf(stderr, "! File for Voronoi vertices calculation couldn't be opened...\n");
}
fclose(fvoro);
fclose(ftmp);
remove(tmpn1);
remove(tmpn2);
return lvvert;
}
/**
## FUNCTION:
@@ -175,7 +66,7 @@ s_lst_vvertice *load_vvertices_DEPRECATED(s_pdb *pdb, int min_apol_neigh, float
s_lst_vvertice * :The structure containing the list of vertices.
*/
s_lst_vvertice *load_vvertices(s_pdb *pdb, int min_apol_neigh, float asph_min_size, float asph_max_size, float xshift, float yshift, float zshift)
s_lst_vvertice *load_vvertices(s_pdb *pdb, s_fparams *params, float xshift, float yshift, float zshift)
{
int i, j,
nb_h = 0;
@@ -252,11 +143,11 @@ s_lst_vvertice *load_vvertices(s_pdb *pdb, int min_apol_neigh, float asph_min_si
if (j == 0)
{
fill_vvertices(lvvert, tmpn2, pdb->latoms, pdb->natoms,
min_apol_neigh, asph_min_size, asph_max_size, xshift, yshift, zshift, pdb->avg_bfactor, pdb);
params, xshift, yshift, zshift, pdb->avg_bfactor, pdb);
}
else
{
add_missing_vvertices(lvvert, tmpn2, pdb->latoms, min_apol_neigh, asph_min_size, asph_max_size, xshift, yshift, zshift, pdb->avg_bfactor, pdb);
add_missing_vvertices(lvvert, tmpn2, pdb->latoms, params, xshift, yshift, zshift, pdb->avg_bfactor, pdb);
}
}
// printf("nverts : %d\n", lvvert->nvert);
@@ -476,7 +367,7 @@ int free_cluster_lib_vertices(s_clusterlib_vertices *clusterlib_vertices, int nv
*/
void fill_vvertices(s_lst_vvertice *lvvert, const char fpath[], s_atm *atoms, int natoms,
int min_apol_neigh, float asph_min_size, float asph_max_size,
s_fparams *params,
float xshift, float yshift, float zshift, float avg_bfactor, s_pdb *pdb)
{
FILE *f = NULL; /* File handler for vertices coordinates */
@@ -484,7 +375,9 @@ void fill_vvertices(s_lst_vvertice *lvvert, const char fpath[], s_atm *atoms, in
/*FILE *fvNb = NULL ; File handler for vertices vertice neighbours */
s_vvertice *v = NULL;
int min_apol_neigh = params->min_apol_neigh;
float asph_min_size = params->asph_min_size;
float asph_max_size = params->asph_max_size;
float tmpRadius; /* Temporary Ray of voronoi vertice (ray of alpha sphere) */
float xyz[3] = {0, 0, 0};
@@ -522,7 +415,6 @@ void fill_vvertices(s_lst_vvertice *lvvert, const char fpath[], s_atm *atoms, in
lvvert->tr = (int *)my_malloc(lvvert->nvert * sizeof(int));
for (i = 0; i < lvvert->nvert; i++)
lvvert->tr[i] = -1;
lvvert->vertices = (s_vvertice *)my_calloc(M_BUFSIZE, sizeof(s_vvertice));
lvvert->pvertices = (s_vvertice **)my_calloc(M_BUFSIZE, sizeof(s_vvertice *));
@@ -557,8 +449,7 @@ void fill_vvertices(s_lst_vvertice *lvvert, const char fpath[], s_atm *atoms, in
/* Test voro. vert. for alpha sphere cond. and returns radius if
* cond. are ok, -1 else */
tmpRadius = testVvertice(xyz, curNbIdx, atoms, asph_min_size,
asph_max_size, lvvert, xshift, yshift, zshift, avg_bfactor, pdb);
tmpRadius = testVvertice(xyz, curNbIdx, atoms, params, lvvert, xshift, yshift, zshift, avg_bfactor, pdb);
// fprintf(stdout, "%f\n", tmpRadius);
if (tmpRadius > 0)
{
@@ -652,7 +543,7 @@ void fill_vvertices(s_lst_vvertice *lvvert, const char fpath[], s_atm *atoms, in
*/
void add_missing_vvertices(s_lst_vvertice *lvvert, const char fpath[], s_atm *atoms,
int min_apol_neigh, float asph_min_size, float asph_max_size,
s_fparams *params,
float xshift, float yshift, float zshift, float avg_bfactor, s_pdb *pdb)
{
FILE *f = NULL; /* File handler for vertices coordinates */
@@ -742,8 +633,7 @@ void add_missing_vvertices(s_lst_vvertice *lvvert, const char fpath[], s_atm *at
/* Test voro. vert. for alpha sphere cond. and returns radius if
* cond. are ok, -1 else */
tmpRadius = testVvertice(xyz, curNbIdx, atoms, asph_min_size,
asph_max_size, lvvert, xshift, yshift, zshift, avg_bfactor, pdb);
tmpRadius = testVvertice(xyz, curNbIdx, atoms, params, lvvert, xshift, yshift, zshift, avg_bfactor, pdb);
if (tmpRadius > 0)
{
tmpv->x = xyz[0] - xshift;
@@ -777,7 +667,7 @@ void add_missing_vvertices(s_lst_vvertice *lvvert, const char fpath[], s_atm *at
// vInMem++ ; /* Vertices actually read
// v->id = natoms + i + 1 - vInMem ;
if (tmpApolar >= min_apol_neigh)
if (tmpApolar >= params->min_apol_neigh)
tmpv->type = M_APOLAR_AS;
else
tmpv->type = M_POLAR_AS;
@@ -1025,6 +915,38 @@ void set_barycenter(s_vvertice *v)
v->bary[2] = zsum * 0.25;
}
/**
* ## FUNCTION:
atom_in_explicit_pocket
## SPECIFICATION:
When specifying an explicit pocket, check if current atom is part of this explicit pocket
## PARAMETERS:
@ s_atm *cura : The current atom
@ s_fparams : All fpocket parameters
## RETURN:
short unsigned int : 0 if not part of the explicit pocket, 1 if it is part of the explicit pocket
*/
float atom_in_explicit_pocket(s_atm *cura, s_fparams *params)
{
int current_residue_index;
for (current_residue_index = 0; current_residue_index < params->xpocket_n; current_residue_index++)
{
if (params->xpocket_residue_number[current_residue_index] == cura->res_id &&
params->xpocket_chain_code[current_residue_index] == cura->chain[0] &&
((params->xpocket_insertion_code[current_residue_index] == cura->pdb_insert) || ((params->xpocket_insertion_code[current_residue_index] == '-' && cura->pdb_insert == ' ') || (params->xpocket_insertion_code[current_residue_index] == '-' && cura->pdb_insert == '\0'))))
{
return 1;
}
}
return 0;
}
/**
## FUNCTION:
testVvertice
@@ -1045,17 +967,37 @@ void set_barycenter(s_vvertice *v)
*/
float testVvertice(float xyz[3], int curNbIdx[4], s_atm *atoms,
float min_asph_size, float max_asph_size,
s_fparams *params,
s_lst_vvertice *lvvert,
float xshift, float yshift, float zshift, float avg_bfactor, s_pdb *pdb)
{
float min_asph_size = params->asph_min_size;
float max_asph_size = params->asph_max_size;
float x = xyz[0] - xshift,
y = xyz[1] - yshift,
z = xyz[2] - zshift;
float baryx = 0.0, baryy = 0.0, baryz = 0.0;
float barybf = 0.0; /*temporary b factor for all atoms contacting the sphere*/
// if(curNbIdx[0]!=lvvert->h_tr[curNbIdx[0]]) printf("%d vs %d : %s vs %s\n",curNbIdx[0],lvvert->h_tr[curNbIdx[0]],atoms[curNbIdx[0]].symbol,atoms[lvvert->h_tr[curNbIdx[0]]].symbol);
s_atm *cura = &(atoms[lvvert->h_tr[curNbIdx[0]]]);
s_atm *cura;
short unsigned int cur_atom_index = 0;
int n_explicit_atoms_ok = 0;
if (params->xpocket_n > 0)
{
for (cur_atom_index = 0; cur_atom_index < 4; cur_atom_index++)
{
cura = &(atoms[lvvert->h_tr[curNbIdx[cur_atom_index]]]);
if (atom_in_explicit_pocket(cura, params))
n_explicit_atoms_ok++;
}
if (n_explicit_atoms_ok < params->min_n_explicit_pocket_atoms)
return -3.0;
}
cura = &(atoms[lvvert->h_tr[curNbIdx[0]]]);
baryx += cura->x;
baryy += cura->y;
baryz += cura->z;

View File

@@ -607,7 +607,7 @@ void write_pocket_pdb(const char out[], s_pocket *pocket) {
fprintf(f, "HEADER 7 - Polarity Score : %5d\n", pocket->pdesc->polarity_score);
fprintf(f, "HEADER 8 - Amino Acid based volume Score : %.4f\n", pocket->pdesc->volume_score);
fprintf(f, "HEADER 9 - Pocket volume (Monte Carlo) : %.4f\n", pocket->pdesc->volume);
fprintf(f, "HEADER 10 -Pocket volume (convex hull) : %.4f\n", pocket->pdesc->convex_hull_volume);
fprintf(f, "HEADER 10 - Pocket volume (convex hull) : %.4f\n", pocket->pdesc->convex_hull_volume);
fprintf(f, "HEADER 11 - Charge Score : %5d\n", pocket->pdesc->charge_score);
fprintf(f, "HEADER 12 - Local hydrophobic density Score : %.4f\n", pocket->pdesc->mean_loc_hyd_dens);
fprintf(f, "HEADER 13 - Number of apolar alpha sphere : %5d\n", pocket->nAlphaApol);