1 #ifndef DYNAMITEtransregionHEADERFILE 2 #define DYNAMITEtransregionHEADERFILE 3 #ifdef _cplusplus 4 extern "C" { 5 #endif 6 #include "transfactor.h" 7 #include "transregiondp.h" 8 9 #define TransFactorRegionLISTLENGTH 128 10 #define TransFactorRegionSetLISTLENGTH 128 11 12 #define TRANSREGION_PARA_DP 93 13 #define TRANSREGION_PARA_WINDOW 94 14 15 16 17 struct Wise2_TransFactorRegion { 18 int dynamite_hard_link; 19 #ifdef PTHREAD 20 pthread_mutex_t dynamite_mutex; 21 #endif 22 int start; 23 int end; 24 TransFactorMatch ** match; 25 int len;/* len for above match */ 26 int maxlen; /* maxlen for above match */ 27 double density; 28 double bits_score; 29 } ; 30 /* TransFactorRegion defined */ 31 #ifndef DYNAMITE_DEFINED_TransFactorRegion 32 typedef struct Wise2_TransFactorRegion Wise2_TransFactorRegion; 33 #define TransFactorRegion Wise2_TransFactorRegion 34 #define DYNAMITE_DEFINED_TransFactorRegion 35 #endif 36 37 38 struct Wise2_TransFactorRegionSet { 39 int dynamite_hard_link; 40 #ifdef PTHREAD 41 pthread_mutex_t dynamite_mutex; 42 #endif 43 TransFactorRegion ** region; 44 int len;/* len for above region */ 45 int maxlen; /* maxlen for above region */ 46 Sequence * target; 47 } ; 48 /* TransFactorRegionSet defined */ 49 #ifndef DYNAMITE_DEFINED_TransFactorRegionSet 50 typedef struct Wise2_TransFactorRegionSet Wise2_TransFactorRegionSet; 51 #define TransFactorRegionSet Wise2_TransFactorRegionSet 52 #define DYNAMITE_DEFINED_TransFactorRegionSet 53 #endif 54 55 56 struct Wise2_TransFactorRegionPara { 57 int dynamite_hard_link; 58 #ifdef PTHREAD 59 pthread_mutex_t dynamite_mutex; 60 #endif 61 int type; 62 double min_density; 63 int min_window; 64 double in_region_prob; 65 double out_region_prob; 66 double in_cost; 67 int hmm_min_window; 68 double gc_region_ratio; 69 } ; 70 /* TransFactorRegionPara defined */ 71 #ifndef DYNAMITE_DEFINED_TransFactorRegionPara 72 typedef struct Wise2_TransFactorRegionPara Wise2_TransFactorRegionPara; 73 #define TransFactorRegionPara Wise2_TransFactorRegionPara 74 #define DYNAMITE_DEFINED_TransFactorRegionPara 75 #endif 76 77 78 79 80 /***************************************************/ 81 /* Callable functions */ 82 /* These are the functions you are expected to use */ 83 /***************************************************/ 84 85 86 87 /* Function: add_TransFactorRegion(obj,add) 88 * 89 * Descrip: Adds another object to the list. It will expand the list if necessary 90 * 91 * 92 * Arg: obj [UNKN ] Object which contains the list [TransFactorRegion *] 93 * Arg: add [OWNER] Object to add to the list [TransFactorMatch *] 94 * 95 * Return [UNKN ] Undocumented return value [boolean] 96 * 97 */ 98 boolean Wise2_add_TransFactorRegion(TransFactorRegion * obj,TransFactorMatch * add); 99 #define add_TransFactorRegion Wise2_add_TransFactorRegion 100 101 102 /* Function: flush_TransFactorRegion(obj) 103 * 104 * Descrip: Frees the list elements, sets length to 0 105 * If you want to save some elements, use hard_link_xxx 106 * to protect them from being actually destroyed in the free 107 * 108 * 109 * Arg: obj [UNKN ] Object which contains the list [TransFactorRegion *] 110 * 111 * Return [UNKN ] Undocumented return value [int] 112 * 113 */ 114 int Wise2_flush_TransFactorRegion(TransFactorRegion * obj); 115 #define flush_TransFactorRegion Wise2_flush_TransFactorRegion 116 117 118 /* Function: TransFactorRegion_alloc_std(void) 119 * 120 * Descrip: Equivalent to TransFactorRegion_alloc_len(TransFactorRegionLISTLENGTH) 121 * 122 * 123 * 124 * Return [UNKN ] Undocumented return value [TransFactorRegion *] 125 * 126 */ 127 TransFactorRegion * Wise2_TransFactorRegion_alloc_std(void); 128 #define TransFactorRegion_alloc_std Wise2_TransFactorRegion_alloc_std 129 130 131 /* Function: TransFactorRegion_alloc_len(len) 132 * 133 * Descrip: Allocates len length to all lists 134 * 135 * 136 * Arg: len [UNKN ] Length of lists to allocate [int] 137 * 138 * Return [UNKN ] Undocumented return value [TransFactorRegion *] 139 * 140 */ 141 TransFactorRegion * Wise2_TransFactorRegion_alloc_len(int len); 142 #define TransFactorRegion_alloc_len Wise2_TransFactorRegion_alloc_len 143 144 145 /* Function: hard_link_TransFactorRegion(obj) 146 * 147 * Descrip: Bumps up the reference count of the object 148 * Meaning that multiple pointers can 'own' it 149 * 150 * 151 * Arg: obj [UNKN ] Object to be hard linked [TransFactorRegion *] 152 * 153 * Return [UNKN ] Undocumented return value [TransFactorRegion *] 154 * 155 */ 156 TransFactorRegion * Wise2_hard_link_TransFactorRegion(TransFactorRegion * obj); 157 #define hard_link_TransFactorRegion Wise2_hard_link_TransFactorRegion 158 159 160 /* Function: TransFactorRegion_alloc(void) 161 * 162 * Descrip: Allocates structure: assigns defaults if given 163 * 164 * 165 * 166 * Return [UNKN ] Undocumented return value [TransFactorRegion *] 167 * 168 */ 169 TransFactorRegion * Wise2_TransFactorRegion_alloc(void); 170 #define TransFactorRegion_alloc Wise2_TransFactorRegion_alloc 171 172 173 /* Function: free_TransFactorRegion(obj) 174 * 175 * Descrip: Free Function: removes the memory held by obj 176 * Will chain up to owned members and clear all lists 177 * 178 * 179 * Arg: obj [UNKN ] Object that is free'd [TransFactorRegion *] 180 * 181 * Return [UNKN ] Undocumented return value [TransFactorRegion *] 182 * 183 */ 184 TransFactorRegion * Wise2_free_TransFactorRegion(TransFactorRegion * obj); 185 #define free_TransFactorRegion Wise2_free_TransFactorRegion 186 187 188 /* Function: add_TransFactorRegionSet(obj,add) 189 * 190 * Descrip: Adds another object to the list. It will expand the list if necessary 191 * 192 * 193 * Arg: obj [UNKN ] Object which contains the list [TransFactorRegionSet *] 194 * Arg: add [OWNER] Object to add to the list [TransFactorRegion *] 195 * 196 * Return [UNKN ] Undocumented return value [boolean] 197 * 198 */ 199 boolean Wise2_add_TransFactorRegionSet(TransFactorRegionSet * obj,TransFactorRegion * add); 200 #define add_TransFactorRegionSet Wise2_add_TransFactorRegionSet 201 202 203 /* Function: flush_TransFactorRegionSet(obj) 204 * 205 * Descrip: Frees the list elements, sets length to 0 206 * If you want to save some elements, use hard_link_xxx 207 * to protect them from being actually destroyed in the free 208 * 209 * 210 * Arg: obj [UNKN ] Object which contains the list [TransFactorRegionSet *] 211 * 212 * Return [UNKN ] Undocumented return value [int] 213 * 214 */ 215 int Wise2_flush_TransFactorRegionSet(TransFactorRegionSet * obj); 216 #define flush_TransFactorRegionSet Wise2_flush_TransFactorRegionSet 217 218 219 /* Function: TransFactorRegionSet_alloc_std(void) 220 * 221 * Descrip: Equivalent to TransFactorRegionSet_alloc_len(TransFactorRegionSetLISTLENGTH) 222 * 223 * 224 * 225 * Return [UNKN ] Undocumented return value [TransFactorRegionSet *] 226 * 227 */ 228 TransFactorRegionSet * Wise2_TransFactorRegionSet_alloc_std(void); 229 #define TransFactorRegionSet_alloc_std Wise2_TransFactorRegionSet_alloc_std 230 231 232 /* Function: TransFactorRegionSet_alloc_len(len) 233 * 234 * Descrip: Allocates len length to all lists 235 * 236 * 237 * Arg: len [UNKN ] Length of lists to allocate [int] 238 * 239 * Return [UNKN ] Undocumented return value [TransFactorRegionSet *] 240 * 241 */ 242 TransFactorRegionSet * Wise2_TransFactorRegionSet_alloc_len(int len); 243 #define TransFactorRegionSet_alloc_len Wise2_TransFactorRegionSet_alloc_len 244 245 246 /* Function: hard_link_TransFactorRegionSet(obj) 247 * 248 * Descrip: Bumps up the reference count of the object 249 * Meaning that multiple pointers can 'own' it 250 * 251 * 252 * Arg: obj [UNKN ] Object to be hard linked [TransFactorRegionSet *] 253 * 254 * Return [UNKN ] Undocumented return value [TransFactorRegionSet *] 255 * 256 */ 257 TransFactorRegionSet * Wise2_hard_link_TransFactorRegionSet(TransFactorRegionSet * obj); 258 #define hard_link_TransFactorRegionSet Wise2_hard_link_TransFactorRegionSet 259 260 261 /* Function: TransFactorRegionSet_alloc(void) 262 * 263 * Descrip: Allocates structure: assigns defaults if given 264 * 265 * 266 * 267 * Return [UNKN ] Undocumented return value [TransFactorRegionSet *] 268 * 269 */ 270 TransFactorRegionSet * Wise2_TransFactorRegionSet_alloc(void); 271 #define TransFactorRegionSet_alloc Wise2_TransFactorRegionSet_alloc 272 273 274 /* Function: free_TransFactorRegionSet(obj) 275 * 276 * Descrip: Free Function: removes the memory held by obj 277 * Will chain up to owned members and clear all lists 278 * 279 * 280 * Arg: obj [UNKN ] Object that is free'd [TransFactorRegionSet *] 281 * 282 * Return [UNKN ] Undocumented return value [TransFactorRegionSet *] 283 * 284 */ 285 TransFactorRegionSet * Wise2_free_TransFactorRegionSet(TransFactorRegionSet * obj); 286 #define free_TransFactorRegionSet Wise2_free_TransFactorRegionSet 287 288 289 /* Function: hard_link_TransFactorRegionPara(obj) 290 * 291 * Descrip: Bumps up the reference count of the object 292 * Meaning that multiple pointers can 'own' it 293 * 294 * 295 * Arg: obj [UNKN ] Object to be hard linked [TransFactorRegionPara *] 296 * 297 * Return [UNKN ] Undocumented return value [TransFactorRegionPara *] 298 * 299 */ 300 TransFactorRegionPara * Wise2_hard_link_TransFactorRegionPara(TransFactorRegionPara * obj); 301 #define hard_link_TransFactorRegionPara Wise2_hard_link_TransFactorRegionPara 302 303 304 /* Function: TransFactorRegionPara_alloc(void) 305 * 306 * Descrip: Allocates structure: assigns defaults if given 307 * 308 * 309 * 310 * Return [UNKN ] Undocumented return value [TransFactorRegionPara *] 311 * 312 */ 313 TransFactorRegionPara * Wise2_TransFactorRegionPara_alloc(void); 314 #define TransFactorRegionPara_alloc Wise2_TransFactorRegionPara_alloc 315 316 317 /* Function: free_TransFactorRegionPara(obj) 318 * 319 * Descrip: Free Function: removes the memory held by obj 320 * Will chain up to owned members and clear all lists 321 * 322 * 323 * Arg: obj [UNKN ] Object that is free'd [TransFactorRegionPara *] 324 * 325 * Return [UNKN ] Undocumented return value [TransFactorRegionPara *] 326 * 327 */ 328 TransFactorRegionPara * Wise2_free_TransFactorRegionPara(TransFactorRegionPara * obj); 329 #define free_TransFactorRegionPara Wise2_free_TransFactorRegionPara 330 331 332 /* Unplaced functions */ 333 /* There has been no indication of the use of these functions */ 334 void Wise2_show_help_TransFactorRegionPara(FILE * ofp); 335 #define show_help_TransFactorRegionPara Wise2_show_help_TransFactorRegionPara 336 TransFactorRegionPara * Wise2_new_TransFactorRegionPara_from_argv(int * argc,char ** argv); 337 #define new_TransFactorRegionPara_from_argv Wise2_new_TransFactorRegionPara_from_argv 338 void Wise2_show_TransFactorRegionSet(TransFactorRegionSet * tfrs,FILE * ofp); 339 #define show_TransFactorRegionSet Wise2_show_TransFactorRegionSet 340 TransFactorRegionSet * Wise2_new_TransFactorRegionSet(TransFactorMatchSet * tfms,TransFactorRegionPara * tfrp,DPRunImpl * dpri); 341 #define new_TransFactorRegionSet Wise2_new_TransFactorRegionSet 342 TransFactorRegionSet * Wise2_new_dp_TransFactorRegionSet(TransFactorMatchSet * tfms,TransFactorRegionPara * tfrp,DPRunImpl * dpri); 343 #define new_dp_TransFactorRegionSet Wise2_new_dp_TransFactorRegionSet 344 TransFactorRegionSet * Wise2_new_window_TransFactorRegionSet(TransFactorMatchSet * tfms,TransFactorRegionPara * tfrp); 345 #define new_window_TransFactorRegionSet Wise2_new_window_TransFactorRegionSet 346 347 348 /***************************************************/ 349 /* Internal functions */ 350 /* you are not expected to have to call these */ 351 /***************************************************/ 352 void Wise2_swap_TransFactorRegion(TransFactorMatch ** list,int i,int j) ; 353 #define swap_TransFactorRegion Wise2_swap_TransFactorRegion 354 void Wise2_qsort_TransFactorRegion(TransFactorMatch ** list,int left,int right,int (*comp)(TransFactorMatch * ,TransFactorMatch * )); 355 #define qsort_TransFactorRegion Wise2_qsort_TransFactorRegion 356 void Wise2_sort_TransFactorRegion(TransFactorRegion * obj,int (*comp)(TransFactorMatch *, TransFactorMatch *)); 357 #define sort_TransFactorRegion Wise2_sort_TransFactorRegion 358 boolean Wise2_expand_TransFactorRegion(TransFactorRegion * obj,int len); 359 #define expand_TransFactorRegion Wise2_expand_TransFactorRegion 360 void Wise2_swap_TransFactorRegionSet(TransFactorRegion ** list,int i,int j) ; 361 #define swap_TransFactorRegionSet Wise2_swap_TransFactorRegionSet 362 void Wise2_qsort_TransFactorRegionSet(TransFactorRegion ** list,int left,int right,int (*comp)(TransFactorRegion * ,TransFactorRegion * )); 363 #define qsort_TransFactorRegionSet Wise2_qsort_TransFactorRegionSet 364 void Wise2_sort_TransFactorRegionSet(TransFactorRegionSet * obj,int (*comp)(TransFactorRegion *, TransFactorRegion *)); 365 #define sort_TransFactorRegionSet Wise2_sort_TransFactorRegionSet 366 boolean Wise2_expand_TransFactorRegionSet(TransFactorRegionSet * obj,int len); 367 #define expand_TransFactorRegionSet Wise2_expand_TransFactorRegionSet 368 369 #ifdef _cplusplus 370 } 371 #endif 372 373 #endif 374