?? main.cc-new
字號:
/* main.cc */#include <iostream.h>#include <math.h>#include "hybrids.h"#include "ranlib.h"#include "gs.h"#include "ls.h"#include "rep.h"#include "support.h"#ifdef sgi #include "main.h" #include "autoglobal.h" #include <sys/types.h> /*time_t time(time_t *tloc); */ #include <time.h> /*time_t time(time_t *tloc); */ #include <sys/times.h> #include <stdlib.h> #include <string.h> #include <sys/param.h> #include <ctype.h> /* tolower */ #include <unistd.h> /* sysconf */ #include "printdate.h" #include "parse_dpf_line.h" #include "print_2x.h" #include "strindex.h" #include "stop.h" #include "stateLibrary.h" #include "timesyshms.h" #include "cnv_state_to_coords.h" #include "structs.h" #include "assert.h"#else extern "C" { #include "main.h" #include "autoglobal.h" #include <sys/types.h> /*time_t time(time_t *tloc); */ #include <time.h> /*time_t time(time_t *tloc); */ #include <sys/times.h> #include <stdlib.h> #include <string.h> #include <sys/param.h> #include <ctype.h> /* tolower */ #include <unistd.h> /* sysconf */ #include "printdate.h" #include "parse_dpf_line.h" #include "print_2x.h" #include "strindex.h" #include "stop.h" #include "stateLibrary.h" #include "timesyshms.h" #include "cnv_state_to_coords.h" #include "structs.h" #include "assert.h"#ifndef HPPA /* Causes error with gcc on HP */ /* Needed on Sun */ int gethostname(char *name,int namelen);#endif }#endif#define RIJ_MIN 1.0#define RIJ_MAX 6.0#define EPSIJ_MIN 0.0#define EPSIJ_MAX 10.0extern int debug;extern int keepresnum;extern float idct;int sel_prop_count = 0;extern Eval evaluate;int main( int argc, char **argv, char **envp )/********************************************************************************* Name: main (AutoDock) **** Function: Performs Automated Docking of Small Molecule into Macromolecule **** Copyright: (C) 1994-1999 TSRI, Arthur J. Olson's Labortatory. ****____________________________________________________________________________**** Authors: Garrett Matthew Morris, Current C/C++ version 3.0 **** e-mail: garrett@scripps.edu **** **** David Goodsell, Orignal FORTRAN version 1.0 **** e-mail: goodsell@scripps.edu **** **** The Scripps Research Institute **** Department of Molecular Biology, MB5 **** 10550 North Torrey Pines Road **** La Jolla, CA 92037. **** **** Date: 03/04/99 ****____________________________________________________________________________**** Inputs: Control file, Small Molecule PDBQ file, macromolecular grid map **** files. **** Returns: Autodock Log File, includes docked conformation clusters (PDBQ).**** Globals: X, Y, Z, SPACE, MAX_GRID_PTS, NEINT, MAX_ATOMS, **** MAX_MAPS, ATOM_MAPS, A_DIVISOR, LINE_LEN,TRUE,FALSE **** programname, command_mode, **** command_in_fp, command_out_fp, parFile, logFile. ****____________________________________________________________________________**** Modification Record **** Date Inits Comments **** 09/06/95 RSH Added code to handle GA/LS stuff **** DSG Quaternion rotations **** DSG Generates torsions from annotated pdb list **** DSG Generates internal energies **** DSG Performs a limited Cluster analysis of conformations **** 05/07/92 GMM C translation **** 05/14/92 GMM Time-dependent seed in random-number generation **** 10/29/92 GMM Application Visualization System (AVS) readable grid **** display file input. **** [AVS is a trademark of Stardent Computer Inc.] **** 04/17/93 GMM '-o' oldpdbq flag for q in columns 55-61; **** the default PDBQ format is now columns 71-76; **** Also added the 'total_charge' check. **** 11/19/93 GMM #ifdef NOSQRT, with non-square-rooting acceleration. **** 09/26/94 GMM Cluster analysis now outputs RMS deviations. **** 09/28/94 GMM Modularized code. **** 10/02/94 GMM Distance constraints added, for Ed Moret. Accelerated. *********************************************************************************/{char atm_typ_str[ATOM_MAPS];char atomstuff[MAX_ATOMS][MAX_CHARS];char error_message[LINE_LEN];char FN_clus[MAX_CHARS];char FN_watch[MAX_CHARS];char FN_gdfld[MAX_CHARS];char FN_gpf[MAX_CHARS];char FN_ligand[MAX_CHARS];char FN_trj[MAX_CHARS];char FN_receptor[MAX_CHARS];char hostnm[MAX_CHARS];char line[LINE_LEN];char out_acc_rej = '?';char param[2][MAX_CHARS];char timeSeedIsSet[2];char pdbaname[MAX_ATOMS][5];char FN_rms_ref_crds[MAX_CHARS];char selminpar = 'm';char S_contype[8]; char torfmt[LINE_LEN];float crdpdb[MAX_ATOMS][SPACE];float crd[MAX_ATOMS][SPACE];float lig_center[SPACE];float map_center[SPACE];float vt[MAX_TORS][SPACE];float c=0.;float cA;float cB;float charge[MAX_ATOMS];float clus_rms_tol = 0.;float e0max = BIG;float eintra = 0.0;float einter = 0.0;float econf[MAX_RUNS];float elec[MAX_ATOMS];float emap[MAX_ATOMS];float epsij;float F_A;float F_Aova;float F_tor;float F_TorConRange[MAX_TORS][MAX_TOR_CON][2];float F_torPref;float F_torHWdth;float inv_spacing = 0.;float qtwFac = 1.0;float qtwStep0 = 5.;float qtwStepFinal = 5.0;float mapmax[MAX_MAPS];float mapmin[MAX_MAPS];float maxrad = -1.;float q1q2[MAX_NONBONDS];float r2sum=0.;float Rij;float RJ = 8.31441; // in J/K/mol, Gas Constant, Atkins Phys.Chem., 2/efloat Rcal = 1.9871917; // in cal/K/mol, Gas Constant, RJ/4.184float T0K = 273.15; // 0 degrees Celsius, in K// float TK = 298.15; // Room temperature, in K// float deltaG = 0.0;// float Ki = 1.0;float RTreduc = 1.;float spacing = 0.;float sqlower;float squpper;float RT0 = 616.;float RTFac = 0.95;float tmpconst;float torsdoffac = 0.3113;float torFac = 1.0;float torsFreeEnergy = 0.0;float torStep0 = 5.;float torStepFinal = 5.0;float trnFac = 1.0;float trnStep0 = 0.2;float trnStepFinal = 0.2;float WallEnergy = 1.0e8; /* Energy barrier beyond walls of gridmaps. */float xhi;float xlo;float yhi;float ylo;float zhi;float zlo;unsigned short US_TorE[MAX_TORS];Boole B_isGaussTorCon = FALSE;Boole B_constrain_dist;Boole B_either = FALSE;Boole B_calcIntElec = FALSE;Boole B_write_trj = FALSE;Boole B_watch = FALSE;Boole B_acconly = FALSE;Boole B_cluster_mode = FALSE;Boole B_havemap = FALSE;Boole B_havenbp = FALSE;Boole B_haveCharges;Boole B_linear_schedule = FALSE;Boole B_qtwReduc = FALSE;Boole B_selectmin = FALSE;Boole B_symmetry_flag = TRUE;Boole B_tempChange = TRUE;Boole B_torReduc = FALSE;Boole B_trnReduc = FALSE;Boole B_write_all_clusmem = FALSE;Boole B_isTorConstrained[MAX_TORS];Boole B_ShowTorE = FALSE;Boole B_RandomTran0 = FALSE;Boole B_RandomQuat0 = FALSE;Boole B_RandomDihe0 = FALSE;Boole B_CalcTrnRF = FALSE;Boole B_CalcQtwRF = FALSE;Boole B_CalcTorRF = FALSE;Boole B_charMap = FALSE;int ntorsdof = 0;int atm1=0;int atm2=0;int a1=0;int a2=0;int atomC1;int atomC2;int dpf_keyword = -1;int gridpts1[SPACE];int gridpts[SPACE];int Htype = 0;int ncycles = -1;int iCon=0;int imap=0;int indcom = 0;int ltorfmt = 4;int nruns = 0;int nstepmax = -1;int naccmax = 0;int natom = 0;int nonbondlist[MAX_NONBONDS][2];int nconf = 0;int ncycm1 = 1;int ndihed = 0;int nlig = 0;int nres = 0;int nmol = 0;int Nnb = 0;int Nnbonds[MAX_ATOMS]; /* num. non-bonded interactions for each atom */int nrejmax = 0;int ntor;int ntor1;int num_all_maps = 0;int num_atm_maps = 0;int nval = 0;int outlev = -1;int retval = 0;int status = 0;int tlist[MAX_TORS][MAX_ATOMS];int trj_end_cyc = 0;int trj_begin_cyc = 0;int trj_freq = 0;int type[MAX_ATOMS];int xA;int xB;int I_tor;int I_torBarrier;int N_con[MAX_TORS];int MaxRetries = 1000; /* Default maximum number of retries for ligand init. */int OutputEveryNTests = 1000;int NumLocalTests = 10;int maxTests = 10000;/* int beg; *//* int end; *//* int imol = 0; */unsigned short US_energy;unsigned short US_tD;unsigned short US_torBarrier = TORBARMAX;unsigned short US_torProfile[MAX_TORS][NTORDIVS];unsigned short US_min = TORBARMAX;register int i = 0;register int j = 0;int j1 = 1;register int k = 0;register int XYZ = 0;State sInit; /* float qtn0[QUAT], tor0[MAX_TORS]; */State sHist[MAX_RUNS]; /*qtnHist[MAX_RUNS][QUAT],torHist[MAX_RUNS][MAX_TORS];*/Molecule mol; /* ligand */static float e_internal[NEINT][ATOM_MAPS][ATOM_MAPS];static float ELECSCALE = 83.015909; /* relative dielectric epsilon = 4*r *//* static float ELECSCALE = 332.06363; // relative dielectric epsilon = r */static float F_A_from;static float F_A_to;static float F_lnH;static float F_W;static float F_hW;static float map[MAX_GRID_PTS][MAX_GRID_PTS][MAX_GRID_PTS][MAX_MAPS];static float version = 3.0;static FourByteLong clktck = 0;struct tms tms_jobStart;struct tms tms_gaStart;struct tms tms_gaEnd;Clock jobStart;Clock gaStart;Clock gaEnd;time_t time_seed;// The GA StuffFourByteLong seed[2];unsigned int pop_size = 50;unsigned int num_generations = 0; // Don't terminate on the basis of number of generationsunsigned int num_evals = 150000;unsigned int max_its = 30;unsigned int max_succ = 4;unsigned int max_fail = 4;int window_size = 10;int low = 0;int high = 100;int elitism = 1;float m_rate = 0.02;float c_rate = 0.80;float alpha = 0;float beta = 1;float search_freq = 0.06;float rho = 1.0;float lb_rho = 0.01;float *rho_ptr = NULL;float *lb_rho_ptr = NULL;Selection_Mode s_mode = Proportional;Xover_Mode c_mode = TwoPt;Worst_Mode w_mode = AverageOfN;EvalMode e_mode = Normal_Eval;Global_Search *GlobalSearchMethod = NULL;Local_Search *LocalSearchMethod = NULL;/*____________________________________________________________________________*//*** Get the time at the start of the run...*/jobStart = times( &tms_jobStart );/*____________________________________________________________________________*//*** Parse the arguments in the command line...*/if ( setflags(argc,argv) == -1) { exit(-1);} /* END PROGRAM */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -