Commit b0265d4c by Chloe Dequeker

bugfix : sometimes the same conformation is written twice ! That caused the…

bugfix : sometimes the same conformation is written twice ! That caused the reading of the file to stop there
parent dd294e42
...@@ -267,7 +267,6 @@ int main(int argc, char** argv){ ...@@ -267,7 +267,6 @@ int main(int argc, char** argv){
dbeta = dock_res->beta[target_conf] - beta; dbeta = dock_res->beta[target_conf] - beta;
dgamma = dock_res->gamma[target_conf] - gamma; dgamma = dock_res->gamma[target_conf] - gamma;
printf("dist : %f\n",dock_res->distCenters[target_conf]);
newPDB = rotate_sophie(pdbL,pdbR,NULL,dock_res->distCenters[target_conf], newPDB = rotate_sophie(pdbL,pdbR,NULL,dock_res->distCenters[target_conf],
dock_res->theta[target_conf],dock_res->phi[target_conf], dock_res->theta[target_conf],dock_res->phi[target_conf],
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
struct docking_results* getDataForComplex(){ struct docking_results* getDataForComplex(){
char* buf = NULL; char* buf = NULL;
FILE* condFile_stream = NULL; FILE* condFile_stream = NULL;
int numberOfConf = 0, rc; int numberOfConf = 0, rc = 0;
int idConf = 0, buf4, prevID = -1; int idConf = 0, buf4 = 0;
float buf3 = 0; float buf3 = 0;
size_t len = 2000; size_t len = 2000;
struct docking_results* dock_res = NULL; struct docking_results* dock_res = NULL;
...@@ -40,7 +40,6 @@ struct docking_results* getDataForComplex(){ ...@@ -40,7 +40,6 @@ struct docking_results* getDataForComplex(){
* allocate a structure large enough * allocate a structure large enough
*/ */
dock_res = allocate_dockingResults(numberOfConf); dock_res = allocate_dockingResults(numberOfConf);
printf("nConf : %d\n",numberOfConf);
while(!feof(condFile_stream)){ while(!feof(condFile_stream)){
...@@ -59,10 +58,8 @@ struct docking_results* getDataForComplex(){ ...@@ -59,10 +58,8 @@ struct docking_results* getDataForComplex(){
dock_res->t_conf[idConf] = 1; dock_res->t_conf[idConf] = 1;
/* This happens when we arrive on the last line */ /* This happens when we arrive on the last line */
if(prevID == idConf){ if(feof(condFile_stream)){
break; break;
}else{
prevID = idConf;
} }
rc = fscanf(condFile_stream,"%f %f %f %f %f %f",&dock_res->distCenters[idConf],&dock_res->theta[idConf],&dock_res->phi[idConf],&dock_res->alpha[idConf],&dock_res->beta[idConf],&dock_res->gamma[idConf]); rc = fscanf(condFile_stream,"%f %f %f %f %f %f",&dock_res->distCenters[idConf],&dock_res->theta[idConf],&dock_res->phi[idConf],&dock_res->alpha[idConf],&dock_res->beta[idConf],&dock_res->gamma[idConf]);
......
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