-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
74 lines (59 loc) · 1.81 KB
/
Copy pathmain.cpp
File metadata and controls
74 lines (59 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
amideImap
Purpose: Calculate amide I frequencies and couplings for specified (labeled) chromophores in a protein.
@author Steven E. Strong
*/
#include "timer.h"
#include "input.h"
#include "groFile.h"
#include "charges.h"
#include "traj.h"
#include "calcFreq.h"
#include "compareHam.h"
#include "compareDipole.h"
#include <cstdio>
#include <string>
//using namespace std;
int main(int argc, const char *argv[])
{
string inputfile="in.amideI"; //default input file
if (argc == 2 || argc == 3)
inputfile=argv[1];
Input input(inputfile);
//if supplied trajfile, override input file
if (argc == 3) {
string trajfile=argv[2];
input.setTrajFile(trajfile);
}
Timer time_entire;
//read files
GroFile gro(input.getGroFile());
Charges charges(input,gro);
Traj traj((input.getTrajFile()).c_str());
printf("Computing Frequencies...\n");
//get indicies of C=O using gro.findCarboxyl(res,num)
vector<int> indC = gro.getChromList(input,4);
//init calcFreq
int nchrom = indC.size();
//use residues as cutoff groups
//CalcFreq calcFreq(nchrom,charges,gro,gro.getResSt(),gro.getNres());
//use charge groups for cutoff
CalcFreq calcFreq(nchrom,charges,gro,charges.getCGst(),
charges.getCG(),charges.getNcg());
//loop through timesteps
CompareHam cmpE(input.getErefFile(),input.getEdiffFile(),nchrom);
CompareDipole cmpD(input.getDrefFile(),input.getDdiffFile(),nchrom);
FILE *fFreq=fopen(input.getEnergyFile().c_str(),"w");
FILE *fDip=fopen(input.getDipoleFile().c_str(),"w");
while(traj.next()==0) {
calcFreq.compute(traj,indC);
calcFreq.print(fFreq,fDip);
cmpE.compare(calcFreq);
cmpD.compare(calcFreq);
}
fclose(fFreq);
fclose(fDip);
string time = time_entire.getDHMS();
printf("Completed in %s\n",time.c_str());
return EXIT_SUCCESS;
};