-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcountn.C
87 lines (69 loc) · 1.92 KB
/
countn.C
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
75
76
77
78
79
80
81
82
83
84
85
86
87
#include <iostream>
#include <string>
#include <cmath>
#include <boost/random.hpp>
#include "omp.h"
#include <vector>
#include "Structure3d.h"
#include "PrincipalComp.h"
#include "ElasticNet.h"
//#include "Matrix.h"
using namespace std;
void help_display(){
cout<<"Help:"<<endl<<
"-f --> input file (required) format .pdb"<<endl<<
"-par --> parameters file (DEFAULT = PARAMS_RIBOGM.DAT)"<<endl<<
"-oname --> output name"<<endl<<
"-h help"<<endl;;
return;
}
int main(int argc, char* argv[]) {
char oname[200];
char file_name[200];
char par_name[200];
int i=1;
int nopar=0;
while(i<argc){
if(!strncmp(argv[i],"-f",2)){
i=i+1;
if(i>argc-1){cout<<"ERROR: empty parameter"<<endl; help_display(); return 0;}
sprintf(file_name,argv[i]);
nopar+=1;
cout<<"will generate a trajectory for the file "<<file_name<<endl;
}
else if(!strncmp(argv[i],"-par",4)){
i=i+1;
if(i>argc-1){cout<<"ERROR: empty parameter"<<endl; return 0;}
sprintf(par_name,argv[i]);
nopar+=1;
cout<<"will read parameters from the file "<<par_name<<endl;
}
else if(!strncmp(argv[i],"-oname",5)){
i=i+1;
if(i>argc-1){cout<<"ERROR: empty parameter"<<endl; return 0;}
sprintf(oname,argv[i]);
nopar+=1;
cout<<"\"My name is "<<oname<<".\""<<endl;
}
else if(!strncmp(argv[i],"-h",2)){
help_display();
return 0;
}
else{
cout<<"WARNING: input n. "<<i<<" "<<argv[i]<<" ---> invalid parameter"<<endl;
}
i=i+1;
}
if(nopar<3){cout<<"ERROR: insufficient number of parameters"<<endl;
help_display;
return 0;
}
ElasticNet ENM;
ENM.readParameters(par_name);
int error=ENM.readPDBFile(file_name);
if(error!=0) {cout<<"ERROR READING THE FILE"<<endl;}// return 0;}
cout<<" contact map..."<<endl;
ENM.constructContactMap();
ENM.dumpNearestNeighbours(oname);
return 0;
}