Commit fc4d3f23 authored by Leonardo Solis's avatar Leonardo Solis

#20, preliminary implementation of rmsd using xray ligand

parent 96a0f0f5
......@@ -67,6 +67,8 @@ typedef struct
char gen_pdbs;
char fldfile [128];
char ligandfile [128];
char xrayligandfile [128];
bool given_xrayligandfile;
float ref_ori_angles [3];
unsigned long num_of_runs;
char reflig_en_reqired;
......
......@@ -67,13 +67,14 @@ typedef struct {
} Gradientparameters;
#endif
int docking_with_gpu(const Gridinfo* mygrid,
/*const*/ float* cpu_floatgrids,
Dockpars* mypars,
const Liganddata* myligand_init,
const int* argc,
char** argv,
clock_t clock_start_program);
int docking_with_gpu(const Gridinfo* mygrid,
/*const*/ float* cpu_floatgrids,
Dockpars* mypars,
const Liganddata* myligand_init,
const Liganddata* myxrayligand,
const int* argc,
char** argv,
clock_t clock_start_program);
double check_progress(int* evals_of_runs,
int generation_cnt,
......
......@@ -73,6 +73,7 @@ void make_resfiles( float* final_population,
float* energies,
const Liganddata* ligand_ref,
const Liganddata* ligand_from_pdb,
const Liganddata* ligand_xray,
const Dockpars* mypars,
int evals_performed,
int generations_used,
......
......@@ -172,7 +172,9 @@ void get_commandpars(const int* argc,
mypars->gen_best = 0;
strcpy(mypars->resname, "docking");
mypars->qasp = 0.01097f;
mypars->rmsd_tolerance = 2.0; //2 Angström
mypars->rmsd_tolerance = 2.0; //2 Angström
strcpy(mypars->xrayligandfile, mypars->ligandfile); // By default xray-ligand file is the same as the randomized input ligand
mypars->given_xrayligandfile = false; // That is, not given (explicitly by the user)
// ------------------------------------------
//overwriting values which were defined as a command line argument
......@@ -574,9 +576,20 @@ void get_commandpars(const int* argc,
else
printf("Warning: value of -rmstol argument ignored. Value must be a double greater than 0.\n");
}
// ----------------------------------
//Argument: ligand xray pdbqt file name
if (strcmp("-xraylfile", argv[i]) == 0)
{
arg_recognized = 1;
strcpy(mypars->xrayligandfile, argv[i+1]);
mypars->given_xrayligandfile = true;
printf("Info: using -xraylfile value as X-ray ligand.");
}
// ----------------------------------
if (arg_recognized != 1)
printf("Warning: unknown argument '%s'.\n", argv [i]);
}
//validating some settings
......
......@@ -90,6 +90,17 @@ int main(int argc, char* argv[])
//------------------------------------------------------------
get_commandpars(&argc, argv, &(mygrid.spacing), &mypars);
Liganddata myxrayligand;
Gridinfo mydummygrid;
// if -lxrayfile provided, then read xray ligand data
if (mypars.given_xrayligandfile == true) {
if (init_liganddata(mypars.xrayligandfile, &myxrayligand, &mydummygrid) != 0)
return 1;
if (get_liganddata(mypars.xrayligandfile, &myxrayligand, mypars.coeffs.AD4_coeff_vdW, mypars.coeffs.AD4_coeff_hb) != 0)
return 1;
}
//------------------------------------------------------------
// Calculating energies of reference ligand if required
//------------------------------------------------------------
......@@ -111,7 +122,7 @@ int main(int argc, char* argv[])
//------------------------------------------------------------
// Starting Docking
//------------------------------------------------------------
if (docking_with_gpu(&mygrid, floatgrids, &mypars, &myligand_init, &argc, argv, clock_start_program) != 0)
if (docking_with_gpu(&mygrid, floatgrids, &mypars, &myligand_init, &myxrayligand, &argc, argv, clock_start_program) != 0)
return 1;
free(floatgrids);
......
......@@ -93,13 +93,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "stringify.h"
#include "correct_grad_axisangle.h"
int docking_with_gpu(const Gridinfo* mygrid,
/*const*/ float* cpu_floatgrids,
Dockpars* mypars,
const Liganddata* myligand_init,
const int* argc,
char** argv,
clock_t clock_start_program)
int docking_with_gpu(const Gridinfo* mygrid,
/*const*/ float* cpu_floatgrids,
Dockpars* mypars,
const Liganddata* myligand_init,
const Liganddata* myxrayligand,
const int* argc,
char** argv,
clock_t clock_start_program)
/* The function performs the docking algorithm and generates the corresponding result files.
parameter mygrid:
describes the grid
......@@ -113,6 +114,9 @@ parameter mypars:
parameter myligand_init:
describes the ligands
filled with get_liganddata()
parameter myxrayligand:
describes the xray ligand
filled with get_xrayliganddata()
parameters argc and argv:
are the corresponding command line arguments parameter clock_start_program:
contains the state of the clock tick counter at the beginning of the program
......@@ -1116,8 +1120,10 @@ filled with clock() */
arrange_result(cpu_final_populations+run_cnt*mypars->pop_size*GENOTYPE_LENGTH_IN_GLOBMEM, cpu_energies+run_cnt*mypars->pop_size, mypars->pop_size);
make_resfiles(cpu_final_populations+run_cnt*mypars->pop_size*GENOTYPE_LENGTH_IN_GLOBMEM,
cpu_energies+run_cnt*mypars->pop_size, &myligand_reference,
myligand_init,
cpu_energies+run_cnt*mypars->pop_size,
&myligand_reference,
myligand_init,
myxrayligand,
mypars,
cpu_evals_of_runs[run_cnt],
generation_cnt,
......
......@@ -231,9 +231,22 @@ void write_basic_info_dlg(FILE* fp, const Liganddata* ligand_ref, const Dockpars
fprintf(fp, "DPF> move %s\n\n\n", mypars->ligandfile);
}
void make_resfiles(float* final_population, float* energies, const Liganddata* ligand_ref,
const Liganddata* ligand_from_pdb, const Dockpars* mypars, int evals_performed, int generations_used, const Gridinfo* mygrid, const float* grids,
float* cpu_ref_ori_angles, const int* argc, char** argv, int debug, int run_cnt, Ligandresult* best_result)
void make_resfiles(float* final_population,
float* energies,
const Liganddata* ligand_ref,
const Liganddata* ligand_from_pdb,
const Liganddata* ligand_xray,
const Dockpars* mypars,
int evals_performed,
int generations_used,
const Gridinfo* mygrid,
const float* grids,
float* cpu_ref_ori_angles,
const int* argc,
char** argv,
int debug,
int run_cnt,
Ligandresult* best_result)
//The function writes out final_population generated by get_result
//as well as different parameters about the docking, the receptor and the ligand to a file called fdock_report.txt in a
//readable and understandable format. The ligand_from_pdb parametere must be the Liganddata which includes the original
......@@ -308,7 +321,12 @@ void make_resfiles(float* final_population, float* energies, const Liganddata* l
accurate_intraE[i] = calc_intraE_f(&temp_docked, 8, mypars->smooth, 0, mypars->coeffs.scaled_AD4_coeff_elec, mypars->coeffs.AD4_coeff_desolv, mypars->qasp, debug);
move_ligand(&temp_docked, mygrid->origo_real_xyz); //moving it according to grid location
entity_rmsds [i] = calc_rmsd(ligand_from_pdb, &temp_docked, mypars->handle_symmetry); //calculating rmds compared to original pdb file
if (mypars->given_xrayligandfile == true) {
entity_rmsds [i] = calc_rmsd(ligand_xray, &temp_docked, mypars->handle_symmetry); //calculating rmds compared to original xray file
}
else {
entity_rmsds [i] = calc_rmsd(ligand_from_pdb, &temp_docked, mypars->handle_symmetry); //calculating rmds compared to original pdb file
}
//copying best result to output parameter
if (i == 0) //assuming this is the best one (final_population is arranged), however,
......
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