Commit f0aba0b6 by Chloe Dequeker

Adding the atom resolution for detecting interfaces

parent a08d3a16
...@@ -183,7 +183,7 @@ void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL, int confID){ ...@@ -183,7 +183,7 @@ void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL, int confID){
/* Don't worry for that, this is only O(n^2) over the remaining /* Don't worry for that, this is only O(n^2) over the remaining
* candidate residues for each protein * candidate residues for each protein
* for each receptor resdiue candidate, we look at each of its atoms * for each receptor resdiue candidate, we look at each of its atoms
* for each ligand residue candidate, we llok at each of its atoms * for each ligand residue candidate, we look at each of its atoms
*/ */
/* For each candidate residue of the receptor */ /* For each candidate residue of the receptor */
...@@ -216,6 +216,11 @@ void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL, int confID){ ...@@ -216,6 +216,11 @@ void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL, int confID){
if(dist <= DIST_FOR_CONTACT){ if(dist <= DIST_FOR_CONTACT){
t_candidateR[i]->isCandidate = 1; t_candidateR[i]->isCandidate = 1;
t_candidateL[k]->isCandidate = 1; t_candidateL[k]->isCandidate = 1;
/* We keep the values updated for atoms in any case */
t_candidateR[i]->isAtomCandidate[j] = 1;
t_candidateL[k]->isAtomCandidate[l] = 1;
break; break;
} }
} }
...@@ -232,7 +237,6 @@ void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL, int confID){ ...@@ -232,7 +237,6 @@ void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL, int confID){
} }
} }
printf("number of clashes : %d \n",clash);
/* If the amount of clashes is still ok */ /* If the amount of clashes is still ok */
if(clash < TOO_MUCH_CLASHES){ if(clash < TOO_MUCH_CLASHES){
......
...@@ -275,21 +275,52 @@ void write_candidate(struct residue** t_candid, int sizeCand, FILE* output_strea ...@@ -275,21 +275,52 @@ void write_candidate(struct residue** t_candid, int sizeCand, FILE* output_strea
/* Output the residues selected as being part of the interface in the array /* Output the residues selected as being part of the interface in the array
* t_candid * t_candid
*/ */
int i = 0, j = 0, k= 0, len = 0; int i = 0, j = 0, k= 0, l = 0, len = 0;
char buf[15]; char buf[15] = "", buf2[15] = "";
for(i=0;i<sizeCand;i++){ if(atom_res){
if(t_candid[i]->isCandidate){ for(i=0;i<sizeCand;i++){
len = strlen(t_candid[i]->idRes); for(j=0;j<t_candid[i]->nbAtom;j++){
k = 0; if(t_candid[i]->isAtomCandidate[j]){
for(j=0;j<len;j++){
if(t_candid[i]->idRes[j] != ' '){ /* Getting the residue name */
buf[k] = t_candid[i]->idRes[j]; len = strlen(t_candid[i]->idRes);
k++; k = 0;
} } for(l=0;l<len;l++){
buf[k] = '\0'; if(t_candid[i]->idRes[l] != ' '){
fprintf(output_stream,"'%s' '%c' ",buf,t_candid[i]->chain); buf[k] = t_candid[i]->idRes[l];
fflush(output_stream); k++;
}
}
/* Now, getting the atom name */
len = strlen(t_candid[i]->atomType[j]);
k = 0;
for(l=0;l<len;l++){
if(t_candid[i]->atomType[j][l] != ' '){
buf2[k] = t_candid[i]->atomType[j][l];
k++;
} }
buf2[k] = '\0';
fprintf(output_stream,"'%s' '%c' '%s' ",buf,t_candid[i]->chain, buf2);
fflush(output_stream);
}
}
}
}else{
for(i=0;i<sizeCand;i++){
if(t_candid[i]->isCandidate){
len = strlen(t_candid[i]->idRes);
k = 0;
for(j=0;j<len;j++){
if(t_candid[i]->idRes[j] != ' '){
buf[k] = t_candid[i]->idRes[j];
k++;
} }
buf[k] = '\0';
fprintf(output_stream,"'%s' '%c' ",buf,t_candid[i]->chain);
fflush(output_stream);
}
} }
} }
} }
......
...@@ -22,15 +22,16 @@ void print_usage() { ...@@ -22,15 +22,16 @@ void print_usage() {
"<-lig> name of the ligand\n" "<-lig> name of the ligand\n"
"OPTIONAL\n" "OPTIONAL\n"
"=========\n\n" "=========\n\n"
"<-outputPDB> Output directory for the constructed PDB (ligand)\n" "<-outputPDB>.......Output directory for the constructed PDB (ligand)\n"
" If nothing is specified, there will be no PDB output\n" " If nothing is specified, there will be no PDB output\n"
"<-o> Output directory for the docking interface\n" "<-o>...............Output directory for the docking interface\n"
" If nothing is specified, the current directory is used\n" " If nothing is specified, the current directory is used\n"
"<-pose> Desired conformation. Default will compute all conformations\n" "<-pose>............Desired conformation. Default will compute all conformations\n"
"<-HCMD2> Means that the docking file is in the HCMD2 MAXDo format\n" "<--atom-res>.......If specified, will computed the interface at atom level\n"
"<-noOutput> Will prevent the program to output the docking interface\n" "<-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" " 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" "<--force/-f>.......Will force the computation of the pause even in case of\n"
" huge number of clashes (threshold defined in struct.h)\n" " huge number of clashes (threshold defined in struct.h)\n"
); );
} }
...@@ -55,6 +56,7 @@ struct argLine* parseLineOfArgument(int argc, char** argv){ ...@@ -55,6 +56,7 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
doNotOutputINT = 0; doNotOutputINT = 0;
clash = 0; clash = 0;
force = 0; force = 0;
atom_res = 0;
outputDir = NULL; outputDir = NULL;
outputPDB = NULL; outputPDB = NULL;
verbose_file = NULL; verbose_file = NULL;
...@@ -117,6 +119,8 @@ struct argLine* parseLineOfArgument(int argc, char** argv){ ...@@ -117,6 +119,8 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
} }
}else if(strcmp(argv[i],"-HCMD2") == 0){ }else if(strcmp(argv[i],"-HCMD2") == 0){
HCMD2 = 1; HCMD2 = 1;
}else if(strcmp(argv[i],"--atom-res") == 0){
atom_res = 1;
}else if(strcmp(argv[i],"-noOutput") == 0){ }else if(strcmp(argv[i],"-noOutput") == 0){
doNotOutputINT = 1; doNotOutputINT = 1;
}else if(strcmp(argv[i],"-complex") == 0){ }else if(strcmp(argv[i],"-complex") == 0){
......
...@@ -27,6 +27,7 @@ int target_conf; /* 1 if we are specific to one conformation */ ...@@ -27,6 +27,7 @@ int target_conf; /* 1 if we are specific to one conformation */
int HCMD2; /* 1 if this is HCMD2 format */ int HCMD2; /* 1 if this is HCMD2 format */
int complexPDB; /* 1 if we are computing the interface of a given complex */ 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 doNotOutputINT; /* 1 if we don't want to output the interface */
int atom_res; /* 1 if we want a resolution at atom's level */
int clash; /* Maybe be incremented in case of clashes */ int clash; /* Maybe be incremented in case of clashes */
int force; /* Will output even if clash, may increase computation time */ int force; /* Will output even if clash, may increase computation time */
FILE* verbose_file; /* If verbose mode, the output file */ FILE* verbose_file; /* If verbose mode, the output file */
...@@ -58,16 +59,17 @@ struct pdb_values { ...@@ -58,16 +59,17 @@ struct pdb_values {
/* Structure that contains all the informations we need for a residue */ /* Structure that contains all the informations we need for a residue */
struct residue { struct residue {
char idRes[10]; /* ID of the residue */ char idRes[10]; /* ID of the residue */
char chain; /* Chain to which the residue belongs */ char chain; /* Chain to which the residue belongs */
char resName[10]; /* Name of the residue */ char resName[10]; /* Name of the residue */
float x[NB_MAX_ATOM_PER_RES]; /* Array containing the x for each of its atom */ float x[NB_MAX_ATOM_PER_RES]; /* Array containing the x for each of its atom */
float y[NB_MAX_ATOM_PER_RES]; /* Array containing the y for each of its atom */ float y[NB_MAX_ATOM_PER_RES]; /* Array containing the y for each of its atom */
float z[NB_MAX_ATOM_PER_RES]; /* Array containing the z for each of its atom */ float z[NB_MAX_ATOM_PER_RES]; /* Array containing the z for each of its atom */
char atomType[NB_MAX_ATOM_PER_RES][10]; /* Array containing the type of atom */ char atomType[NB_MAX_ATOM_PER_RES][10]; /* Array containing the type of atom */
int idAtom[NB_MAX_ATOM_PER_RES]; /* ID of the atom */ int idAtom[NB_MAX_ATOM_PER_RES]; /* ID of the atom */
int nbAtom; /* Number of atom for this residue */ int nbAtom; /* Number of atom for this residue */
int isCandidate; /* 1 if this residue belongs to the docking interface */ int isCandidate; /* 1 if this residue belongs to the docking interface */
int isAtomCandidate[NB_MAX_ATOM_PER_RES]; /* 1 if the atom belongs to the docking interface */
}; };
struct docking_results { struct docking_results {
......
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