Commit 3f2e07b6 by Chloe Dequeker

modif name of output. Only one file per run

parent 88b22157
...@@ -170,31 +170,20 @@ void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL, int numConf) ...@@ -170,31 +170,20 @@ void getInterface(struct pdb_values* pdbR, struct pdb_values* pdbL, int numConf)
} }
} }
FILE* ligOut = NULL;
FILE* recOut = NULL;
char buf[500];
sprintf(buf,"%s/%s-%s_lig_%d_dockinter.txt",outputDir,receptor,ligand,numConf);
ligOut = fopen(buf,"w");
for(i=0;i<nbCandL;i++){ for(i=0;i<nbCandL;i++){
if(t_candidateL[i]->isCandidate == 1) if(t_candidateL[i]->isCandidate == 1)
fprintf(ligOut,"%s %s %c\n",t_candidateL[i]->resName,t_candidateL[i]->idRes,t_candidateL[i]->chain); fprintf(outputFile_lig,"%s %s %c\n",t_candidateL[i]->resName,t_candidateL[i]->idRes,t_candidateL[i]->chain);
} }
fclose(ligOut);
sprintf(buf,"%s/%s-%s_rec_%d_dockinter.txt",outputDir,receptor,ligand,numConf);
recOut = fopen(buf,"w");
for(i=0;i<nbCandR;i++){ for(i=0;i<nbCandR;i++){
if(t_candidateR[i]->isCandidate == 1) if(t_candidateR[i]->isCandidate == 1)
fprintf(recOut,"%s %s %c\n",t_candidateR[i]->resName,t_candidateR[i]->idRes,t_candidateR[i]->chain); fprintf(outputFile_rec,"%s %s %c\n",t_candidateR[i]->resName,t_candidateR[i]->idRes,t_candidateR[i]->chain);
} }
fclose(recOut);
free(t_candidateL); free(t_candidateL);
free(t_candidateR); free(t_candidateR);
} }
//void writeInterface(struct )
struct docking_results* getDataForComplex(){ struct docking_results* getDataForComplex(){
......
...@@ -135,6 +135,8 @@ void free_argLine(){ ...@@ -135,6 +135,8 @@ void free_argLine(){
free(pdbDir); free(pdbDir);
free(receptor); free(receptor);
free(ligand); free(ligand);
fclose(outputFile_rec);
fclose(outputFile_lig);
if(constructPDB){ if(constructPDB){
free(outputPDB); free(outputPDB);
......
...@@ -10,7 +10,7 @@ void print_usage() { ...@@ -10,7 +10,7 @@ void print_usage() {
printf("Usage: \n" printf("Usage: \n"
"Mandatory\n" "Mandatory\n"
"=========\n\n" "=========\n\n"
"<-dockingFile> MAXDo file that needs to be analysed\n" "<-dockingFile> MAXDo file that needs to be analysed\n"
"<-pdbDir> PDB directory containing the name of the receptor/ligand .pdb\n" "<-pdbDir> PDB directory containing the name of the receptor/ligand .pdb\n"
"<-rec> name of the receptor\n" "<-rec> name of the receptor\n"
"<-lig> name of the ligand\n" "<-lig> name of the ligand\n"
...@@ -27,6 +27,7 @@ void print_usage() { ...@@ -27,6 +27,7 @@ void print_usage() {
struct argLine* parseLineOfArgument(int argc, char** argv){ struct argLine* parseLineOfArgument(int argc, char** argv){
int i = 0, print_help = 0; int i = 0, print_help = 0;
char buf[500];
struct argLine* paramVals = NULL; struct argLine* paramVals = NULL;
...@@ -41,6 +42,8 @@ struct argLine* parseLineOfArgument(int argc, char** argv){ ...@@ -41,6 +42,8 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
pdbDir = NULL; pdbDir = NULL;
receptor = NULL; receptor = NULL;
ligand = NULL; ligand = NULL;
outputFile_rec = NULL;
outputFile_lig = NULL;
for(i=1; i<argc; i++){ for(i=1; i<argc; i++){
if(strcmp(argv[i],"-dockingFile") == 0){ if(strcmp(argv[i],"-dockingFile") == 0){
...@@ -152,5 +155,35 @@ struct argLine* parseLineOfArgument(int argc, char** argv){ ...@@ -152,5 +155,35 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
strcpy(outputPDB,"./"); strcpy(outputPDB,"./");
} }
if(target_conf > 0){
sprintf(buf,"%s/%s-%s_rec_%d_dockinter.txt",outputDir,receptor,ligand,target_conf);
outputFile_rec = fopen(buf,"w");
if(outputFile_rec == NULL){
perror("fopen");
exit(EXIT_FAILURE);
}
sprintf(buf,"%s/%s-%s_lig_%d_dockinter.txt",outputDir,receptor,ligand,target_conf);
if(outputFile_lig == NULL){
perror("fopen");
exit(EXIT_FAILURE);
}
outputFile_lig = fopen(buf,"w");
}else{
sprintf(buf,"%s/%s-%s_rec_dockinter.txt",outputDir,receptor,ligand);
outputFile_rec = fopen(buf,"w");
if(outputFile_rec == NULL){
perror("fopen");
exit(EXIT_FAILURE);
}
sprintf(buf,"%s/%s-%s_lig_dockinter.txt",outputDir,receptor,ligand);
if(outputFile_lig == NULL){
perror("fopen");
exit(EXIT_FAILURE);
}
outputFile_lig = fopen(buf,"w");
}
return paramVals; return paramVals;
} }
...@@ -20,6 +20,8 @@ char* ligand; ...@@ -20,6 +20,8 @@ char* ligand;
char* dockingFile; char* dockingFile;
char* outputDir; char* outputDir;
char* outputPDB; char* outputPDB;
FILE* outputFile_rec;
FILE* outputFile_lig;
#define CDR 0.017453293 #define CDR 0.017453293
#define NB_MAX_ATOM_PER_RES 20 #define NB_MAX_ATOM_PER_RES 20
#define DIST_FOR_CONTACT 10 #define DIST_FOR_CONTACT 10
......
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