Commit 472aa481 by Chloe Dequeker

comments almost done

parent e08ee47c
......@@ -6,7 +6,6 @@
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);
struct docking_results* getDataForComplex();
struct docking_results* getDataForComplex_HCMD2();
struct pdb_values* readPDB(char* protein) ;
void removeSpace(char* string);
void writePDB(struct pdb_values* pdb, char* protName, int nbConf);
......
......@@ -9,6 +9,7 @@ void freePDB(struct pdb_values* pdb){
pdb = NULL;
}
void freeDock(struct docking_results* dock_res){
/* Free the docking interface */
free(dock_res->listEner);
......@@ -42,8 +43,6 @@ struct docking_results* allocate_dockingResults(int nbConf){
dock_res->alpha = NULL;
dock_res->beta = NULL;
dock_res->gamma = NULL;
dock_res->inter_rec = NULL;
dock_res->inter_lig = NULL;
dock_res->listEner = malloc((2*nbConf)*sizeof(float));
if(dock_res->listEner == NULL){
......@@ -156,3 +155,11 @@ void free_argLine(){
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);
void reset_dockingResults(struct docking_results* dock_res);
struct pdb_values* allocate_pdb(int nbRes);
void free_argLine();
void freeAll(struct pdb_values* pdbR, struct pdb_values* pdbL, struct docking_results* dock_res);
#endif
......@@ -37,7 +37,6 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
struct argLine* paramVals = NULL;
nbThreads = 1;
verbose = 0;
constructPDB = 0;
target_conf = -1;
......@@ -96,10 +95,6 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
exit(EXIT_FAILURE);
}
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){
target_conf = atoi(argv[i+1]);
if(target_conf <= 0){
......@@ -155,7 +150,7 @@ struct argLine* parseLineOfArgument(int argc, char** argv){
strcpy(outputDir,"./");
}
if(constructPDB == 1 && outputPDB == NULL){
if(constructPDB && outputPDB == NULL){
outputPDB = malloc(3*sizeof(char));
if(outputPDB == NULL){
perror("mallloc");
......
......@@ -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 angles alpha, beta, gamma in arguments correspond to the rotation angles that have to be applied to
* each residue.
* In the struct dock_res, we can find the angles alpha0, beta0 and gamma0. alpha0 corresponds to the angles alpha
* and beta for the first CA (from the axis x and y) + the rotation angles dalpha and dbeta respectively
* gamma0 corresponds to the angle gamma from the fifth CA of the protein after being rotated of alpha (NOT dalpha)
* then by beta (NOT dbeta).
* c_a0 can be seen as the unit vector of the axis X rotated by alpha0
* In the struct dock_res, we can find the angles alpha0, beta0 and gamma0.
* alpha0 corresponds to the final angle alpha of the CA 1 once it's been rotated by dalpha
* beta0 corresponds to the final angle beta of the CA 1 once it's been rotated by dbeta
* gamma0 corresponds to the final angle gamma of the CA 5 once it's been rotated by dalpha and then dbeta
*
* 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;
......
......@@ -9,111 +9,68 @@
* They are used to alter the way the program goes
*/
int nbThreads;
int verbose;
int constructPDB;
int target_conf;
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"
#define COEF_DEGREE_TO_RADIAN 0.017453293 /* Coefficient to convert degrees to radians */
#define NB_MAX_ATOM_PER_RES 20 /* No residue has more atoms than that */
#define DIST_FOR_CONTACT 10 /* Distance under which we consider
* two residues are in contact */
/*************************************************/
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 */
};
/* 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 enerComplex {
int ID;
float ener;
};
int verbose; /* 1 if we are in verbose mode */
int constructPDB; /* 1 if we should build the PDB */
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 {
int nbRes;
int nbAtom;
struct residue* residues;
float centerX;
float centerY;
float centerZ;
float xCA1;
float yCA1;
float zCA1;
float xCA5;
float yCA5;
float zCA5;
int nbRes; /* Number of residue for this PDB */
int nbAtom; /* Number of atoms for this PDB */
struct residue* residues; /* Array containing all the PDBs */
float centerX; /* Geometric X center for this PDB */
float centerY; /* Geometric Y center for this PDB */
float centerZ; /* Geometric Z center for this PDB */
float xCA1; /* x value of the 1rst CA */
float yCA1; /* y value of the 1rst CA */
float zCA1; /* z value of the 1rst CA */
float xCA5; /* x value of the 5th CA */
float yCA5; /* y value of the 5th CA */
float zCA5; /* z value of the 5th CA */
};
/* Structure that contains all the informations we need for a residue */
struct residue {
char idRes[10];
char chain;
char resName[10];
float x[NB_MAX_ATOM_PER_RES];
float y[NB_MAX_ATOM_PER_RES];
float z[NB_MAX_ATOM_PER_RES];
char atomType[NB_MAX_ATOM_PER_RES][10];
int idAtom[NB_MAX_ATOM_PER_RES];
int nbAtom;
int isCandidate;
char idRes[10]; /* ID of the residue */
char chain; /* Chain to which the residue belongs */
char resName[10]; /* Name of the residue */
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 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 */
int idAtom[NB_MAX_ATOM_PER_RES]; /* ID of the atom */
int nbAtom; /* Number of atom for this residue */
int isCandidate; /* 1 if this residue belongs to the docking interface */
};
struct docking_results {
float* listEner;
float* distCenters;
float* theta;
float* phi;
float* alpha;
float* listEner; /* Array containing the energy for each conformation */
float* distCenters; /* Distance between the center of the receptor and of the ligand */
float* theta; /* theta angle for the center of the ligand */
float* phi; /* phi angle for the center of the ligand */
float* alpha; /* */
float* beta;
float* gamma;
struct interface* inter_rec;
struct interface* inter_lig;
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
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