Commit 472aa481 by Chloe Dequeker

comments almost done

parent e08ee47c
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
void getCandidatesForP1(struct pdb_values* pdb2, struct residue** t_candid1, struct residue** t_candid2, int* nbCand1, int* nbCand2); 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);
struct docking_results* getDataForComplex(); struct docking_results* getDataForComplex();
struct docking_results* getDataForComplex_HCMD2();
struct pdb_values* readPDB(char* protein) ; struct pdb_values* readPDB(char* protein) ;
void removeSpace(char* string); void removeSpace(char* string);
void writePDB(struct pdb_values* pdb, char* protName, int nbConf); void writePDB(struct pdb_values* pdb, char* protName, int nbConf);
......
...@@ -9,6 +9,7 @@ void freePDB(struct pdb_values* pdb){ ...@@ -9,6 +9,7 @@ void freePDB(struct pdb_values* pdb){
pdb = NULL; pdb = NULL;
} }
void freeDock(struct docking_results* dock_res){ void freeDock(struct docking_results* dock_res){
/* Free the docking interface */ /* Free the docking interface */
free(dock_res->listEner); free(dock_res->listEner);
...@@ -42,8 +43,6 @@ struct docking_results* allocate_dockingResults(int nbConf){ ...@@ -42,8 +43,6 @@ struct docking_results* allocate_dockingResults(int nbConf){
dock_res->alpha = NULL; dock_res->alpha = NULL;
dock_res->beta = NULL; dock_res->beta = NULL;
dock_res->gamma = NULL; dock_res->gamma = NULL;
dock_res->inter_rec = NULL;
dock_res->inter_lig = NULL;
dock_res->listEner = malloc((2*nbConf)*sizeof(float)); dock_res->listEner = malloc((2*nbConf)*sizeof(float));
if(dock_res->listEner == NULL){ if(dock_res->listEner == NULL){
...@@ -156,3 +155,11 @@ void free_argLine(){ ...@@ -156,3 +155,11 @@ void free_argLine(){
fclose(verbose_file); fclose(verbose_file);
} }
} }
void freeAll(struct pdb_values* pdbR, struct pdb_values* pdbL, struct docking_results* dock_res){
/* Free all the arguments passed to this function */
freePDB(pdbL);
freePDB(pdbR);
freeDock(dock_res);
free_argLine();
}
...@@ -9,5 +9,6 @@ struct docking_results* allocate_dockingResults(int nbConf); ...@@ -9,5 +9,6 @@ struct docking_results* allocate_dockingResults(int nbConf);
void reset_dockingResults(struct docking_results* dock_res); void reset_dockingResults(struct docking_results* dock_res);
struct pdb_values* allocate_pdb(int nbRes); struct pdb_values* allocate_pdb(int nbRes);
void free_argLine(); void free_argLine();
void freeAll(struct pdb_values* pdbR, struct pdb_values* pdbL, struct docking_results* dock_res);
#endif #endif
...@@ -37,7 +37,6 @@ struct argLine* parseLineOfArgument(int argc, char** argv){ ...@@ -37,7 +37,6 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
struct argLine* paramVals = NULL; struct argLine* paramVals = NULL;
nbThreads = 1;
verbose = 0; verbose = 0;
constructPDB = 0; constructPDB = 0;
target_conf = -1; target_conf = -1;
...@@ -96,10 +95,6 @@ struct argLine* parseLineOfArgument(int argc, char** argv){ ...@@ -96,10 +95,6 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
strcpy(ligand,argv[i+1]); strcpy(ligand,argv[i+1]);
}else if(strcmp(argv[i],"-p") == 0){
nbThreads = atoi(argv[i+1]);
if(nbThreads <= 0)
nbThreads = 1;
}else if(strcmp(argv[i],"-pose") == 0){ }else if(strcmp(argv[i],"-pose") == 0){
target_conf = atoi(argv[i+1]); target_conf = atoi(argv[i+1]);
if(target_conf <= 0){ if(target_conf <= 0){
...@@ -155,7 +150,7 @@ struct argLine* parseLineOfArgument(int argc, char** argv){ ...@@ -155,7 +150,7 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
strcpy(outputDir,"./"); strcpy(outputDir,"./");
} }
if(constructPDB == 1 && outputPDB == NULL){ if(constructPDB && outputPDB == NULL){
outputPDB = malloc(3*sizeof(char)); outputPDB = malloc(3*sizeof(char));
if(outputPDB == NULL){ if(outputPDB == NULL){
perror("mallloc"); perror("mallloc");
......
...@@ -20,13 +20,13 @@ struct pdb_values* rotate_sophie(struct pdb_values* pdb, struct pdb_values* pdbR ...@@ -20,13 +20,13 @@ struct pdb_values* rotate_sophie(struct pdb_values* pdb, struct pdb_values* pdbR
* The final center of the repair is the geometric center of the PDB pdbR. * The final center of the repair is the geometric center of the PDB pdbR.
* The angles alpha, beta, gamma in arguments correspond to the rotation angles that have to be applied to * The angles alpha, beta, gamma in arguments correspond to the rotation angles that have to be applied to
* each residue. * each residue.
* In the struct dock_res, we can find the angles alpha0, beta0 and gamma0. alpha0 corresponds to the angles alpha * In the struct dock_res, we can find the angles alpha0, beta0 and gamma0.
* and beta for the first CA (from the axis x and y) + the rotation angles dalpha and dbeta respectively * alpha0 corresponds to the final angle alpha of the CA 1 once it's been rotated by dalpha
* gamma0 corresponds to the angle gamma from the fifth CA of the protein after being rotated of alpha (NOT dalpha) * beta0 corresponds to the final angle beta of the CA 1 once it's been rotated by dbeta
* then by beta (NOT dbeta). * gamma0 corresponds to the final angle gamma of the CA 5 once it's been rotated by dalpha and then dbeta
* c_a0 can be seen as the unit vector of the axis X rotated by alpha0
* *
* The rotation matrices are available at : https://en.wikipedia.org/wiki/Rotation_matrix in "Nested Dimensions" * The rotation matrices used are available at :
* https://en.wikipedia.org/wiki/Rotation_matrix in "Nested Dimensions"
*/ */
float xi = 0, yi = 0, zi = 0; float xi = 0, yi = 0, zi = 0;
......
...@@ -9,111 +9,68 @@ ...@@ -9,111 +9,68 @@
* They are used to alter the way the program goes * They are used to alter the way the program goes
*/ */
int nbThreads; #define COEF_DEGREE_TO_RADIAN 0.017453293 /* Coefficient to convert degrees to radians */
int verbose; #define NB_MAX_ATOM_PER_RES 20 /* No residue has more atoms than that */
int constructPDB; #define DIST_FOR_CONTACT 10 /* Distance under which we consider
int target_conf; * two residues are in contact */
int HCMD2;
FILE* verbose_file;
char* pdbDir;
char* receptor;
char* ligand;
char* dockingFile;
char* outputDir;
char* outputPDB;
FILE* outputFile_rec;
FILE* outputFile_lig;
#define COEF_DEGREE_TO_RADIAN 0.017453293
#define NB_MAX_ATOM_PER_RES 20
#define DIST_FOR_CONTACT 10
#define FORMAT_LINE_PDB "ATOM %5d %3s %3s %c%5s %8.3f%8.3f%8.3f\n"
/*************************************************/ /* 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"
struct interface_data {
long key;
long nbRes;
};
struct interface {
char (*posID)[6];
char* chain;
long nbRes;
float* carac; /* Potentially add a caracteristic to each residue */
};
struct enerComplex { int verbose; /* 1 if we are in verbose mode */
int ID; int constructPDB; /* 1 if we should build the PDB */
float ener; int target_conf; /* 1 if we are specific to one conformation */
}; int HCMD2; /* 1 if this is HCMD2 format */
FILE* verbose_file; /* If verbose mode, the output file */
char* pdbDir; /* Directory containing the PDBs */
char* receptor; /* Name of the receptor */
char* ligand; /* Name of the ligand */
char* dockingFile; /* Docking file name */
char* outputDir; /* Output directory for the interface files */
char* outputPDB; /* Output directory if we construct the PDB(s) */
FILE* outputFile_rec; /* Name of the interface output file for the receptor */
FILE* outputFile_lig; /* Name of the interface output file for the ligand */
struct value_complex { /*************************************************/
int ID;
float II;
};
struct pdb_values { struct pdb_values {
int nbRes; int nbRes; /* Number of residue for this PDB */
int nbAtom; int nbAtom; /* Number of atoms for this PDB */
struct residue* residues; struct residue* residues; /* Array containing all the PDBs */
float centerX; float centerX; /* Geometric X center for this PDB */
float centerY; float centerY; /* Geometric Y center for this PDB */
float centerZ; float centerZ; /* Geometric Z center for this PDB */
float xCA1; float xCA1; /* x value of the 1rst CA */
float yCA1; float yCA1; /* y value of the 1rst CA */
float zCA1; float zCA1; /* z value of the 1rst CA */
float xCA5; float xCA5; /* x value of the 5th CA */
float yCA5; float yCA5; /* y value of the 5th CA */
float zCA5; float zCA5; /* z value of the 5th CA */
}; };
/* Structure that contains all the informations we need for a residue */
struct residue { struct residue {
char idRes[10]; char idRes[10]; /* ID of the residue */
char chain; char chain; /* Chain to which the residue belongs */
char resName[10]; char resName[10]; /* Name of the residue */
float x[NB_MAX_ATOM_PER_RES]; float x[NB_MAX_ATOM_PER_RES]; /* Array containing the x for each of its atom */
float y[NB_MAX_ATOM_PER_RES]; float y[NB_MAX_ATOM_PER_RES]; /* Array containing the y for each of its atom */
float z[NB_MAX_ATOM_PER_RES]; float z[NB_MAX_ATOM_PER_RES]; /* Array containing the z for each of its atom */
char atomType[NB_MAX_ATOM_PER_RES][10]; char atomType[NB_MAX_ATOM_PER_RES][10]; /* Array containing the type of atom */
int idAtom[NB_MAX_ATOM_PER_RES]; int idAtom[NB_MAX_ATOM_PER_RES]; /* ID of the atom */
int nbAtom; int nbAtom; /* Number of atom for this residue */
int isCandidate; int isCandidate; /* 1 if this residue belongs to the docking interface */
}; };
struct docking_results { struct docking_results {
float* listEner; float* listEner; /* Array containing the energy for each conformation */
float* distCenters; float* distCenters; /* Distance between the center of the receptor and of the ligand */
float* theta; float* theta; /* theta angle for the center of the ligand */
float* phi; float* phi; /* phi angle for the center of the ligand */
float* alpha; float* alpha; /* */
float* beta; float* beta;
float* gamma; float* gamma;
struct interface* inter_rec;
struct interface* inter_lig;
int nbConf; int nbConf;
}; };
struct pthread_data {
int ID_thread;
int ID_rec;
int nbProt;
int* t_thread;
char** receptorsNames;
char** ligandsNames;
char* dockingDir;
char* docking;
char* wayFIR;
char* jetParentDir;
struct value_complex* lineOfMatrix;
struct interface** a3_predList;
struct interface** a4_predList;
struct interface** a5_predList;
struct interface** nip_predList;
struct interface** lig_predList;
struct interface* predRec;
struct docking_results** dockingRes;
};
#endif #endif
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