-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmain.cpp
More file actions
47 lines (40 loc) · 1.29 KB
/
main.cpp
File metadata and controls
47 lines (40 loc) · 1.29 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
#include <iostream>
#include "MbRandom.h"
#include "measure.h"
#include "path.h"
#include "settings.h"
#include "mcmc.h"
#include "popsize.h"
int main (int argc, char * const argv[]) {
settings mySettings(argc, argv);
MbRandom* r = new MbRandom(mySettings.get_seed());
if (mySettings.get_p()) {
mySettings.print();
}
if (mySettings.get_bridge()) {
wfMeasure myWF(r,0);
std::vector<double> pars = mySettings.parse_bridge_pars();
std::cerr << "Creating bridge with (x0, xt, gamma, t) = (" << pars[0] << ", " << pars[1]
<< ", " << pars[2] << ", " << pars[3] << ")" << std::endl;
myWF.set_num_test(mySettings.get_num_test());
myWF.set_gamma(pars[2]);
path* myPath = new path(myWF.fisher(pars[0]),myWF.fisher(pars[1]),0,pars[3],&myWF,mySettings);
myWF.invert_path(myPath);
if (mySettings.get_output_tsv()) {
myPath->print_tsv(std::cout) ;
} else {
myPath->print(std::cout);
}
delete myPath;
} else if (mySettings.get_mcmc()) {
if (mySettings.get_linked()) {
} else {
mcmc myMCMC(mySettings,r);
}
} else {
std::cout << "No task specified" << std::endl;
std::cout << "-b x0,xt,gamma,t for bridge path" << std::endl;
std::cout << "-X x0,x1,...,xn -N n0,n1,...nn -T t0,t1,...tn for mcmc with just allele frequencies" << std::endl;
}
delete r;
}