1 #ifndef SIM4_H
2 #define SIM4_H
3 
4 /* $Id: sim4.h,v 1.21 2002/01/24 00:56:23 schwartz Exp $ */
5 
6 #define  DEFAULT_NUM_I     3
7 #define  DIST_CUTOFF       3
8 #define  DEFAULT_MIN_COV   (.8)
9 
10 #define  MININT           (-99999)
11 #define  MIN_INTRON        30
12 #define  MAX_INTRON        20000
13 #define  MAX_GRINIT        500
14 #define  MAX_INTERNAL_GAP  50   /* 50 */
15 #define  LL                60
16 
17 #define  DEFAULT_DRANGE    10
18 #define  DEFAULT_WEIGHT    100
19 #define  DEFAULT_RELINK_H  500
20 #define  DEFAULT_W         12
21 #define  DEFAULT_X         12
22 #define  DEFAULT_K         16
23 #define  DEFAULT_C         12
24 #define  LINK              0
25 #define  RELINK            1
26 #define  P                 (.2)
27 
28 #define  min(x,y)        ((x>y) ? (y):(x))
29 #define  max(x,y)        ((x<y) ? (y):(x))
30 #define  START_SIG       ((G_score >= abs(C_score)) ? "GT" : "CT")
31 #define  END_SIG         ((G_score >= abs(C_score)) ? "AG" : "AC")
32 
33 #define  MATCH           1
34 #define  MISMATCH       (-5)
35 #define  L               8
36 
37 #define  DELETE          1
38 #define  INSERT          2
39 #define  SUBSTITUTE      3
40 #define  INTRON          4
41 #define  O_INTRON        5
42 
43 #undef TRUE
44 #undef FALSE
45 enum { FALSE = 0, TRUE = 1};
46 enum { INIT = 0, PERM = 1, TEMP = 2};
47 enum { EST_GEN = 1, GEN_EST = 2 };
48 enum { FWD = 0, BWD = 1, BOTH = 2 };
49 enum { OK = 0, FREE_START = 1, FREE_END = 2, FREE_BOTH_ENDS = 3};
50 
51 /* data structures */
52 
53 /* used in select_path() */
54 typedef struct msp {
55         int len, pos1, pos2;
56         int score;
57         int Score;
58         int  prev;
59         struct msp *next_msp;
60         } *Msp_ptr;
61 
62 typedef struct exon {
63         int  from1, from2, to1, to2;
64         int  min_diag, max_diag;
65         int  match;
66         char ori;
67         int  length;
68         int  flag;
69         int  ematches;
70         int  nmatches;
71         int  edist;
72         int  alen;
73         Msp_ptr msps;
74         struct exon *next_exon;
75         } *Exon_ptr;
76 
77 typedef struct intron {
78         int from1, from2, to1, to2;
79         int  length;
80         char orientation;
81         struct intron *next_intron;
82 } *Intron_ptr, Intron;
83 
84 typedef struct exon   Exon;
85 
86 typedef struct coordinates {
87         int pos1;
88         int pos2;
89 }  coords;
90 
91 /* used only in the alignment stage */
92 typedef struct edit_script {
93         char op_type;   /* SUB, INS, or DEL */
94         int num;        /* Number of operations */
95         struct edit_script *next;
96 } edit_script;
97 
98 typedef struct edit_script_list {
99         int   offset1, offset2;
100         int   len1, len2;
101         int    score;
102         struct edit_script *script;
103         struct edit_script_list *next_script;
104 } edit_script_list;
105 
106 struct edit {
107         struct edit *link;              /* previous edit instruction */
108         char   type[2];
109         int    accumulation;
110         char   op;                      /* INSERT, DELETE or INTRON */
111         int    line1;                   /* line number in file1 */
112         int    line2;                   /* line number in file2 */
113 };
114 
115 typedef  void  *Pointer;
116 
117 typedef  struct ValNode {
118          Pointer      data;
119          struct ValNode *next;
120 } *ValNodePtr;
121 
122 typedef int signal_t[5][5];
123 
124 typedef struct spliced {
125    int xs, xe, ys, ye, score;
126    char type;
127    struct spliced *next;
128 } splice_t;
129 
130 typedef struct sim4_stats {
131    int internal, icoverage, mult, nmatches;
132    double fcoverage, marginals;
133 } sim4_stats_t;
134 
135 typedef struct sim4_args {
136    int ali_flag, poly_flag, acc_flag, reverse, DRANGE, weight, cutoff;
137    int set_K, set_C, set_H;
138    int W, K, C, X, B, CDS_from, CDS_to;
139    char *S;
140 } sim4_args_t;
141 
142 #endif
143