File: seqerror.h

package info (click to toggle)
wise 2.4.1-21
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 27,140 kB
  • sloc: ansic: 276,365; makefile: 1,003; perl: 886; lex: 93; yacc: 81; sh: 24
file content (370 lines) | stat: -rw-r--r-- 10,494 bytes parent folder | download
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
#ifndef DYNAMITEseqerrorHEADERFILE
#define DYNAMITEseqerrorHEADERFILE
#ifdef _cplusplus
extern "C" {
#endif
#include "wisebase.h"
#include "probability.h"
#include "aln.h"
#include "sequence.h"

enum SeqErrorType {
  SeqErrorInsertion,
  SeqErrorDeletion,
  SeqErrorSubstitution
};

#define SequenceErrorSetLISTLENGTH 128

/* Object SequenceError
 *
 * Descrip: This holds information about
 *        a particular insertion or
 *        deletion for one sequence
 *
 *
 */
struct Wise2_SequenceError {  
    int dynamite_hard_link;  
#ifdef PTHREAD   
    pthread_mutex_t dynamite_mutex;  
#endif   
    int type;    
    int start;   
    int end;     
    char * replaced_bases;   
    Probability probability;     
    char * inserted_bases;   
    char * suspected_deletion;   
    } ;  
/* SequenceError defined */ 
#ifndef DYNAMITE_DEFINED_SequenceError
typedef struct Wise2_SequenceError Wise2_SequenceError;
#define SequenceError Wise2_SequenceError
#define DYNAMITE_DEFINED_SequenceError
#endif


/* Object SequenceErrorSet
 *
 * Descrip: This holds a set of insertion
 *        or deletions for a sequence
 *
 *
 */
struct Wise2_SequenceErrorSet {  
    int dynamite_hard_link;  
#ifdef PTHREAD   
    pthread_mutex_t dynamite_mutex;  
#endif   
    SequenceError ** error;  
    int len;/* len for above error  */ 
    int maxlen; /* maxlen for above error */ 
    } ;  
/* SequenceErrorSet defined */ 
#ifndef DYNAMITE_DEFINED_SequenceErrorSet
typedef struct Wise2_SequenceErrorSet Wise2_SequenceErrorSet;
#define SequenceErrorSet Wise2_SequenceErrorSet
#define DYNAMITE_DEFINED_SequenceErrorSet
#endif


/* Object ErrorSequence
 *
 * Descrip: This holds a sequence and what
 *        errors have occurred in it.
 *
 *
 */
struct Wise2_ErrorSequence {  
    int dynamite_hard_link;  
#ifdef PTHREAD   
    pthread_mutex_t dynamite_mutex;  
#endif   
    Sequence * seq;  
    SequenceErrorSet * ses;  
    } ;  
/* ErrorSequence defined */ 
#ifndef DYNAMITE_DEFINED_ErrorSequence
typedef struct Wise2_ErrorSequence Wise2_ErrorSequence;
#define ErrorSequence Wise2_ErrorSequence
#define DYNAMITE_DEFINED_ErrorSequence
#endif




    /***************************************************/
    /* Callable functions                              */
    /* These are the functions you are expected to use */
    /***************************************************/



/* Function:  genewise_SequenceErrorSet(als)
 *
 * Descrip:    Makes a sequence error set from standard genewise labels
 *
 *
 * Arg:        als [UNKN ] Undocumented argument [AlnSequence *]
 *
 * Return [UNKN ]  Undocumented return value [SequenceErrorSet *]
 *
 */
SequenceErrorSet * Wise2_genewise_SequenceErrorSet(AlnSequence * als );
#define genewise_SequenceErrorSet Wise2_genewise_SequenceErrorSet


/* Function:  show_SequenceErrorSet(ses,ofp)
 *
 * Descrip:    Displays a set of sequence errors in space deliminted format
 *
 *
 * Arg:        ses [UNKN ] Undocumented argument [SequenceErrorSet *]
 * Arg:        ofp [UNKN ] Undocumented argument [FILE *]
 *
 */
void Wise2_show_SequenceErrorSet(SequenceErrorSet * ses,FILE * ofp);
#define show_SequenceErrorSet Wise2_show_SequenceErrorSet


/* Function:  show_SequenceError(se,ofp)
 *
 * Descrip:    Displays sequence error in space deliminted format
 *
 *
 * Arg:         se [UNKN ] Undocumented argument [SequenceError *]
 * Arg:        ofp [UNKN ] Undocumented argument [FILE *]
 *
 */
void Wise2_show_SequenceError(SequenceError * se,FILE * ofp);
#define show_SequenceError Wise2_show_SequenceError


/* Function:  make_ErrorSequence(seq,subs,insertion,deletion)
 *
 * Descrip:    Makes an error sequence (DNA) with set substitution
 *             and insertion/deletion rates.
 *
 *
 * Arg:              seq [UNKN ] Undocumented argument [Sequence *]
 * Arg:             subs [UNKN ] Undocumented argument [Probability]
 * Arg:        insertion [UNKN ] Undocumented argument [Probability]
 * Arg:         deletion [UNKN ] Undocumented argument [Probability]
 *
 * Return [UNKN ]  Undocumented return value [ErrorSequence *]
 *
 */
ErrorSequence * Wise2_make_ErrorSequence(Sequence * seq,Probability subs,Probability insertion,Probability deletion);
#define make_ErrorSequence Wise2_make_ErrorSequence


/* Function:  hard_link_SequenceError(obj)
 *
 * Descrip:    Bumps up the reference count of the object
 *             Meaning that multiple pointers can 'own' it
 *
 *
 * Arg:        obj [UNKN ] Object to be hard linked [SequenceError *]
 *
 * Return [UNKN ]  Undocumented return value [SequenceError *]
 *
 */
SequenceError * Wise2_hard_link_SequenceError(SequenceError * obj);
#define hard_link_SequenceError Wise2_hard_link_SequenceError


/* Function:  SequenceError_alloc(void)
 *
 * Descrip:    Allocates structure: assigns defaults if given 
 *
 *
 *
 * Return [UNKN ]  Undocumented return value [SequenceError *]
 *
 */
SequenceError * Wise2_SequenceError_alloc(void);
#define SequenceError_alloc Wise2_SequenceError_alloc


/* Function:  free_SequenceError(obj)
 *
 * Descrip:    Free Function: removes the memory held by obj
 *             Will chain up to owned members and clear all lists
 *
 *
 * Arg:        obj [UNKN ] Object that is free'd [SequenceError *]
 *
 * Return [UNKN ]  Undocumented return value [SequenceError *]
 *
 */
SequenceError * Wise2_free_SequenceError(SequenceError * obj);
#define free_SequenceError Wise2_free_SequenceError


/* Function:  add_SequenceErrorSet(obj,add)
 *
 * Descrip:    Adds another object to the list. It will expand the list if necessary
 *
 *
 * Arg:        obj [UNKN ] Object which contains the list [SequenceErrorSet *]
 * Arg:        add [OWNER] Object to add to the list [SequenceError *]
 *
 * Return [UNKN ]  Undocumented return value [boolean]
 *
 */
boolean Wise2_add_SequenceErrorSet(SequenceErrorSet * obj,SequenceError * add);
#define add_SequenceErrorSet Wise2_add_SequenceErrorSet


/* Function:  flush_SequenceErrorSet(obj)
 *
 * Descrip:    Frees the list elements, sets length to 0
 *             If you want to save some elements, use hard_link_xxx
 *             to protect them from being actually destroyed in the free
 *
 *
 * Arg:        obj [UNKN ] Object which contains the list  [SequenceErrorSet *]
 *
 * Return [UNKN ]  Undocumented return value [int]
 *
 */
int Wise2_flush_SequenceErrorSet(SequenceErrorSet * obj);
#define flush_SequenceErrorSet Wise2_flush_SequenceErrorSet


/* Function:  SequenceErrorSet_alloc_std(void)
 *
 * Descrip:    Equivalent to SequenceErrorSet_alloc_len(SequenceErrorSetLISTLENGTH)
 *
 *
 *
 * Return [UNKN ]  Undocumented return value [SequenceErrorSet *]
 *
 */
SequenceErrorSet * Wise2_SequenceErrorSet_alloc_std(void);
#define SequenceErrorSet_alloc_std Wise2_SequenceErrorSet_alloc_std


/* Function:  SequenceErrorSet_alloc_len(len)
 *
 * Descrip:    Allocates len length to all lists
 *
 *
 * Arg:        len [UNKN ] Length of lists to allocate [int]
 *
 * Return [UNKN ]  Undocumented return value [SequenceErrorSet *]
 *
 */
SequenceErrorSet * Wise2_SequenceErrorSet_alloc_len(int len);
#define SequenceErrorSet_alloc_len Wise2_SequenceErrorSet_alloc_len


/* Function:  hard_link_SequenceErrorSet(obj)
 *
 * Descrip:    Bumps up the reference count of the object
 *             Meaning that multiple pointers can 'own' it
 *
 *
 * Arg:        obj [UNKN ] Object to be hard linked [SequenceErrorSet *]
 *
 * Return [UNKN ]  Undocumented return value [SequenceErrorSet *]
 *
 */
SequenceErrorSet * Wise2_hard_link_SequenceErrorSet(SequenceErrorSet * obj);
#define hard_link_SequenceErrorSet Wise2_hard_link_SequenceErrorSet


/* Function:  SequenceErrorSet_alloc(void)
 *
 * Descrip:    Allocates structure: assigns defaults if given 
 *
 *
 *
 * Return [UNKN ]  Undocumented return value [SequenceErrorSet *]
 *
 */
SequenceErrorSet * Wise2_SequenceErrorSet_alloc(void);
#define SequenceErrorSet_alloc Wise2_SequenceErrorSet_alloc


/* Function:  free_SequenceErrorSet(obj)
 *
 * Descrip:    Free Function: removes the memory held by obj
 *             Will chain up to owned members and clear all lists
 *
 *
 * Arg:        obj [UNKN ] Object that is free'd [SequenceErrorSet *]
 *
 * Return [UNKN ]  Undocumented return value [SequenceErrorSet *]
 *
 */
SequenceErrorSet * Wise2_free_SequenceErrorSet(SequenceErrorSet * obj);
#define free_SequenceErrorSet Wise2_free_SequenceErrorSet


/* Function:  hard_link_ErrorSequence(obj)
 *
 * Descrip:    Bumps up the reference count of the object
 *             Meaning that multiple pointers can 'own' it
 *
 *
 * Arg:        obj [UNKN ] Object to be hard linked [ErrorSequence *]
 *
 * Return [UNKN ]  Undocumented return value [ErrorSequence *]
 *
 */
ErrorSequence * Wise2_hard_link_ErrorSequence(ErrorSequence * obj);
#define hard_link_ErrorSequence Wise2_hard_link_ErrorSequence


/* Function:  ErrorSequence_alloc(void)
 *
 * Descrip:    Allocates structure: assigns defaults if given 
 *
 *
 *
 * Return [UNKN ]  Undocumented return value [ErrorSequence *]
 *
 */
ErrorSequence * Wise2_ErrorSequence_alloc(void);
#define ErrorSequence_alloc Wise2_ErrorSequence_alloc


/* Function:  free_ErrorSequence(obj)
 *
 * Descrip:    Free Function: removes the memory held by obj
 *             Will chain up to owned members and clear all lists
 *
 *
 * Arg:        obj [UNKN ] Object that is free'd [ErrorSequence *]
 *
 * Return [UNKN ]  Undocumented return value [ErrorSequence *]
 *
 */
ErrorSequence * Wise2_free_ErrorSequence(ErrorSequence * obj);
#define free_ErrorSequence Wise2_free_ErrorSequence


  /* Unplaced functions */
  /* There has been no indication of the use of these functions */


    /***************************************************/
    /* Internal functions                              */
    /* you are not expected to have to call these      */
    /***************************************************/
void Wise2_swap_SequenceErrorSet(SequenceError ** list,int i,int j) ;
#define swap_SequenceErrorSet Wise2_swap_SequenceErrorSet
void Wise2_qsort_SequenceErrorSet(SequenceError ** list,int left,int right,int (*comp)(SequenceError * ,SequenceError * ));
#define qsort_SequenceErrorSet Wise2_qsort_SequenceErrorSet
void Wise2_sort_SequenceErrorSet(SequenceErrorSet * obj,int (*comp)(SequenceError *, SequenceError *));
#define sort_SequenceErrorSet Wise2_sort_SequenceErrorSet
boolean Wise2_expand_SequenceErrorSet(SequenceErrorSet * obj,int len);
#define expand_SequenceErrorSet Wise2_expand_SequenceErrorSet

#ifdef _cplusplus
}
#endif

#endif