GLYLIB  0.3.0b
load_dlg_mol.c
Go to the documentation of this file.
00001 /* File load_dlg_mol.c begun on 20071015 by BLFoley
00002  * Function load_dlg_mol: loads AutoDock dlg output into a
00003  *      molecule structure, placing the initial structure in
00004  *      the main coordinate set and the docked structures into
00005  *      alternate coordinate sets.  Also calculates COM for
00006  *      the main molecule and each residue (initial and docked).
00007 */
00008 #include "../inc/mylib.h"
00009 #include "../inc/general.h"
00010 #include "../inc/molecules.h"
00011 #include "../inc/declarations.h"
00012 #include "../inc/load_pdb.h"
00013 
00014 //dockinfo *load_dlg_mol(fileset F,atype *AT);
00015 
00016 dockinfo *load_dlg_mol(fileset F,types *T){
00017 
00018 int a=0,b=0,ndock=0,ai=0,di=0,ri=0,ti=0,distVer=0,startRanking=0;
00019 int runNum[1], dumi[1];
00020 int *AI,nat=0,localdebug=1;
00021 char line[501],dum1[50]; // maybe no lines longer than 500...
00022 char whinetext[501]; char* ptr;
00023 double xl=0,xh=0,yl=0,yh=0,zl=0,zh=0,fullVer=0;
00024 double dumd[1];
00025 atype* AT = T[0].a;
00026 dockinfo *D;
00027 fileslurp sl;
00028 molecule alt;
00029 //dumd=(double*)calloc(1,sizeof(double));
00030 //dumi=(int*)calloc(1,sizeof(int));
00031 //runNum=(int*)calloc(1,sizeof(int));
00032 //First, the function determines which version of Autodock generated the file
00033 while(fgets(line,500,F.F)!=NULL){
00034         //Find the line with the Autodock version on is
00035         if(strstr(line,"AutoDock")!=NULL){
00036                 ptr = strstr(line,"AutoDock");
00037                 ptr = ptr+9;
00038                 distVer = sscanf(ptr,"%lf",&fullVer);
00039                 if(distVer!=1){read_eek("location of Autodock version",F.N);}
00040                 distVer = floor(fullVer);
00041                 break;
00042         }
00043 }
00044 //If this version has not been taken into account, then throw an error
00045 if(distVer != 3 && distVer != 4){
00046         mywhine("Docking log file does not match known versions.  Must be either version 3.X or 4.X");}
00047 
00048 if(localdebug>0){printf("load_dlg_mol: At top.\n");}
00049 //Initialize the dockinfo, and find the input pdb in the file
00050 D=(dockinfo*)calloc(1,sizeof(dockinfo));
00051 D[0].DOCK_PROGRAM = strdup("Autodock"); //Set autodock as the name of the docking program
00052 D[0].VERSION = (char*)calloc(5,sizeof(char));
00053 D[0].numClusters=0;
00054 sprintf(D[0].VERSION,"%.2lf",fullVer);  //Set the version number
00055 rewind(F.F);
00056 sl = slurp_file(F);                     //Called from fileslurp.c
00057 sl = isolateInputPDB(sl);               //Called from load_pdb.c
00058 D[0].M = load_pdb_from_slurp(sl);       //Called from load_pdb.c
00059 //Set the boundaries for the box to the values of the first atom
00060 //So comparisons can be made later
00061 xl=xh=D[0].M.r[0].a[0].x.i;
00062 yl=yh=D[0].M.r[0].a[0].x.j;
00063 zl=zh=D[0].M.r[0].a[0].x.k;
00064 for(ri = 0; ri < D[0].M.nr; ri++){
00065         for(ai = 0; ai < D[0].M.r[ri].na; ai++){
00066                 for(ti = 0; ti < T[0].na; ti++)//For finding the atype that matches
00067                         if(D[0].M.r[ri].a[ai].N[0]==AT[ti].NT[0])//the atom
00068                                 break;
00069                 //For finding the boundaries of the box
00070                 if(xl>D[0].M.r[ri].a[ai].x.i){xl=D[0].M.r[ri].a[ai].x.i;}
00071                 if(xh<D[0].M.r[ri].a[ai].x.i){xh=D[0].M.r[ri].a[ai].x.i;}
00072                 if(yl>D[0].M.r[ri].a[ai].x.j){yl=D[0].M.r[ri].a[ai].x.j;}
00073                 if(yh<D[0].M.r[ri].a[ai].x.j){yh=D[0].M.r[ri].a[ai].x.j;}
00074                 if(zl>D[0].M.r[ri].a[ai].x.k){zl=D[0].M.r[ri].a[ai].x.k;}
00075                 if(zh<D[0].M.r[ri].a[ai].x.k){zh=D[0].M.r[ri].a[ai].x.k;}
00076                 D[0].M.r[ri].a[ai].t = ti;
00077                 D[0].M.r[ri].m+=AT[ti].m; // add to residue MW
00078                 D[0].M.r[ri].COM.i+=D[0].M.r[ri].a[ai].x.i*AT[ti].m; // residue COM
00079                 D[0].M.r[ri].COM.j+=D[0].M.r[ri].a[ai].x.j*AT[ti].m;
00080                 D[0].M.r[ri].COM.k+=D[0].M.r[ri].a[ai].x.k*AT[ti].m;
00081                 D[0].M.m+=AT[ti].m; // add to molecule MW
00082                 D[0].M.COM.i+=D[0].M.r[ri].a[ai].x.i*AT[ti].m; // molecule COM
00083                 D[0].M.COM.j+=D[0].M.r[ri].a[ai].x.j*AT[ti].m;
00084                 D[0].M.COM.k+=D[0].M.r[ri].a[ai].x.k*AT[ti].m;
00085         }//End loop through all atoms in this residue
00086         nat += D[0].M.r[ri].na;//Generates overall atom total
00087 }//End loop through all residues in this molecule
00088 
00089 
00090 
00091 // ONE DAY:  add in any missing atoms
00092 // -- open the prep database
00093 // -- scan for the residue name
00094 // -- record number/name/type of atoms
00095 // -- mark as present or not, etc...
00096 //
00097 if(localdebug>0){printf("load_dlg_mol: About to start COM calc.\n");}
00098 // finish COM calculation for molecule
00099 D[0].M.COM.i/=D[0].M.m;
00100 D[0].M.COM.j/=D[0].M.m;
00101 D[0].M.COM.k/=D[0].M.m;
00102 //printf("center of mass (MW=%20.12e) is at: %20.12e %20.12e %20.12e \n",D[0].M.COM.i,D[0].M.COM.j,D[0].M.COM.k);
00103 // also for the residues -- plus record atom number correlation
00104 if(localdebug>0){printf("load_dlg_mol: continuing residue-level COM calc.\n");}
00105 AI=(int*)calloc(nat,sizeof(int));
00106 for(a=0;a<D[0].M.nr;a++){ 
00107         if(D[0].M.r[a].na==0){
00108                 sprintf(whinetext,"lack of atoms in residue >>%s<<, number %d",D[0].M.r[a].N,(a+1));
00109                 read_eek(whinetext,F.N);
00110                 }
00111         D[0].M.r[a].COM.i/=D[0].M.r[a].m;
00112         D[0].M.r[a].COM.j/=D[0].M.r[a].m;
00113         D[0].M.r[a].COM.k/=D[0].M.r[a].m;
00114 if(localdebug>0){printf("\tload_dlg_mol: about to set ai indices.\n");}
00115         for(b=0;b<D[0].M.r[a].na;b++){
00116                 if(D[0].M.r[a].a[b].n>nat){mywhine("problem counting atoms (n) in load_dlg");}
00117                 AI[D[0].M.r[a].a[b].n-1]=b;
00118                 }
00119         }
00120 
00121 if(localdebug>0){printf("load_dlg_mol: Scanning to dockings.\n");}
00122 // read in the alternate coordinate sets
00123 while(fgets(line,500,F.F)!=NULL){
00124         if(strstr(line,"Number of requested LGA dockings")!=NULL){
00125 if(localdebug>3){printf("load_dlg_mol: line is >>%s<<\n",line);} 
00126                 sscanf(line,"Number of requested LGA dockings = %d ",&ndock);
00127 if(localdebug>0){printf("load_dlg_mol: ndock is >>%d<<\n",ndock);} 
00128                 break; }}
00129 // allocate the memory -- use the internal ring coordinates to hold
00130 // the extra centers of mass
00131 if(localdebug>0){printf("load_dlg_mol: About to allocate; ndock is %d.\n",ndock);}
00132 D[0].i=0;
00133 D[0].n=ndock;
00134 D[0].TR=(coord_3D*)calloc(ndock,sizeof(coord_3D));//translation for docked structure
00135 D[0].Q=(vectormag_3D*)calloc(ndock,sizeof(vectormag_3D));// Quaternion x,y,z,w
00136 D[0].QN=(vectormag_3D*)calloc(ndock,sizeof(vectormag_3D));// Quaternion nx,ny,nz,angle
00137 D[0].QN0=(vectormag_3D*)calloc(ndock,sizeof(vectormag_3D));// quat0 nx,ny,nz,angle
00138 D[0].eFEB=(double*)calloc(ndock,sizeof(double));// Est. Free Energy of Binding, kcal/mol [=(1)+(3)]
00139 D[0].eKi=(double*)calloc(ndock,sizeof(double));// Est. Inhibition Const. Ki 
00140 D[0].Tmp=(double*)calloc(ndock,sizeof(double));// temperature, Kelvin
00141 D[0].fDE=(double*)calloc(ndock,sizeof(double));// Final Docked Energy, kcal/mol [=(1)+(2)]
00142 D[0].fIE=(double*)calloc(ndock,sizeof(double));// (1) Final Intermolecular Energy
00143 D[0].fIEL=(double*)calloc(ndock,sizeof(double));// (2) Final Internal Energy of Ligand
00144 D[0].TFE=(double*)calloc(ndock,sizeof(double));// (3) Torsional Free Energy 
00145 D[0].USE=(double*)calloc(ndock,sizeof(double));// (4) Unbound System's Energy
00146 D[0].M.nrc=ndock;
00147 D[0].M.rc=(coord_3D*)calloc(ndock,sizeof(coord_3D)); // for alt struct mol COM's
00148 D[0].clusterRank=(int*)calloc(ndock,sizeof(int));// Cluster Rank for the corresponding run
00149 for(a=0;a<D[0].M.nr;a++){
00150         D[0].M.r[a].nrc=ndock;
00151         D[0].M.r[a].rc=(coord_3D*)calloc(ndock,sizeof(coord_3D)); // for alt struct res COM's
00152         for(b=0;b<D[0].M.r[a].na;b++){
00153                 D[0].M.r[a].a[b].nalt=ndock;
00154                 D[0].M.r[a].a[b].xa=(coord_3D*)calloc(ndock,sizeof(coord_3D));
00155                 }
00156         }
00157 
00158 //  This part of the function finds the energies for each run, as well as the
00159 //  coordinates for each run, and store it in the dockinfo molecule
00160 di = 0;
00161 while(fgets(line,500,F.F)!=NULL){
00162         if(strstr(line,"FINAL LAMARCKIAN GENETIC ALGORITHM DOCKED STATE")!=NULL){
00163                 //Call functions, based on which version of Autodock, to get energies 
00164                 if(distVer == 3){findAD3Energies(F,D,di);}
00165                 else if(distVer == 4){findAD4Energies(F,D,di);}
00166                 for(a=0; a<sl.n; a++)   //Free up the memory taken up by the fileslurp
00167                         free(sl.L[a]);
00168                 sl.n = 0;
00169                 //Read in lines from the file, extract any info that is here, then
00170                 //dump all of the lines into the fileslurp
00171                 while(strstr(line,"____________________________________________________________________")==NULL){
00172                         fgets(line,500,F.F);
00173                         //First check for possible data
00174                         if((strstr(line,"NEWDPF about")!=NULL)&&(di==0)){
00175                                 sscanf(line,"%s %s %s %s %lf %lf %lf",dum1,dum1,dum1,dum1,\
00176                                         &D[0].RC.i,&D[0].RC.j,&D[0].RC.k); 
00177                         }
00178                         if(strstr(line,"NEWDPF tran0 ")!=NULL){
00179                                 sscanf(line,"%s %s %s %s %lf %lf %lf",dum1,dum1,dum1,dum1,\
00180                                         &D[0].TR[di].i,&D[0].TR[di].j,&D[0].TR[di].k);
00181                         }
00182                         if(strstr(line,"NEWDPF quat0")!=NULL){
00183                                 sscanf(line,"%s %s %s %s %lf %lf %lf %lf",dum1,dum1,dum1,dum1,\
00184                                         &D[0].QN0[di].i,&D[0].QN0[di].j,&D[0].QN0[di].k,&D[0].QN0[di].d); 
00185                         }
00186                         //Then add the line to the fileslurp
00187                         sl.n++;
00188                         sl.L=(char**)realloc(sl.L,sl.n*sizeof(char*));
00189                         sl.L[sl.n-1]=strdup(line);
00190                 }
00191                 //Now Process the fileslurp lines to remove excess information...
00192                 sl = isolateDockedPDB(sl);
00193                 //...and extract the pdb data from it
00194                 alt = load_pdb_from_slurp(sl);
00195                 for(ri = 0; ri < D[0].M.nr; ri++){
00196                         for(ai = 0; ai < D[0].M.r[ri].na; ai++){
00197                                 //For finding the boundaries of the box
00198                                 if(xl>alt.r[ri].a[ai].x.i){xl=alt.r[ri].a[ai].x.i;}
00199                                 if(xh<alt.r[ri].a[ai].x.i){xh=alt.r[ri].a[ai].x.i;}
00200                                 if(yl>alt.r[ri].a[ai].x.j){yl=alt.r[ri].a[ai].x.j;}
00201                                 if(yh<alt.r[ri].a[ai].x.j){yh=alt.r[ri].a[ai].x.j;}
00202                                 if(zl>alt.r[ri].a[ai].x.k){zl=alt.r[ri].a[ai].x.k;}
00203                                 if(zh<alt.r[ri].a[ai].x.k){zh=alt.r[ri].a[ai].x.k;}
00204                                 //Assign the alternate data
00205                                 D[0].M.r[ri].a[ai].xa[di].i=alt.r[ri].a[ai].x.i;
00206                                 D[0].M.r[ri].a[ai].xa[di].j=alt.r[ri].a[ai].x.j;
00207                                 D[0].M.r[ri].a[ai].xa[di].k=alt.r[ri].a[ai].x.k;
00208                                 ti=D[0].M.r[ri].a[ai].t; // for convenience
00209                                 // add to the COM determinations
00210                                 D[0].M.rc[di].i+=D[0].M.r[ri].a[ai].xa[di].i*AT[ti].m; // molecule COM
00211                                 D[0].M.rc[di].j+=D[0].M.r[ri].a[ai].xa[di].j*AT[ti].m;
00212                                 D[0].M.rc[di].k+=D[0].M.r[ri].a[ai].xa[di].k*AT[ti].m;
00213                                 D[0].M.r[ri].rc[di].i+=D[0].M.r[ri].a[ai].xa[di].i*AT[ti].m; // residue COM
00214                                 D[0].M.r[ri].rc[di].j+=D[0].M.r[ri].a[ai].xa[di].j*AT[ti].m;
00215                                 D[0].M.r[ri].rc[di].k+=D[0].M.r[ri].a[ai].xa[di].k*AT[ti].m;
00216 
00217                         }//End loop through atoms
00218                 // also for the residues -- plus record atom number correlation
00219                         D[0].M.r[ri].rc[di].i/=D[0].M.r[ri].m;
00220                         D[0].M.r[ri].rc[di].j/=D[0].M.r[ri].m;
00221                         D[0].M.r[ri].rc[di].k/=D[0].M.r[ri].m;
00222                 }//End loop through residues
00223                 // finish COM calculation for molecule
00224                 D[0].M.rc[di].i/=D[0].M.m;
00225                 D[0].M.rc[di].j/=D[0].M.m;
00226                 D[0].M.rc[di].k/=D[0].M.m;
00227                 deallocateMolecule(&alt);//Free the memory allocated in alt
00228                 di++;                   //and incriment to the next alternate set
00229         }
00230         if(strstr(line,"CLUSTER ANALYSIS OF CONFORMATIONS") != NULL){
00231                 for(a=0; a<sl.n; a++)   //Free all of the data in the fileslurp
00232                         free(sl.L[a]);  //since it isn't used again
00233                 free(sl.L); sl.n = 0;           
00234                 break;
00235         }
00236 }
00237 
00238 //Now deal with all of the state variables
00239 di = 0;//Reset the alternate place holder
00240 while(fgets(line,500,F.F)!=NULL){
00241         if(strstr(line,"STATE VARIABLES:") != NULL){
00242                 while(strstr(line,"Torsions") == NULL){
00243                         fgets(line,500,F.F);
00244                         if(strstr(line,"Quaternion nx,ny,nz,angle")!=NULL){
00245                                 sscanf(line,"%s %s %s %lf %lf %lf %lf",dum1,dum1,dum1,\
00246                                         &D[0].QN[di].i,&D[0].QN[di].j,&D[0].QN[di].k,&D[0].QN[di].d); 
00247                                 }
00248                         if(strstr(line,"Quaternion x,y,z,w ")!=NULL){
00249                                 sscanf(line,"%s %s %s %lf %lf %lf %lf",dum1,dum1,dum1,\
00250                                         &D[0].Q[di].i,&D[0].Q[di].j,&D[0].Q[di].k,&D[0].Q[di].d); 
00251                                 }
00252                 }
00253                 di++;
00254         }
00255         if(strstr(line,"RMSD TABLE") != NULL){
00256                 while(strstr(line,"_____|_") == NULL){
00257                 fgets(line,500,F.F);
00258                 }
00259                 startRanking=1;
00260         }
00261         if(startRanking==1){
00262                 startRanking++;
00263                 fgets(line,500,F.F);
00264                 sscanf(line,"%d %lf %d %lf %lf %lf %s",dumi,dumd,runNum,dumd,dumd,dumd,dum1);
00265                 D[0].clusterRank[runNum[0]-1]=dumi[0];
00266 //printf("load_dlg_mol: 1.) Run %d: Cluster Rank: %d\n",runNum[0],D[0].clusterRank[runNum[0]-1]);
00267                 while(strstr(line,"_______") == NULL){
00268                         fgets(line,500,F.F);
00269                         sscanf(line,"%d %lf %d %lf %lf %lf %s",dumi,dumd,runNum,dumd,dumd,dumd,dum1);
00270                         D[0].clusterRank[runNum[0]-1]=dumi[0];
00271 //printf("load_dlg_mol: 2.) Run %d: Cluster Rank: %d\n",runNum[0],D[0].clusterRank[runNum[0]-1]);
00272                 }
00273         }
00274         }
00275 
00276 /// Add BOX information to the molecule structure.
00277 D[0].M.nBOX=1;
00278 D[0].M.BOX=(boxinfo*)calloc(1,sizeof(boxinfo));
00279 D[0].M.BOX[0].STYPE=strdup("non-periodic");
00280 D[0].M.BOX[0].GTYPE=strdup("rectangular, defined by minimum and maximum x,y,z coordinate values");
00281 D[0].M.BOX[0].nC=D[0].M.BOX[0].nCD=2; 
00282 D[0].M.BOX[0].C=(coord_nD*)calloc(D[0].M.BOX[0].nC,sizeof(coord_nD));
00283 D[0].M.BOX[0].CD=(char**)calloc(D[0].M.BOX[0].nCD,sizeof(char*));
00284 D[0].M.BOX[0].C[0].nD=D[0].M.BOX[0].C[1].nD=3;
00285 D[0].M.BOX[0].C[0].D=(double*)calloc(3,sizeof(double));
00286 D[0].M.BOX[0].C[1].D=(double*)calloc(3,sizeof(double));
00287 D[0].M.BOX[0].CD[0]=strdup("Lowest x, y and z values in the data set.");
00288 D[0].M.BOX[0].C[0].D[0]=xl;
00289 D[0].M.BOX[0].C[0].D[1]=yl;
00290 D[0].M.BOX[0].C[0].D[2]=zl;
00291 D[0].M.BOX[0].CD[1]=strdup("Highest x, y and z values in the data set.");
00292 D[0].M.BOX[0].C[1].D[0]=xh;
00293 D[0].M.BOX[0].C[1].D[1]=yh;
00294 D[0].M.BOX[0].C[1].D[2]=zh;
00295 
00296 if(localdebug==2){dXprint_molecule(&D[0].M,5);}
00297 if(localdebug>2){dXprint_molecule(&D[0].M,150);}
00298 
00299 if(localdebug>1){
00300 printf("Molecule COM (main) is %20.15e %20.15e %20.15e\n",D[0].M.COM.i,D[0].M.COM.j,D[0].M.COM.k);
00301 printf("\tThere are %d alternate COM's:\n",D[0].M.nrc);
00302 for(b=0;b<D[0].M.nrc;b++){
00303 printf("\t\tCOM (alt %d) is %20.15e %20.15e %20.15e\n",b,D[0].M.rc[b].i,D[0].M.rc[b].j,D[0].M.rc[b].k);
00304 }
00305 printf("\tThere are %d Residues:\n",D[0].M.nr); 
00306 for(a=0;a<D[0].M.nr;a++){
00307 printf("\t\tmain COM (RES %d) is %20.15e %20.15e %20.15e\n",a,D[0].M.r[a].COM.i,D[0].M.r[a].COM.j,D[0].M.r[a].COM.k);
00308 }
00309 printf("\t ...each with %d alternate COM's:\n",D[0].M.nrc); 
00310 for(a=0;a<D[0].M.nr;a++){
00311 for(b=0;b<D[0].M.r[a].nrc;b++){
00312 printf("\t\tres %d alt %d : %20.15e %20.15e %20.15e\n",a,b,D[0].M.r[a].rc[b].i,D[0].M.r[a].rc[b].j,D[0].M.r[a].rc[b].k); 
00313 }
00314 }
00315 }
00316 return D;
00317 }
00318 
00319 void findAD3Energies(fileset F,dockinfo* D,int di){
00320 char line[501]; char dum1[50];
00321 fgets(line,500,F.F);
00322 while(strstr(line,"NEWDPF")==NULL){
00323         if(strstr(line,"Estimated Free Energy of Binding ")!=NULL){
00324                 sscanf(line,"%s %s %s %s %s %s %s %s %lf",dum1,dum1,dum1,dum1,\
00325                         dum1,dum1,dum1,dum1,&D[0].eFEB[di]);
00326         }
00327         if(strstr(line,"Estimated Inhibition Constant, Ki")!=NULL){
00328                 sscanf(line,"%s %s %s %s %s %s %s %lf %s %s %lf",dum1,dum1,dum1,dum1,\
00329                         dum1,dum1,dum1,&D[0].eKi[di],dum1,dum1,&D[0].Tmp[di]);
00330         }
00331         if(strstr(line,"Final Docked Energy")!=NULL){
00332                 sscanf(line,"%s %s %s %s %s %s %lf",dum1,dum1,dum1,dum1,dum1,dum1,\
00333                         &D[0].fDE[di]);
00334         }
00335         if(strstr(line,"Final Intermolecular Energy")!=NULL){
00336                 sscanf(line,"%s %s %s %s %s %s %s %lf",dum1,dum1,dum1,dum1,dum1,\
00337                         dum1,dum1,&D[0].fIE[di]);
00338         }
00339         if(strstr(line,"Final Internal Energy of Ligand")!=NULL){
00340                 sscanf(line,"%s %s %s %s %s %s %s %s %s %lf",dum1,dum1,dum1,\
00341                         dum1,dum1,dum1,dum1,dum1,dum1,&D[0].fIEL[di]);
00342         }
00343         if(strstr(line,"Torsional Free Energy")!=NULL){
00344                 sscanf(line,"%s %s %s %s %s %s %s %lf",dum1,dum1,dum1,dum1,\
00345                         dum1,dum1,dum1,&D[0].TFE[di]);
00346         }
00347         fgets(line,500,F.F);
00348 }
00349 return ;
00350 }
00351 
00352 void findAD4Energies(fileset F,dockinfo* D,int di){
00353 char line[501]; char dum1[50];
00354 fgets(line,500,F.F);
00355 while(strstr(line,"NEWDPF")==NULL){
00356         if(strstr(line,"Estimated Free Energy of Binding ")!=NULL){
00357                 sscanf(line,"%s %s %s %s %s %s %s %s %lf",dum1,dum1,dum1,dum1,\
00358                         dum1,dum1,dum1,dum1,&D[0].eFEB[di]);
00359         }
00360         if(strstr(line,"Estimated Inhibition Constant, Ki")!=NULL){
00361                 sscanf(line,"%s %s %s %s %s %s %s %lf %s %s %lf",dum1,dum1,dum1,dum1,\
00362                         dum1,dum1,dum1,&D[0].eKi[di],dum1,dum1,&D[0].Tmp[di]);
00363         }
00364         if(strstr(line,"Final Intermolecular Energy")!=NULL){
00365                 sscanf(line,"%s %s %s %s %s %s %s %lf",dum1,dum1,dum1,dum1,dum1,\
00366                         dum1,dum1,&D[0].fIE[di]);
00367         }
00368         if(strstr(line,"Final Total Internal Energy")!=NULL){
00369                 sscanf(line,"%s %s %s %s %s %s %s %s %lf",dum1,dum1,dum1,\
00370                         dum1,dum1,dum1,dum1,dum1,&D[0].fIEL[di]);
00371         }
00372         if(strstr(line,"Torsional Free Energy")!=NULL){
00373                 sscanf(line,"%s %s %s %s %s %s %s %lf",dum1,dum1,dum1,dum1,\
00374                         dum1,dum1,dum1,&D[0].TFE[di]);
00375         }
00376         if(strstr(line,"Unbound System's Energy")!=NULL){
00377                 sscanf(line,"%s %s %s %s %s %s %s %lf",dum1,dum1,dum1,dum1,dum1,dum1,\
00378                         dum1,&D[0].USE[di]);
00379         }
00380         fgets(line,500,F.F);
00381 }
00382 return ;
00383 }
00384 
 All Classes Files Functions Variables Typedefs Defines