-
Notifications
You must be signed in to change notification settings - Fork 5
/
hmm.h
75 lines (59 loc) · 1.58 KB
/
hmm.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
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
65
66
67
68
69
70
71
72
73
74
75
#define ADD
#define LONG
#define ENDTRANS
#define NCSTATE
#include <stdbool.h>
// Stuff originally in trim.h
#define addLogProb(x,y) ( (y) > (x) ) ? ((y) += log(1 + exp((x)-(y)))) : ((y)=(x)+log(1 + exp((y)-(x))))
#define MAX_LINE_LEN 2000
#define MAX_FILENAME_LEN 80
#define N_BASES 4
#define N_PEPT 20
#define MAX_LABEL_LEN 20
void error(char *fmt, ... );
EXTERN int Nseq;
EXTERN char **align;
EXTERN char **sequence;
EXTERN char **names;
EXTERN int *lens;
EXTERN int alen;
EXTERN double TOT_DIST;
EXTERN double **dists;
EXTERN int uguide; // User provided guide tree
EXTERN char guidetree[200];
int pep2num(char c);
// Original content
EXTERN double initDistribDefault[];
EXTERN int NUMSTATE;
#ifndef LONG
EXTERN double gapOpenDefault;
EXTERN double gapExtendDefault;
#else
EXTERN double gapOpenDefault;
EXTERN double gapOpenDefaultL;
EXTERN double gapExtendDefault;
EXTERN double gapExtendDefaultL;
#endif
EXTERN double selfM;
EXTERN double MtoXY;
EXTERN double selfXY;
EXTERN double XYtoM;
#ifdef LONG
EXTERN double MtoXYL;
EXTERN double selfXYL;
EXTERN double XYLtoM;
#endif
#ifdef NCSTATE
EXTERN double MtoC;
EXTERN double NtoM;
EXTERN double selfN;
EXTERN double selfC;
#endif
EXTERN double emitSingleDefault[20];
EXTERN double emitPairsDefault[20][20];
void initHMM(int len);
void calc_posterior(int len);
// Simon's functions
bool SimonGetPosteriors(int len, double **retPosteriors, bool doApprox, int ApproxSize);
bool SimonGetSubsetPosteriors(int len, double **retPosteriors, int **runList, int runListLength, bool doApprox, int ApproxSize);
bool MakePosteriors(int X, int Y, bool doApprox);