-
Notifications
You must be signed in to change notification settings - Fork 1
/
dynamic_sim_main.cpp
111 lines (107 loc) · 3.23 KB
/
dynamic_sim_main.cpp
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include <iostream>
#include "simulation.h"
#include <string.h>
using namespace std;
int main(int argc, char* argv[]) {
Simulation sim;
Rloop_dynamic_model model;
bool sandbox = false;
//process command line arguments
sim.set_infile(argv[1]);
sim.set_outfile(argv[2]);
for (int i=3; i<argc; i++) {
if (!strcmp(argv[i], "--a")) {
model.seta(atof(argv[i+1]));
i++;
}
else if (!strcmp(argv[i], "--N")) {
if (!strcmp(argv[i+1],"auto")){
sim.set_auto_domain_size(true);
}
else{
model.setN(atoi(argv[i+1]));
}
i++;
}
else if (!strcmp(argv[i], "--sigma")) {
model.set_superhelicity(atof(argv[i+1]));
i++;
}
else if (!strcmp(argv[i], "--minlength")) {
sim.set_minlength(atoi(argv[i+1]));
i++;
}
else if (!strcmp(argv[i], "--reverse")) {
sim.reverse_input();
}
else if (!strcmp(argv[i], "--complement")) {
sim.complement_input();
}
else if (!strcmp(argv[i], "--invert")) {
sim.complement_input();
sim.reverse_input();
}
else if (!strcmp(argv[i], "--homopolymer")) {
model.set_bp_energy_override(atof(argv[i+1]));
i++;
}
//options specific to ensemble analyzer
else if (!strcmp(argv[i], "--sandbox")) {
sandbox = true;
}
else if (!strcmp(argv[i], "--bedfile")) {
sim.set_bedfile(true);
}
else if (!strcmp(argv[i], "--unconstrained")) {
model.set_unconstrained(true);
}
else if (!strcmp(argv[i], "--circular")) {
sim.set_circular();
}
else if (!strcmp(argv[i], "--residuals")) {
sim.set_residuals(true);
}
else if (!strcmp(argv[i], "--sensitivity")) {
sim.set_power_threshold(atoi(argv[i+1]));
i++;
}
else if (!strcmp(argv[i], "--top")) {
sim.set_top(atoi(argv[i+1]));
i++;
}
else if (!strcmp(argv[i], "--dump")) {
sim.set_dump(true);
}
else if (!strcmp(argv[i], "--localaverageenergy")) {
sim.set_average_g(true);
}
//dynamic model specific parameters
else if (!strcmp(argv[i], "--seed")) {
sim.set_seed(atoi(argv[i+1]));
i++;
}
else if (!strcmp(argv[i], "--initwindow")) {
model.setInitiation_step_size(atoi(argv[i+1]));
i++;
}
else if (!strcmp(argv[i], "--elongwindow")) {
model.setElongation_step_size(atoi(argv[i+1]));
i++;
}
else if (!strcmp(argv[i], "--nsims")) {
model.setNSimulations(atoi(argv[i+1]));
i++;
}
else if (!strcmp(argv[i], "--transcriptionalsh")) {
model.setTranscriptional_superhelicity(atof(argv[i+1]));
i++;
}
else{
cout << "Unrecognized command line option: " << argv[i] << endl;
exit(1);
}
}
sim.add_model(model);
sim.simulation_D();
return 0;
}