1 #ifndef DYNAMITEalnrangeHEADERFILE 2 #define DYNAMITEalnrangeHEADERFILE 3 #ifdef _cplusplus 4 extern "C" { 5 #endif 6 #include "dyna.h" 7 8 #define AlnRangeSetLISTLENGTH 64 9 struct Wise2_AlnRange { 10 int dynamite_hard_link; 11 #ifdef PTHREAD 12 pthread_mutex_t dynamite_mutex; 13 #endif 14 int starti; 15 int startj; 16 int startstate; 17 int stopi; 18 int stopj; 19 int stopstate; 20 int startscore; 21 int stopscore; 22 } ; 23 /* AlnRange defined */ 24 #ifndef DYNAMITE_DEFINED_AlnRange 25 typedef struct Wise2_AlnRange Wise2_AlnRange; 26 #define AlnRange Wise2_AlnRange 27 #define DYNAMITE_DEFINED_AlnRange 28 #endif 29 30 31 struct Wise2_AlnRangeSet { 32 int dynamite_hard_link; 33 #ifdef PTHREAD 34 pthread_mutex_t dynamite_mutex; 35 #endif 36 int score; /* over complete alignment */ 37 AlnRange ** alr; 38 int len;/* len for above alr */ 39 int maxlen; /* maxlen for above alr */ 40 } ; 41 /* AlnRangeSet defined */ 42 #ifndef DYNAMITE_DEFINED_AlnRangeSet 43 typedef struct Wise2_AlnRangeSet Wise2_AlnRangeSet; 44 #define AlnRangeSet Wise2_AlnRangeSet 45 #define DYNAMITE_DEFINED_AlnRangeSet 46 #endif 47 48 49 50 51 /***************************************************/ 52 /* Callable functions */ 53 /* These are the functions you are expected to use */ 54 /***************************************************/ 55 56 57 58 /* Function: show_AlnRangeSet(ars,ofp) 59 * 60 * Descrip: shows AlnRangeSet in vaguely human form 61 * 62 * 63 * Arg: ars [UNKN ] Undocumented argument [AlnRangeSet *] 64 * Arg: ofp [UNKN ] Undocumented argument [FILE *] 65 * 66 */ 67 void Wise2_show_AlnRangeSet(AlnRangeSet * ars,FILE * ofp); 68 #define show_AlnRangeSet Wise2_show_AlnRangeSet 69 70 71 /* Function: show_AlnRange(alr,ofp) 72 * 73 * Descrip: shows AlnRange in vaguely human form 74 * 75 * 76 * Arg: alr [UNKN ] Undocumented argument [AlnRange *] 77 * Arg: ofp [UNKN ] Undocumented argument [FILE *] 78 * 79 */ 80 void Wise2_show_AlnRange(AlnRange * alr,FILE * ofp); 81 #define show_AlnRange Wise2_show_AlnRange 82 83 84 /* Function: sort_AlnRangeSet_by_start(ars) 85 * 86 * Descrip: Sorts an AlnRangeSet by start of each AlnRange 87 * 88 * 89 * Arg: ars [UNKN ] Undocumented argument [AlnRangeSet *] 90 * 91 */ 92 void Wise2_sort_AlnRangeSet_by_start(AlnRangeSet * ars); 93 #define sort_AlnRangeSet_by_start Wise2_sort_AlnRangeSet_by_start 94 95 96 /* Function: hard_link_AlnRange(obj) 97 * 98 * Descrip: Bumps up the reference count of the object 99 * Meaning that multiple pointers can 'own' it 100 * 101 * 102 * Arg: obj [UNKN ] Object to be hard linked [AlnRange *] 103 * 104 * Return [UNKN ] Undocumented return value [AlnRange *] 105 * 106 */ 107 AlnRange * Wise2_hard_link_AlnRange(AlnRange * obj); 108 #define hard_link_AlnRange Wise2_hard_link_AlnRange 109 110 111 /* Function: AlnRange_alloc(void) 112 * 113 * Descrip: Allocates structure: assigns defaults if given 114 * 115 * 116 * 117 * Return [UNKN ] Undocumented return value [AlnRange *] 118 * 119 */ 120 AlnRange * Wise2_AlnRange_alloc(void); 121 #define AlnRange_alloc Wise2_AlnRange_alloc 122 123 124 /* Function: free_AlnRange(obj) 125 * 126 * Descrip: Free Function: removes the memory held by obj 127 * Will chain up to owned members and clear all lists 128 * 129 * 130 * Arg: obj [UNKN ] Object that is free'd [AlnRange *] 131 * 132 * Return [UNKN ] Undocumented return value [AlnRange *] 133 * 134 */ 135 AlnRange * Wise2_free_AlnRange(AlnRange * obj); 136 #define free_AlnRange Wise2_free_AlnRange 137 138 139 /* Function: add_AlnRangeSet(obj,add) 140 * 141 * Descrip: Adds another object to the list. It will expand the list if necessary 142 * 143 * 144 * Arg: obj [UNKN ] Object which contains the list [AlnRangeSet *] 145 * Arg: add [OWNER] Object to add to the list [AlnRange *] 146 * 147 * Return [UNKN ] Undocumented return value [boolean] 148 * 149 */ 150 boolean Wise2_add_AlnRangeSet(AlnRangeSet * obj,AlnRange * add); 151 #define add_AlnRangeSet Wise2_add_AlnRangeSet 152 153 154 /* Function: flush_AlnRangeSet(obj) 155 * 156 * Descrip: Frees the list elements, sets length to 0 157 * If you want to save some elements, use hard_link_xxx 158 * to protect them from being actually destroyed in the free 159 * 160 * 161 * Arg: obj [UNKN ] Object which contains the list [AlnRangeSet *] 162 * 163 * Return [UNKN ] Undocumented return value [int] 164 * 165 */ 166 int Wise2_flush_AlnRangeSet(AlnRangeSet * obj); 167 #define flush_AlnRangeSet Wise2_flush_AlnRangeSet 168 169 170 /* Function: AlnRangeSet_alloc_std(void) 171 * 172 * Descrip: Equivalent to AlnRangeSet_alloc_len(AlnRangeSetLISTLENGTH) 173 * 174 * 175 * 176 * Return [UNKN ] Undocumented return value [AlnRangeSet *] 177 * 178 */ 179 AlnRangeSet * Wise2_AlnRangeSet_alloc_std(void); 180 #define AlnRangeSet_alloc_std Wise2_AlnRangeSet_alloc_std 181 182 183 /* Function: AlnRangeSet_alloc_len(len) 184 * 185 * Descrip: Allocates len length to all lists 186 * 187 * 188 * Arg: len [UNKN ] Length of lists to allocate [int] 189 * 190 * Return [UNKN ] Undocumented return value [AlnRangeSet *] 191 * 192 */ 193 AlnRangeSet * Wise2_AlnRangeSet_alloc_len(int len); 194 #define AlnRangeSet_alloc_len Wise2_AlnRangeSet_alloc_len 195 196 197 /* Function: hard_link_AlnRangeSet(obj) 198 * 199 * Descrip: Bumps up the reference count of the object 200 * Meaning that multiple pointers can 'own' it 201 * 202 * 203 * Arg: obj [UNKN ] Object to be hard linked [AlnRangeSet *] 204 * 205 * Return [UNKN ] Undocumented return value [AlnRangeSet *] 206 * 207 */ 208 AlnRangeSet * Wise2_hard_link_AlnRangeSet(AlnRangeSet * obj); 209 #define hard_link_AlnRangeSet Wise2_hard_link_AlnRangeSet 210 211 212 /* Function: AlnRangeSet_alloc(void) 213 * 214 * Descrip: Allocates structure: assigns defaults if given 215 * 216 * 217 * 218 * Return [UNKN ] Undocumented return value [AlnRangeSet *] 219 * 220 */ 221 AlnRangeSet * Wise2_AlnRangeSet_alloc(void); 222 #define AlnRangeSet_alloc Wise2_AlnRangeSet_alloc 223 224 225 /* Function: free_AlnRangeSet(obj) 226 * 227 * Descrip: Free Function: removes the memory held by obj 228 * Will chain up to owned members and clear all lists 229 * 230 * 231 * Arg: obj [UNKN ] Object that is free'd [AlnRangeSet *] 232 * 233 * Return [UNKN ] Undocumented return value [AlnRangeSet *] 234 * 235 */ 236 AlnRangeSet * Wise2_free_AlnRangeSet(AlnRangeSet * obj); 237 #define free_AlnRangeSet Wise2_free_AlnRangeSet 238 239 240 /* Unplaced functions */ 241 /* There has been no indication of the use of these functions */ 242 243 244 /***************************************************/ 245 /* Internal functions */ 246 /* you are not expected to have to call these */ 247 /***************************************************/ 248 boolean Wise2_replace_starti_AlnRange(AlnRange * obj,int starti); 249 #define replace_starti_AlnRange Wise2_replace_starti_AlnRange 250 int Wise2_access_stopi_AlnRange(AlnRange * obj); 251 #define access_stopi_AlnRange Wise2_access_stopi_AlnRange 252 boolean Wise2_replace_stopj_AlnRange(AlnRange * obj,int stopj); 253 #define replace_stopj_AlnRange Wise2_replace_stopj_AlnRange 254 int Wise2_access_stopj_AlnRange(AlnRange * obj); 255 #define access_stopj_AlnRange Wise2_access_stopj_AlnRange 256 AlnRange * Wise2_access_alr_AlnRangeSet(AlnRangeSet * obj,int i); 257 #define access_alr_AlnRangeSet Wise2_access_alr_AlnRangeSet 258 boolean Wise2_replace_stopstate_AlnRange(AlnRange * obj,int stopstate); 259 #define replace_stopstate_AlnRange Wise2_replace_stopstate_AlnRange 260 boolean Wise2_replace_startj_AlnRange(AlnRange * obj,int startj); 261 #define replace_startj_AlnRange Wise2_replace_startj_AlnRange 262 int Wise2_access_stopstate_AlnRange(AlnRange * obj); 263 #define access_stopstate_AlnRange Wise2_access_stopstate_AlnRange 264 boolean Wise2_replace_startstate_AlnRange(AlnRange * obj,int startstate); 265 #define replace_startstate_AlnRange Wise2_replace_startstate_AlnRange 266 boolean Wise2_replace_startscore_AlnRange(AlnRange * obj,int startscore); 267 #define replace_startscore_AlnRange Wise2_replace_startscore_AlnRange 268 boolean Wise2_replace_stopi_AlnRange(AlnRange * obj,int stopi); 269 #define replace_stopi_AlnRange Wise2_replace_stopi_AlnRange 270 int Wise2_access_startscore_AlnRange(AlnRange * obj); 271 #define access_startscore_AlnRange Wise2_access_startscore_AlnRange 272 int Wise2_access_starti_AlnRange(AlnRange * obj); 273 #define access_starti_AlnRange Wise2_access_starti_AlnRange 274 boolean Wise2_replace_stopscore_AlnRange(AlnRange * obj,int stopscore); 275 #define replace_stopscore_AlnRange Wise2_replace_stopscore_AlnRange 276 int Wise2_access_startstate_AlnRange(AlnRange * obj); 277 #define access_startstate_AlnRange Wise2_access_startstate_AlnRange 278 int Wise2_access_stopscore_AlnRange(AlnRange * obj); 279 #define access_stopscore_AlnRange Wise2_access_stopscore_AlnRange 280 int Wise2_access_startj_AlnRange(AlnRange * obj); 281 #define access_startj_AlnRange Wise2_access_startj_AlnRange 282 boolean Wise2_replace_score_AlnRangeSet(AlnRangeSet * obj,int score); 283 #define replace_score_AlnRangeSet Wise2_replace_score_AlnRangeSet 284 int Wise2_length_alr_AlnRangeSet(AlnRangeSet * obj); 285 #define length_alr_AlnRangeSet Wise2_length_alr_AlnRangeSet 286 int Wise2_access_score_AlnRangeSet(AlnRangeSet * obj); 287 #define access_score_AlnRangeSet Wise2_access_score_AlnRangeSet 288 int Wise2_compare_AlnRange_start(AlnRange * one,AlnRange * two); 289 #define compare_AlnRange_start Wise2_compare_AlnRange_start 290 void Wise2_swap_AlnRangeSet(AlnRange ** list,int i,int j) ; 291 #define swap_AlnRangeSet Wise2_swap_AlnRangeSet 292 void Wise2_qsort_AlnRangeSet(AlnRange ** list,int left,int right,int (*comp)(AlnRange * ,AlnRange * )); 293 #define qsort_AlnRangeSet Wise2_qsort_AlnRangeSet 294 void Wise2_sort_AlnRangeSet(AlnRangeSet * obj,int (*comp)(AlnRange *, AlnRange *)); 295 #define sort_AlnRangeSet Wise2_sort_AlnRangeSet 296 boolean Wise2_expand_AlnRangeSet(AlnRangeSet * obj,int len); 297 #define expand_AlnRangeSet Wise2_expand_AlnRangeSet 298 299 #ifdef _cplusplus 300 } 301 #endif 302 303 #endif 304