Commit e1f8bd83 by Chloe Dequeker

Adding parameters : --force or -f will allow the user to choose weither or not…

Adding parameters : --force or -f will allow the user to choose weither or not clashes should be taken into account. Conformations with too many clashes will be skipped
parent b761cbe1
......@@ -95,7 +95,7 @@ void getCandidatesForP1(struct pdb_values* pdb2, struct residue** t_candid1, str
}
}
void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL){
void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL, int confID){
/* This function will output the docking interface between pdbR and pdbL
* To compute the docking interface, we considered that any residue of P1 at or closer than 10A
* of a residue of P2 will represent a contact
......@@ -122,6 +122,10 @@ void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL){
struct residue** t_candidateR = NULL;
int nbCandR = pdbR->nbRes, nbCandL = pdbL->nbRes;
/** Here we reset the number of clashes as this is a new interface computation **/
clash = 0;
t_candidateL = malloc((2*pdbL->nbRes)*sizeof(struct residue*));
if(t_candidateL == NULL){
perror("malloc");
......@@ -192,7 +196,7 @@ void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL){
/* For each candidate residue of the ligand */
for(k=0;k<nbCandL;k++){
/* If both the residues we are looking at are already selected */
if(t_candidateL[k]->isCandidate && t_candidateR[i]->isCandidate){
if(force && t_candidateL[k]->isCandidate && t_candidateR[i]->isCandidate){
continue;
}
for(l=0;l<t_candidateL[k]->nbAtom;l++){
......@@ -201,20 +205,46 @@ void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL){
z2 = t_candidateL[k]->z[l];
dist = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) + (z1-z2)*(z1-z2));
if(dist < DIST_FOR_CLASH){
clash++;
if(clash >= TOO_MUCH_CLASHES){
break;
}
continue;
}
if(dist <= DIST_FOR_CONTACT){
t_candidateR[i]->isCandidate = 1;
t_candidateL[k]->isCandidate = 1;
break;
}
}
if(clash >= TOO_MUCH_CLASHES){
break;
}
}
if(clash >= TOO_MUCH_CLASHES){
break;
}
}
if(clash >= TOO_MUCH_CLASHES){
break;
}
}
printf("number of clashes : %d \n",clash);
/* If the amount of clashes is still ok */
if(clash < TOO_MUCH_CLASHES){
/* Output the ligand's interface */
fprintf(outputFile_lig,"%d ",confID);
write_candidate(t_candidateL,nbCandL,outputFile_lig);
fprintf(outputFile_lig,"\n");
/* Output the ligand's interface */
write_candidate(t_candidateL,nbCandL,outputFile_lig);
/* Output the receptor's interface */
write_candidate(t_candidateR,nbCandR,outputFile_rec);
/* Output the receptor's interface */
fprintf(outputFile_rec,"%d ",confID);
write_candidate(t_candidateR,nbCandR,outputFile_rec);
fprintf(outputFile_rec,"\n");
}
free(t_candidateL);
free(t_candidateR);
......@@ -252,11 +282,7 @@ int main(int argc, char** argv){
if(complexPDB){ /* If we are building for a given complex, no rotation */
/* Write the number of the conformation and get the interface */
fprintf(outputFile_lig,"%d ",i);
fprintf(outputFile_rec,"%d ",i);
getInterface(pdbR,pdbL);
fprintf(outputFile_lig,"\n");
fprintf(outputFile_rec,"\n");
getInterface(pdbR,pdbL,0);
if(constructPDB){
writePDB(newPDB, ligand,target_conf);
......@@ -274,11 +300,7 @@ int main(int argc, char** argv){
/* Write the number of the conformation and get the interface */
if(!doNotOutputINT){
fprintf(outputFile_lig,"%d ",i);
fprintf(outputFile_rec,"%d ",i);
getInterface(pdbR,newPDB);
fprintf(outputFile_lig,"\n");
fprintf(outputFile_rec,"\n");
getInterface(pdbR,newPDB,target_conf);
}
if(constructPDB){
......@@ -312,11 +334,7 @@ int main(int argc, char** argv){
/* Write the number of the conformation and get the interface */
if(!doNotOutputINT){
fprintf(outputFile_lig,"%d ",i);
fprintf(outputFile_rec,"%d ",i);
getInterface(pdbR,newPDB);
fprintf(outputFile_lig,"\n");
fprintf(outputFile_rec,"\n");
getInterface(pdbR,newPDB,i);
}
if(constructPDB){
......
......@@ -4,7 +4,7 @@
#define INTB_HEADER
void getCandidatesForP1(struct pdb_values* pdb2, struct residue** t_candid1, struct residue** t_candid2, int* nbCand1, int* nbCand2);
void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL);
void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL, int confID);
void removeSpace(char* string);
int main(int argc, char** argv);
......
......@@ -61,10 +61,15 @@ struct docking_results* getDataForComplex(){
if(feof(condFile_stream)){
break;
}
/* printf("curConf : %d\n",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 = getline(&buf,&len,condFile_stream); /* Get rid of the rest of the line */
if(idConf == 137)
printf("\n%f %f %f %f %f %f\n",dock_res->distCenters[idConf],dock_res->theta[idConf],dock_res->phi[idConf],dock_res->alpha[idConf],dock_res->beta[idConf],dock_res->gamma[idConf]);
/* theta and phi angles are written in Radian already
* However that is not the case for alpha, beta and gamma angles
*/
......
......@@ -30,6 +30,8 @@ void print_usage() {
"<-HCMD2> Means that the docking file is in the HCMD2 MAXDo format\n"
"<-noOutput> Will prevent the program to output the docking interface\n"
" Useful if you only want to use the '-outputPDB' option\n"
"<--force/-f> Will force the computation of the pause even in case of\n"
" huge number of clashes (threshold defined in struct.h)\n"
);
}
......@@ -51,6 +53,8 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
HCMD2 = 0;
complexPDB = 0;
doNotOutputINT = 0;
clash = 0;
force = 0;
outputDir = NULL;
outputPDB = NULL;
verbose_file = NULL;
......@@ -120,6 +124,9 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
}else if(strcmp(argv[i],"-h") == 0 ||
strcmp(argv[i],"--help") == 0){
print_help = 1;
}else if(strcmp(argv[i],"-f") == 0 ||
strcmp(argv[i],"--force") == 0){
force = 1;
}else if(strcmp(argv[i],"-v") == 0 ||
strcmp(argv[i],"--verbose") == 0){
verbose = 1;
......
......@@ -11,8 +11,12 @@
#define COEF_DEGREE_TO_RADIAN 0.017453293 /* Coefficient to convert degrees to radians */
#define NB_MAX_ATOM_PER_RES 100 /* No residue has more atoms than that */
#define TOO_MUCH_CLASHES 20 /* If not forcing, program will skip conformation after
* this number of clashes */
#define DIST_FOR_CONTACT 6 /* Distance under which we consider
* two residues are in contact */
#define DIST_FOR_CLASH 2 /* Distance in Angstrom under which we consider
* the contact is a clash */
/* 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"
......@@ -23,6 +27,8 @@ int target_conf; /* 1 if we are specific to one conformation */
int HCMD2; /* 1 if this is HCMD2 format */
int complexPDB; /* 1 if we are computing the interface of a given complex */
int doNotOutputINT; /* 1 if we don't want to output the interface */
int clash; /* Maybe be incremented in case of clashes */
int force; /* Will output even if clash, may increase computation time */
FILE* verbose_file; /* If verbose mode, the output file */
char* pdbDir; /* Directory containing the PDBs */
char* receptor; /* Name of the receptor */
......
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