forked from rgcgithub/clamms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.h
26 lines (21 loc) · 968 Bytes
/
utils.h
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
#ifndef UTILS_H
#define UTILS_H
#define MAX_CN 6
#define SIGMA_RATIO_CN1 0.707107 // sigma_haploid = this * sigma_diploid
// poisson distribution variance = mean
// so var(hap) = 1/2 var(dip)
#define SIGMA_RATIO_CN3 1.224745
#define SIGMA_RATIO_CN4 1.414214
#define SIGMA_RATIO_CN5 1.581139
#define SIGMA_RATIO_CN6 1.732051
#define HOM_DEL_THRESHOLD -0.98 // if the exponential distribution model for hom del coverage
// is fit by the EM algorithm to have a very small mean,
// it gets replaced by a uniform distribution from -1 to this
void missing_value_error(char *arg);
void invalid_value_error(char *arg);
int double_comp(const void *a, const void *b);
double median(double *arr, int len);
FILE* open_file(char *path);
int count_lines_in_file(FILE *file);
void read_sample_name(char *dest, char *src);
#endif