-
Notifications
You must be signed in to change notification settings - Fork 0
/
ibd_hmm.cpp
45 lines (34 loc) · 1.23 KB
/
ibd_hmm.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
/// headers
#include <iostream>
#include <vector>
#include <map>
#include <time.h>
#include <string>
#include <fstream>
#include <algorithm>
#include <math.h>
using namespace std ;
/// our header files in /src
#include "cmd_line.h"
#include "read_cmd_line.h"
#include "read_input.h"
#include "parameters.h"
#include "viterbi.h"
int main ( int argc, char *argv[] ) {
/// precision
// read cmd line
cmd_line options ;
cerr << "reading command line" << endl ;
options.read_cmd_line( argc, argv ) ;
cerr << "reading input file" << endl ;
string chrom = read_input_file( options.input_file ) ;
cerr << "chromosome length " << chrom.size() << endl ;
/// read in file that has the transition rate per bp ( in windows is okay), or for every bp, also the approximate rate of differences for outbred individuals and the rate for inbred individuals
cerr << "reading parameter file" << endl ;
vector<parameters> params = read_parameter_file( options.parameter_file, options.inbreeding_transition_rate ) ;
cerr << "read " << params.size() << " windows" << endl ;
/// do viterbi
cerr << "computing viterbi inbred/outbred path " << endl ;
viterbi( params, chrom ) ;
return 0 ;
}