Commit 200ae057 by Chloe Dequeker

bugfix : checking if conformation really exists

parent 2afdb9b4
......@@ -286,6 +286,11 @@ int main(int argc, char** argv){
}else{ /* For all conformations */
for(i=1;i<dock_res->nbConf;i++){
if(dock_res->t_conf[i] == 0){
/* No conformation was found for this index */
continue;
}
/* compute the rotation angles dalpha, dbeta and dgamma
* from the angles alpha and beta of the CA 1 and the
* angle gamma computed after rotation of alpha and beta
......
......@@ -21,6 +21,7 @@ void freeDock(struct docking_results* dock_res){
free(dock_res->alpha);
free(dock_res->beta);
free(dock_res->gamma);
free(dock_res->t_conf);
free(dock_res);
dock_res = NULL;
}
......@@ -45,6 +46,7 @@ struct docking_results* allocate_dockingResults(int nbConf){
dock_res->alpha = NULL;
dock_res->beta = NULL;
dock_res->gamma = NULL;
dock_res->t_conf = NULL;
dock_res->listEner = malloc((2*nbConf)*sizeof(float));
if(dock_res->listEner == NULL){
......@@ -82,6 +84,12 @@ struct docking_results* allocate_dockingResults(int nbConf){
exit(EXIT_FAILURE);
}
dock_res->t_conf = malloc((2*nbConf)*sizeof(int));
if(dock_res->t_conf == NULL){
perror("malloc");
exit(EXIT_FAILURE);
}
for(i=0;i<nbConf;i++){
dock_res->listEner[i] = 0;
dock_res->distCenters[i] = 0;
......@@ -90,6 +98,7 @@ struct docking_results* allocate_dockingResults(int nbConf){
dock_res->alpha[i] = 0;
dock_res->beta[i] = 0;
dock_res->gamma[i] = 0;
dock_res->t_conf[i] = 0;
}
......
......@@ -54,6 +54,9 @@ struct docking_results* getDataForComplex(){
rc = fscanf(condFile_stream,"%d %d",&idConf,&buf4);
}
/* We confirm that this conformation exists in the MAXDo file */
dock_res->t_conf[idConf] = 1;
/* This happens when we arrive on the last line */
if(prevID == idConf){
break;
......
......@@ -69,10 +69,11 @@ struct docking_results {
float* distCenters; /* Distance between the center of the receptor and of the ligand */
float* theta; /* theta angle for the center of the ligand */
float* phi; /* phi angle for the center of the ligand */
float* alpha; /* */
float* beta;
float* gamma;
int nbConf;
float* alpha; /* alpha angle */
float* beta; /* beta angle */
float* gamma; /* Gamma angle */
int* t_conf; /* 1 for a conformation position if it exists, 0 otherwise */
int nbConf; /* Number of conformations */
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment