-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
63 lines (52 loc) · 1.66 KB
/
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
#include <iostream>
#include <cstdlib>
#include "constants.h"
#include "linkage_group_DH.h"
#include "genetic_map_DH.h"
#include "genetic_map_RIL.h"
int main (int argc, char * const argv[]) {
if (argc != 3) {
cout << "mstmap v1.0 (2008, University of California, Riverside)" << endl;
cout << "\t Usage: ./mstmap.exe input_file output_file" << endl;
cout << "\t See example.txt for an example input file" << endl;
cout << "\t Questions: email Stefano Lonardi <stelo@cs.ucr.edu>" << endl;
cout << "\t Citation: Y.Wu, P.Bhat, T.J.Close, S.Lonardi" << endl;
cout << "\t\t PLoS Genetics, 4(10):e1000212, 2008." << endl;
cout << "\t\t doi:10.1371/journal.pgen.1000212" << endl;
return 0;
}
ifstream raw_mapping_data_file(argv[1]);
string tmp_str;
string population_type;
raw_mapping_data_file >> tmp_str;
if (tmp_str != "population_type")
{
cout << "ERROR, the input file is invalid" << endl;
assert(false); // crash the program on error
return -1;
}
raw_mapping_data_file >> population_type;
raw_mapping_data_file.close();
genetic_map* barley;
if (population_type == "DH") {
barley = new genetic_map_DH();
} else {
barley = new genetic_map_RIL();
}
barley->read_raw_mapping_data(argv[1]);
/*The algorithm parameter is provided*/
barley->generate_map();
ofstream output_file(argv[2]);
barley->write_output(output_file);
output_file.close();
delete barley;
return 0;
}
void print_vector(vector<int> tmp)
{
for (int ii = 0 ; ii < tmp.size(); ii++)
{
cout << ii << ',' ;
}
cout << endl;
}