Commit 42ced6b9 by Chloe Dequeker

some advancements

parent fdc0b3c8
......@@ -15,9 +15,15 @@ void freePDB(struct pdb_values* pdb){
void freeDock(struct docking_results* dock_res){
/* Free the docking interface */
free(dock_res->listEner);
free(dock_res->distCenters);
free(dock_res->theta);
free(dock_res->phi);
if(HEX){
free(dock_res->trans_X);
free(dock_res->trans_Y);
free(dock_res->trans_Z);
}else{
free(dock_res->distCenters);
free(dock_res->theta);
free(dock_res->phi);
}
free(dock_res->alpha);
free(dock_res->beta);
free(dock_res->gamma);
......@@ -114,21 +120,6 @@ struct docking_results* allocate_dockingResults(int nbConf){
exit(EXIT_FAILURE);
}
}
dock_res->distCenters = malloc((2*nbConf)*sizeof(float));
if(dock_res->distCenters == NULL){
perror("malloc");
exit(EXIT_FAILURE);
}
dock_res->theta = malloc((2*nbConf)*sizeof(float));
if(dock_res->theta == NULL){
perror("malloc");
exit(EXIT_FAILURE);
}
dock_res->phi = malloc((2*nbConf)*sizeof(float));
if(dock_res->phi == NULL){
perror("malloc");
exit(EXIT_FAILURE);
}
for(i=0;i<nbConf;i++){
dock_res->listEner[i] = 0;
......@@ -138,9 +129,9 @@ struct docking_results* allocate_dockingResults(int nbConf){
dock_res->gamma[i] = 0;
dock_res->t_conf[i] = 0;
if(HEX){
dock_res->trans_X = 0;
dock_res->trans_Y = 0;
dock_res->trans_Z = 0;
dock_res->trans_X[i] = 0;
dock_res->trans_Y[i] = 0;
dock_res->trans_Z[i] = 0;
}else{
dock_res->distCenters[i] = 0;
dock_res->theta[i] = 0;
......
......@@ -50,6 +50,7 @@ struct docking_results* getDataForComplex(){
}else if(HEX){
for(i=0;i<NB_HEADER_LINE_HEX;i++){
getline(&buf,&len,condFile_stream);
printf("%s\n",buf);
}
}
......@@ -64,7 +65,7 @@ struct docking_results* getDataForComplex(){
if(MAXDo){ /* First MAXDo format */
rc = fscanf(condFile_stream,"%d %d",&idConf,&buf4);
}else if(HEX){
rc = fscanf(condFile_stream,"%d %d",&buf4,&idConf);
rc = fscanf(condFile_stream,"%d %d %f %f",&buf4,&idConf,&buf3,&buf3);
}else{
/* Else, that means that we have a format where
* values for distance between center follows directly
......@@ -89,7 +90,7 @@ struct docking_results* getDataForComplex(){
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]);
}
// TODO : Is this necessary for HEX ?
rc = getline(&buf,&len,condFile_stream); /* Get rid of the rest of the line */
/* rc = getline(&buf,&len,condFile_stream); /1* Get rid of the rest of the line *1/ */
/* theta and phi angles are written in Radian already
* However that is not the case for alpha, beta and gamma angles
......
......@@ -54,6 +54,7 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
target_conf = -1;
HCMD2 = 0;
MAXDo = 0;
HEX = 0;
complexPDB = 0;
doNotOutputINT = 0;
clash = 0;
......
......@@ -17,7 +17,7 @@
* two residues are in contact */
#define DIST_FOR_CLASH 2 /* Distance in Angstrom under which we consider
* the contact is a clash */
#define NB_HEADER_LINE_HEX 5 /* Number of header lines at the top of a hex docking file */
#define NB_HEADER_LINE_HEX 12 /* Number of header lines at the top of a hex docking file */
/* This is the format of a line in a PDB file */
#define FORMAT_LINE_PDB "ATOM %5d %3s %3s %c%5s %8.3f%8.3f%8.3f\n"
......
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