-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathngsF-HMM.hpp
64 lines (56 loc) · 1.39 KB
/
ngsF-HMM.hpp
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
#pragma once
#include "read_data.hpp"
#include "HMM.hpp"
#include "threadpool.h"
#include "bfgs.h"
extern bool SIG_COND;
const uint64_t N_STATES = 2;
extern char const* version;
// Struct to store all input arguments
typedef struct {
char *in_geno;
char *in_pos;
bool in_bin;
bool in_lkl;
bool in_loglkl;
uint64_t n_ind;
uint64_t n_sites;
bool call_geno;
char *in_freq;
int freq_est;
int e_prob_calc;
char *in_indF;
bool indF_fixed;
bool alpha_fixed;
char *out_prefix;
unsigned int log;
bool log_bin;
uint min_iters;
uint max_iters;
double min_epsilon;
uint n_threads;
uint verbose;
uint seed;
double ***geno_lkl; // n_ind * n_sites+1 * N_GENO
double ***geno_lkl_s; // n_sites+1 * n_ind * N_GENO
double *pos_dist; // n_sites+1
double *freq; // n_sites+1
double ***e_prob; // n_ind * n_sites+1 * N_STATES
char **path; // n_ind * n_sites+1
double ***marg_prob; // n_ind * n_sites+1 * N_STATES
double *indF; // n_ind
double *alpha; // n_ind
double *ind_lkl; // n_ind
double prev_tot_lkl;
double tot_lkl;
threadpool_t *thread_pool;
} params;
// parse_args.cpp
void init_pars(params* );
void parse_cmd_args(params*, int, char**);
int init_output(params*);
// EM.cpp
int EM(params*);
void iter_EM(params*);
void print_iter(char*, params*);
void dump_data(gzFile, params*, bool = false);