1 #ifndef DYNAMITEthreestatemodelHEADERFILE 2 #define DYNAMITEthreestatemodelHEADERFILE 3 #ifdef _cplusplus 4 extern "C" { 5 #endif 6 7 #include "dyna.h" 8 #include "randommodel.h" 9 10 #define ThreeStateModelLISTLENGTH 128 11 #define ThreeStateScoreLISTLENGTH 128 12 13 enum tsm_trans_type { 14 TSM_MATCH2MATCH = 0, 15 TSM_MATCH2INSERT, 16 TSM_MATCH2DELETE, 17 TSM_INSERT2MATCH, 18 TSM_INSERT2INSERT, 19 TSM_INSERT2DELETE, 20 TSM_DELETE2MATCH, 21 TSM_DELETE2INSERT, 22 TSM_DELETE2DELETE, 23 TSM_START2MATCH, 24 TSM_START2INSERT, 25 TSM_START2DELETE, 26 TSM_MATCH2END, 27 TSM_INSERT2END, 28 TSM_DELETE2END }; 29 30 #define TRANSITION_LEN 15 31 32 #define BLANK_SCORE (-10000000) 33 34 extern char * std_alphabet; 35 #define ALPHABET_SIZE 26 36 37 typedef enum TSM_StartEndMode { 38 TSM_unknown = 26, 39 TSM_default, 40 TSM_local, 41 TSM_global, 42 TSM_wing, 43 TSM_endbiased 44 } TSM_StartEndMode; 45 46 47 /* Object ThreeStateUnit 48 * 49 * Descrip: This object is the probability version 50 * of hte common unit to profile HMMs, ie 51 * the match,insert,delete triple 52 * 53 * 54 */ 55 struct Wise2_ThreeStateUnit { 56 int dynamite_hard_link; 57 #ifdef PTHREAD 58 pthread_mutex_t dynamite_mutex; 59 #endif 60 Probability match_emission[ALPHABET_SIZE]; 61 Probability insert_emission[ALPHABET_SIZE]; 62 Probability transition[TRANSITION_LEN]; 63 char display_char; 64 } ; 65 /* ThreeStateUnit defined */ 66 #ifndef DYNAMITE_DEFINED_ThreeStateUnit 67 typedef struct Wise2_ThreeStateUnit Wise2_ThreeStateUnit; 68 #define ThreeStateUnit Wise2_ThreeStateUnit 69 #define DYNAMITE_DEFINED_ThreeStateUnit 70 #endif 71 72 73 /* Object ThreeStateModel 74 * 75 * Descrip: This is profile-HMM object, similar to the 76 * SAM and HMMer plan9 architecture. 77 * 78 * 79 */ 80 struct Wise2_ThreeStateModel { 81 int dynamite_hard_link; 82 #ifdef PTHREAD 83 pthread_mutex_t dynamite_mutex; 84 #endif 85 char * name; /* name of the model */ 86 ThreeStateUnit ** unit; /* the actuall three state probs and emissions */ 87 int len;/* len for above unit */ 88 int maxlen; /* maxlen for above unit */ 89 char * alphabet; /* alphabet used */ 90 char * accession; /* accession number */ 91 double threshold; /* bits threshold (if sensible) */ 92 RandomModel * rm; /* Random model for the model: maybe NULL! */ 93 } ; 94 /* ThreeStateModel defined */ 95 #ifndef DYNAMITE_DEFINED_ThreeStateModel 96 typedef struct Wise2_ThreeStateModel Wise2_ThreeStateModel; 97 #define ThreeStateModel Wise2_ThreeStateModel 98 #define DYNAMITE_DEFINED_ThreeStateModel 99 #endif 100 101 102 /* Object ThreeStateScoreUnit 103 * 104 * Descrip: This is the Score (ie , log-odded) 105 * version of the ThreeStateUnit 106 * 107 * 108 */ 109 struct Wise2_ThreeStateScoreUnit { 110 int dynamite_hard_link; 111 #ifdef PTHREAD 112 pthread_mutex_t dynamite_mutex; 113 #endif 114 Score match[ALPHABET_SIZE]; 115 Score insert[ALPHABET_SIZE]; 116 Score trans[TRANSITION_LEN]; 117 } ; 118 /* ThreeStateScoreUnit defined */ 119 #ifndef DYNAMITE_DEFINED_ThreeStateScoreUnit 120 typedef struct Wise2_ThreeStateScoreUnit Wise2_ThreeStateScoreUnit; 121 #define ThreeStateScoreUnit Wise2_ThreeStateScoreUnit 122 #define DYNAMITE_DEFINED_ThreeStateScoreUnit 123 #endif 124 125 126 /* Object ThreeStateScore 127 * 128 * Descrip: This is hte score version of the 129 * ThreeStateModel, ie this has its 130 * emissions and transitions log-odded 131 * 132 * 133 */ 134 struct Wise2_ThreeStateScore { 135 int dynamite_hard_link; 136 #ifdef PTHREAD 137 pthread_mutex_t dynamite_mutex; 138 #endif 139 ThreeStateScoreUnit ** unit; 140 int len;/* len for above unit */ 141 int maxlen; /* maxlen for above unit */ 142 char * name; 143 char * accession; 144 } ; 145 /* ThreeStateScore defined */ 146 #ifndef DYNAMITE_DEFINED_ThreeStateScore 147 typedef struct Wise2_ThreeStateScore Wise2_ThreeStateScore; 148 #define ThreeStateScore Wise2_ThreeStateScore 149 #define DYNAMITE_DEFINED_ThreeStateScore 150 #endif 151 152 153 154 155 /***************************************************/ 156 /* Callable functions */ 157 /* These are the functions you are expected to use */ 158 /***************************************************/ 159 160 161 162 /* Function: information_from_ThreeStateUnit(tsu,rm) 163 * 164 * Descrip: Gets the information content (K-L divergence) vs a background for a position 165 * 166 * 167 * Arg: tsu [UNKN ] Undocumented argument [ThreeStateUnit *] 168 * Arg: rm [UNKN ] Undocumented argument [RandomModel *] 169 * 170 * Return [UNKN ] Undocumented return value [double] 171 * 172 */ 173 double Wise2_information_from_ThreeStateUnit(ThreeStateUnit * tsu,RandomModel * rm); 174 #define information_from_ThreeStateUnit Wise2_information_from_ThreeStateUnit 175 176 177 /* Function: threestatemodel_mode_from_string(mode) 178 * 179 * Descrip: gets out the mode from a string 180 * 181 * 182 * Arg: mode [UNKN ] Undocumented argument [char *] 183 * 184 * Return [UNKN ] Undocumented return value [int] 185 * 186 */ 187 int Wise2_threestatemodel_mode_from_string(char * mode); 188 #define threestatemodel_mode_from_string Wise2_threestatemodel_mode_from_string 189 190 191 /* Function: set_startend_policy_ThreeStateModel(tsm,mode,wing_length,internal_bias) 192 * 193 * Descrip: Sets the start/end policy on the basis of the mode 194 * 195 * 196 * Arg: tsm [UNKN ] Undocumented argument [ThreeStateModel *] 197 * Arg: mode [UNKN ] Undocumented argument [TSM_StartEndMode] 198 * Arg: wing_length [UNKN ] Undocumented argument [int] 199 * Arg: internal_bias [UNKN ] Undocumented argument [Probability] 200 * 201 */ 202 void Wise2_set_startend_policy_ThreeStateModel(ThreeStateModel * tsm,TSM_StartEndMode mode,int wing_length,Probability internal_bias); 203 #define set_startend_policy_ThreeStateModel Wise2_set_startend_policy_ThreeStateModel 204 205 206 /* Function: force_endbias_model(tsm,startend,internal) 207 * 208 * Descrip: Makes start/end on probability and 209 * internal another 210 * 211 * not probabilistically correct 212 * 213 * 214 * Arg: tsm [UNKN ] Undocumented argument [ThreeStateModel *] 215 * Arg: startend [UNKN ] Undocumented argument [double] 216 * Arg: internal [UNKN ] Undocumented argument [double] 217 * 218 */ 219 void Wise2_force_endbias_model(ThreeStateModel * tsm,double startend,double internal); 220 #define force_endbias_model Wise2_force_endbias_model 221 222 223 /* Function: force_global_model(tsm,prob_into_model) 224 * 225 * Descrip: Makes start at position 0 and end at position end, 226 * no other positions being valid 227 * 228 * 229 * 230 * Arg: tsm [UNKN ] ThreeStateModel to be 'forced' [ThreeStateModel *] 231 * Arg: prob_into_model [UNKN ] Probability to start the model: for true global will be 1.0 [double] 232 * 233 */ 234 void Wise2_force_global_model(ThreeStateModel * tsm,double prob_into_model) ; 235 #define force_global_model Wise2_force_global_model 236 237 238 /* Function: force_wing_local_model(tsm,terminus_prob,wing_length) 239 * 240 * Descrip: Places the balanace of the start probability 241 * at the start and then the rest spread evenly 242 * descending over the wing stretch of sequences 243 * 244 * Same with the end probability 245 * 246 * 247 * Arg: tsm [UNKN ] Undocumented argument [ThreeStateModel *] 248 * Arg: terminus_prob [UNKN ] the amount of probability to put on the real start and end [double] 249 * Arg: wing_length [UNKN ] the rest of the probability spread over this distance into the wing [int] 250 * 251 */ 252 void Wise2_force_wing_local_model(ThreeStateModel * tsm,double terminus_prob,int wing_length); 253 #define force_wing_local_model Wise2_force_wing_local_model 254 255 256 /* Function: force_weighted_local_model(tsm,prob_into_model,ratio_start,ratio_end) 257 * 258 * Descrip: places the ratio of probability to start/end, 259 * and then distributes the rest over the start/end 260 * 261 * 262 * 263 * Arg: tsm [UNKN ] ThreeStateModel to be 'forced' [ThreeStateModel *] 264 * Arg: prob_into_model [UNKN ] Probability to start the model: for true global will be 1.0 [double] 265 * Arg: ratio_start [UNKN ] ratio of prob to unit 0 to the rest (1.0 means all goes to start) [double] 266 * Arg: ratio_end [UNKN ] ratio of prob to unit (last) to the rest (1.0 means all goes to the end) [double] 267 * 268 */ 269 void Wise2_force_weighted_local_model(ThreeStateModel * tsm,double prob_into_model,double ratio_start,double ratio_end) ; 270 #define force_weighted_local_model Wise2_force_weighted_local_model 271 272 273 /* Function: force_hmmfs_ThreeStateModel(tsm) 274 * 275 * Descrip: places the probability at start end to precisely match 276 * hmmfs code. 277 * 278 * 279 * 280 * Arg: tsm [UNKN ] ThreeStateModel to be 'forced' [ThreeStateModel *] 281 * 282 */ 283 void Wise2_force_hmmfs_ThreeStateModel(ThreeStateModel * tsm); 284 #define force_hmmfs_ThreeStateModel Wise2_force_hmmfs_ThreeStateModel 285 286 287 /* Function: ThreeStateScore_from_ThreeStateModel(tsm) 288 * 289 * Descrip: Converts the three probability form to the score form. 290 * 291 * There is real complications to this due to the fact that the prob 292 * model is a "push" model, that is MATCH2MATCH[i] means the match from i 293 * to i+1, whereas the DP routines rely on a "pull" model, ie 294 * MATCH2MATCH[i] is i-1 to i. 295 * 296 * This routines does the conversion from push to pull, essentially offsetting 297 * the Match2 and Delete2 movements. 298 * 299 * 300 * Arg: tsm [READ ] ThreeStateModel probability form [ThreeStateModel *] 301 * 302 * Return [UNKN ] Undocumented return value [ThreeStateScore *] 303 * 304 */ 305 ThreeStateScore * Wise2_ThreeStateScore_from_ThreeStateModel(ThreeStateModel * tsm); 306 #define ThreeStateScore_from_ThreeStateModel Wise2_ThreeStateScore_from_ThreeStateModel 307 308 309 /* Function: show_ThreeStateModel(tsm,ofp) 310 * 311 * Descrip: shows pretty ugly debugging type format. 312 * 313 * Pretty useless 314 * 315 * 316 * Arg: tsm [UNKN ] Undocumented argument [ThreeStateModel *] 317 * Arg: ofp [UNKN ] Undocumented argument [FILE *] 318 * 319 */ 320 void Wise2_show_ThreeStateModel(ThreeStateModel * tsm,FILE * ofp); 321 #define show_ThreeStateModel Wise2_show_ThreeStateModel 322 323 324 /* Function: pseudo_Protein_from_ThreeStateModel(tsm) 325 * 326 * Descrip: Makes a protein sequence out of the display characters. 327 * Not very useful! 328 * 329 * 330 * 331 * Arg: tsm [UNKN ] Undocumented argument [ThreeStateModel *] 332 * 333 * Return [UNKN ] Undocumented return value [Protein *] 334 * 335 */ 336 Protein * Wise2_pseudo_Protein_from_ThreeStateModel(ThreeStateModel * tsm); 337 #define pseudo_Protein_from_ThreeStateModel Wise2_pseudo_Protein_from_ThreeStateModel 338 339 340 /* Function: ThreeStateModel_from_half_bit_Sequence(pro,mat,rm,gap,ext) 341 * 342 * Descrip: Makes a local three-state-model from a sequence. this is scary 343 * hackery, assumming that the matrix is half-bits and normalising in a 344 * *very* wrong way to get "probabilities" out. 345 * 346 * Works though 347 * 348 * 349 * Arg: pro [READ ] protein sequence [Protein *] 350 * Arg: mat [READ ] comparison matrix to use [CompMat *] 351 * Arg: rm [READ ] random model which you assumme the matrix was built with [RandomModel *] 352 * Arg: gap [READ ] gap open penalty [int] 353 * Arg: ext [READ ] gap ext penalty [int] 354 * 355 * Return [UNKN ] Undocumented return value [ThreeStateModel *] 356 * 357 */ 358 ThreeStateModel * Wise2_ThreeStateModel_from_half_bit_Sequence(Protein * pro,CompMat * mat,RandomModel * rm,int gap,int ext); 359 #define ThreeStateModel_from_half_bit_Sequence Wise2_ThreeStateModel_from_half_bit_Sequence 360 361 362 /* Function: global_ThreeStateModel_from_half_bit_Sequence(pro,mat,rm,gap,ext) 363 * 364 * Descrip: Makes a global three-state-model from a sequence. 365 * Like the local version, this is scary hackery, assumming 366 * that the matrix is half-bits and normalising in a *very* 367 * wrong way to get "probabilities" out. 368 * 369 * Works though 370 * 371 * 372 * Arg: pro [READ ] protein sequence [Protein *] 373 * Arg: mat [READ ] comparison matrix to use [CompMat *] 374 * Arg: rm [READ ] random model which you assumme the matrix was built with [RandomModel *] 375 * Arg: gap [READ ] gap open penalty [int] 376 * Arg: ext [READ ] gap ext penalty [int] 377 * 378 * Return [UNKN ] Undocumented return value [ThreeStateModel *] 379 * 380 */ 381 ThreeStateModel * Wise2_global_ThreeStateModel_from_half_bit_Sequence(Protein * pro,CompMat * mat,RandomModel * rm,int gap,int ext); 382 #define global_ThreeStateModel_from_half_bit_Sequence Wise2_global_ThreeStateModel_from_half_bit_Sequence 383 384 385 /* Function: display_char_in_ThreeStateModel(tsm) 386 * 387 * Descrip: Makes the display chars in the tsm come from 388 * the most likely amino acid in the match position 389 * 390 * 391 * Arg: tsm [UNKN ] Undocumented argument [ThreeStateModel *] 392 * 393 */ 394 void Wise2_display_char_in_ThreeStateModel(ThreeStateModel * tsm); 395 #define display_char_in_ThreeStateModel Wise2_display_char_in_ThreeStateModel 396 397 398 /* Function: fold_RandomModel_into_ThreeStateModel(tsm,rm) 399 * 400 * Descrip: divides the emission and insertion scores 401 * by the random model for use in log-odd 402 * implementations 403 * 404 * 405 * Arg: tsm [UNKN ] Undocumented argument [ThreeStateModel *] 406 * Arg: rm [UNKN ] Undocumented argument [RandomModel *] 407 * 408 */ 409 void Wise2_fold_RandomModel_into_ThreeStateModel(ThreeStateModel * tsm,RandomModel * rm); 410 #define fold_RandomModel_into_ThreeStateModel Wise2_fold_RandomModel_into_ThreeStateModel 411 412 413 /* Function: add_sensible_start_end_global_for_HMMer(tsm) 414 * 415 * Descrip: added start 0.5, 0.25,0.25 for hmmls type 416 * 417 * Deprecated 418 * 419 * 420 * Arg: tsm [UNKN ] Undocumented argument [ThreeStateModel *] 421 * 422 */ 423 void Wise2_add_sensible_start_end_global_for_HMMer(ThreeStateModel * tsm); 424 #define add_sensible_start_end_global_for_HMMer Wise2_add_sensible_start_end_global_for_HMMer 425 426 427 /* Function: add_sensible_start_end_looping_for_HMMer(tsm,loop) 428 * 429 * Descrip: adds start/end for loop probabilities coming 430 * in 431 * 432 * Deprecated 433 * 434 * 435 * Arg: tsm [UNKN ] Undocumented argument [ThreeStateModel *] 436 * Arg: loop [UNKN ] Undocumented argument [Probability] 437 * 438 */ 439 void Wise2_add_sensible_start_end_looping_for_HMMer(ThreeStateModel * tsm,Probability loop); 440 #define add_sensible_start_end_looping_for_HMMer Wise2_add_sensible_start_end_looping_for_HMMer 441 442 443 /* Function: write_HMF_ThreeStateModel(tsm,ofp) 444 * 445 * Descrip: writes the HMF format 446 * 447 * 448 * Arg: tsm [UNKN ] Undocumented argument [ThreeStateModel *] 449 * Arg: ofp [UNKN ] Undocumented argument [FILE *] 450 * 451 */ 452 void Wise2_write_HMF_ThreeStateModel(ThreeStateModel * tsm,FILE * ofp); 453 #define write_HMF_ThreeStateModel Wise2_write_HMF_ThreeStateModel 454 455 456 /* Function: read_HMF_ThreeStateModel(ifp) 457 * 458 * Descrip: reads the HMF format. Leaves the file ready 459 * to read the next format 460 * 461 * 462 * Arg: ifp [UNKN ] Undocumented argument [FILE *] 463 * 464 * Return [UNKN ] Undocumented return value [ThreeStateModel *] 465 * 466 */ 467 ThreeStateModel * Wise2_read_HMF_ThreeStateModel(FILE * ifp); 468 #define read_HMF_ThreeStateModel Wise2_read_HMF_ThreeStateModel 469 470 471 /* Function: write_HMMer_1_7_ascii_ThreeStateModel(tsm,ofp) 472 * 473 * Descrip: writes a HMMer version 1.7 (also ok with 1.8) file 474 * 475 * 476 * Arg: tsm [UNKN ] Undocumented argument [ThreeStateModel *] 477 * Arg: ofp [UNKN ] Undocumented argument [FILE *] 478 * 479 */ 480 void Wise2_write_HMMer_1_7_ascii_ThreeStateModel(ThreeStateModel * tsm,FILE * ofp); 481 #define write_HMMer_1_7_ascii_ThreeStateModel Wise2_write_HMMer_1_7_ascii_ThreeStateModel 482 483 484 /* Function: read_HMMer_1_7_ascii_file(filename) 485 * 486 * Descrip: reads a HMMer ascii version 1.7 (1.8) file from filename. 487 * 488 * 489 * 490 * Arg: filename [UNKN ] the name fo the hmmer file [char *] 491 * 492 * Return [UNKN ] Undocumented return value [ThreeStateModel *] 493 * 494 */ 495 ThreeStateModel * Wise2_read_HMMer_1_7_ascii_file(char * filename); 496 #define read_HMMer_1_7_ascii_file Wise2_read_HMMer_1_7_ascii_file 497 498 499 /* Function: read_HMMer_1_7_ascii(ifp) 500 * 501 * Descrip: Basic function to read HMMer version 1.7(1.8) files. 502 * 503 * 504 * Arg: ifp [UNKN ] Undocumented argument [FILE *] 505 * 506 * Return [UNKN ] Undocumented return value [ThreeStateModel *] 507 * 508 */ 509 ThreeStateModel * Wise2_read_HMMer_1_7_ascii(FILE * ifp) ; 510 #define read_HMMer_1_7_ascii Wise2_read_HMMer_1_7_ascii 511 512 513 /* Function: hard_link_ThreeStateUnit(obj) 514 * 515 * Descrip: Bumps up the reference count of the object 516 * Meaning that multiple pointers can 'own' it 517 * 518 * 519 * Arg: obj [UNKN ] Object to be hard linked [ThreeStateUnit *] 520 * 521 * Return [UNKN ] Undocumented return value [ThreeStateUnit *] 522 * 523 */ 524 ThreeStateUnit * Wise2_hard_link_ThreeStateUnit(ThreeStateUnit * obj); 525 #define hard_link_ThreeStateUnit Wise2_hard_link_ThreeStateUnit 526 527 528 /* Function: ThreeStateUnit_alloc(void) 529 * 530 * Descrip: Allocates structure: assigns defaults if given 531 * 532 * 533 * 534 * Return [UNKN ] Undocumented return value [ThreeStateUnit *] 535 * 536 */ 537 ThreeStateUnit * Wise2_ThreeStateUnit_alloc(void); 538 #define ThreeStateUnit_alloc Wise2_ThreeStateUnit_alloc 539 540 541 /* Function: free_ThreeStateUnit(obj) 542 * 543 * Descrip: Free Function: removes the memory held by obj 544 * Will chain up to owned members and clear all lists 545 * 546 * 547 * Arg: obj [UNKN ] Object that is free'd [ThreeStateUnit *] 548 * 549 * Return [UNKN ] Undocumented return value [ThreeStateUnit *] 550 * 551 */ 552 ThreeStateUnit * Wise2_free_ThreeStateUnit(ThreeStateUnit * obj); 553 #define free_ThreeStateUnit Wise2_free_ThreeStateUnit 554 555 556 /* Function: add_ThreeStateModel(obj,add) 557 * 558 * Descrip: Adds another object to the list. It will expand the list if necessary 559 * 560 * 561 * Arg: obj [UNKN ] Object which contains the list [ThreeStateModel *] 562 * Arg: add [OWNER] Object to add to the list [ThreeStateUnit *] 563 * 564 * Return [UNKN ] Undocumented return value [boolean] 565 * 566 */ 567 boolean Wise2_add_ThreeStateModel(ThreeStateModel * obj,ThreeStateUnit * add); 568 #define add_ThreeStateModel Wise2_add_ThreeStateModel 569 570 571 /* Function: flush_ThreeStateModel(obj) 572 * 573 * Descrip: Frees the list elements, sets length to 0 574 * If you want to save some elements, use hard_link_xxx 575 * to protect them from being actually destroyed in the free 576 * 577 * 578 * Arg: obj [UNKN ] Object which contains the list [ThreeStateModel *] 579 * 580 * Return [UNKN ] Undocumented return value [int] 581 * 582 */ 583 int Wise2_flush_ThreeStateModel(ThreeStateModel * obj); 584 #define flush_ThreeStateModel Wise2_flush_ThreeStateModel 585 586 587 /* Function: ThreeStateModel_alloc_std(void) 588 * 589 * Descrip: Equivalent to ThreeStateModel_alloc_len(ThreeStateModelLISTLENGTH) 590 * 591 * 592 * 593 * Return [UNKN ] Undocumented return value [ThreeStateModel *] 594 * 595 */ 596 ThreeStateModel * Wise2_ThreeStateModel_alloc_std(void); 597 #define ThreeStateModel_alloc_std Wise2_ThreeStateModel_alloc_std 598 599 600 /* Function: ThreeStateModel_alloc_len(len) 601 * 602 * Descrip: Allocates len length to all lists 603 * 604 * 605 * Arg: len [UNKN ] Length of lists to allocate [int] 606 * 607 * Return [UNKN ] Undocumented return value [ThreeStateModel *] 608 * 609 */ 610 ThreeStateModel * Wise2_ThreeStateModel_alloc_len(int len); 611 #define ThreeStateModel_alloc_len Wise2_ThreeStateModel_alloc_len 612 613 614 /* Function: hard_link_ThreeStateModel(obj) 615 * 616 * Descrip: Bumps up the reference count of the object 617 * Meaning that multiple pointers can 'own' it 618 * 619 * 620 * Arg: obj [UNKN ] Object to be hard linked [ThreeStateModel *] 621 * 622 * Return [UNKN ] Undocumented return value [ThreeStateModel *] 623 * 624 */ 625 ThreeStateModel * Wise2_hard_link_ThreeStateModel(ThreeStateModel * obj); 626 #define hard_link_ThreeStateModel Wise2_hard_link_ThreeStateModel 627 628 629 /* Function: ThreeStateModel_alloc(void) 630 * 631 * Descrip: Allocates structure: assigns defaults if given 632 * 633 * 634 * 635 * Return [UNKN ] Undocumented return value [ThreeStateModel *] 636 * 637 */ 638 ThreeStateModel * Wise2_ThreeStateModel_alloc(void); 639 #define ThreeStateModel_alloc Wise2_ThreeStateModel_alloc 640 641 642 /* Function: free_ThreeStateModel(obj) 643 * 644 * Descrip: Free Function: removes the memory held by obj 645 * Will chain up to owned members and clear all lists 646 * 647 * 648 * Arg: obj [UNKN ] Object that is free'd [ThreeStateModel *] 649 * 650 * Return [UNKN ] Undocumented return value [ThreeStateModel *] 651 * 652 */ 653 ThreeStateModel * Wise2_free_ThreeStateModel(ThreeStateModel * obj); 654 #define free_ThreeStateModel Wise2_free_ThreeStateModel 655 656 657 /* Function: hard_link_ThreeStateScoreUnit(obj) 658 * 659 * Descrip: Bumps up the reference count of the object 660 * Meaning that multiple pointers can 'own' it 661 * 662 * 663 * Arg: obj [UNKN ] Object to be hard linked [ThreeStateScoreUnit *] 664 * 665 * Return [UNKN ] Undocumented return value [ThreeStateScoreUnit *] 666 * 667 */ 668 ThreeStateScoreUnit * Wise2_hard_link_ThreeStateScoreUnit(ThreeStateScoreUnit * obj); 669 #define hard_link_ThreeStateScoreUnit Wise2_hard_link_ThreeStateScoreUnit 670 671 672 /* Function: ThreeStateScoreUnit_alloc(void) 673 * 674 * Descrip: Allocates structure: assigns defaults if given 675 * 676 * 677 * 678 * Return [UNKN ] Undocumented return value [ThreeStateScoreUnit *] 679 * 680 */ 681 ThreeStateScoreUnit * Wise2_ThreeStateScoreUnit_alloc(void); 682 #define ThreeStateScoreUnit_alloc Wise2_ThreeStateScoreUnit_alloc 683 684 685 /* Function: free_ThreeStateScoreUnit(obj) 686 * 687 * Descrip: Free Function: removes the memory held by obj 688 * Will chain up to owned members and clear all lists 689 * 690 * 691 * Arg: obj [UNKN ] Object that is free'd [ThreeStateScoreUnit *] 692 * 693 * Return [UNKN ] Undocumented return value [ThreeStateScoreUnit *] 694 * 695 */ 696 ThreeStateScoreUnit * Wise2_free_ThreeStateScoreUnit(ThreeStateScoreUnit * obj); 697 #define free_ThreeStateScoreUnit Wise2_free_ThreeStateScoreUnit 698 699 700 /* Function: add_ThreeStateScore(obj,add) 701 * 702 * Descrip: Adds another object to the list. It will expand the list if necessary 703 * 704 * 705 * Arg: obj [UNKN ] Object which contains the list [ThreeStateScore *] 706 * Arg: add [OWNER] Object to add to the list [ThreeStateScoreUnit *] 707 * 708 * Return [UNKN ] Undocumented return value [boolean] 709 * 710 */ 711 boolean Wise2_add_ThreeStateScore(ThreeStateScore * obj,ThreeStateScoreUnit * add); 712 #define add_ThreeStateScore Wise2_add_ThreeStateScore 713 714 715 /* Function: flush_ThreeStateScore(obj) 716 * 717 * Descrip: Frees the list elements, sets length to 0 718 * If you want to save some elements, use hard_link_xxx 719 * to protect them from being actually destroyed in the free 720 * 721 * 722 * Arg: obj [UNKN ] Object which contains the list [ThreeStateScore *] 723 * 724 * Return [UNKN ] Undocumented return value [int] 725 * 726 */ 727 int Wise2_flush_ThreeStateScore(ThreeStateScore * obj); 728 #define flush_ThreeStateScore Wise2_flush_ThreeStateScore 729 730 731 /* Function: ThreeStateScore_alloc_std(void) 732 * 733 * Descrip: Equivalent to ThreeStateScore_alloc_len(ThreeStateScoreLISTLENGTH) 734 * 735 * 736 * 737 * Return [UNKN ] Undocumented return value [ThreeStateScore *] 738 * 739 */ 740 ThreeStateScore * Wise2_ThreeStateScore_alloc_std(void); 741 #define ThreeStateScore_alloc_std Wise2_ThreeStateScore_alloc_std 742 743 744 /* Function: ThreeStateScore_alloc_len(len) 745 * 746 * Descrip: Allocates len length to all lists 747 * 748 * 749 * Arg: len [UNKN ] Length of lists to allocate [int] 750 * 751 * Return [UNKN ] Undocumented return value [ThreeStateScore *] 752 * 753 */ 754 ThreeStateScore * Wise2_ThreeStateScore_alloc_len(int len); 755 #define ThreeStateScore_alloc_len Wise2_ThreeStateScore_alloc_len 756 757 758 /* Function: hard_link_ThreeStateScore(obj) 759 * 760 * Descrip: Bumps up the reference count of the object 761 * Meaning that multiple pointers can 'own' it 762 * 763 * 764 * Arg: obj [UNKN ] Object to be hard linked [ThreeStateScore *] 765 * 766 * Return [UNKN ] Undocumented return value [ThreeStateScore *] 767 * 768 */ 769 ThreeStateScore * Wise2_hard_link_ThreeStateScore(ThreeStateScore * obj); 770 #define hard_link_ThreeStateScore Wise2_hard_link_ThreeStateScore 771 772 773 /* Function: ThreeStateScore_alloc(void) 774 * 775 * Descrip: Allocates structure: assigns defaults if given 776 * 777 * 778 * 779 * Return [UNKN ] Undocumented return value [ThreeStateScore *] 780 * 781 */ 782 ThreeStateScore * Wise2_ThreeStateScore_alloc(void); 783 #define ThreeStateScore_alloc Wise2_ThreeStateScore_alloc 784 785 786 /* Function: free_ThreeStateScore(obj) 787 * 788 * Descrip: Free Function: removes the memory held by obj 789 * Will chain up to owned members and clear all lists 790 * 791 * 792 * Arg: obj [UNKN ] Object that is free'd [ThreeStateScore *] 793 * 794 * Return [UNKN ] Undocumented return value [ThreeStateScore *] 795 * 796 */ 797 ThreeStateScore * Wise2_free_ThreeStateScore(ThreeStateScore * obj); 798 #define free_ThreeStateScore Wise2_free_ThreeStateScore 799 800 801 /* Unplaced functions */ 802 /* There has been no indication of the use of these functions */ 803 804 805 /***************************************************/ 806 /* Internal functions */ 807 /* you are not expected to have to call these */ 808 /***************************************************/ 809 boolean Wise2_replace_name_ThreeStateModel(ThreeStateModel * obj,char * name); 810 #define replace_name_ThreeStateModel Wise2_replace_name_ThreeStateModel 811 char * Wise2_access_name_ThreeStateModel(ThreeStateModel * obj); 812 #define access_name_ThreeStateModel Wise2_access_name_ThreeStateModel 813 int Wise2_length_unit_ThreeStateModel(ThreeStateModel * obj); 814 #define length_unit_ThreeStateModel Wise2_length_unit_ThreeStateModel 815 boolean Wise2_replace_alphabet_ThreeStateModel(ThreeStateModel * obj,char * alphabet); 816 #define replace_alphabet_ThreeStateModel Wise2_replace_alphabet_ThreeStateModel 817 char Wise2_access_display_char_ThreeStateUnit(ThreeStateUnit * obj); 818 #define access_display_char_ThreeStateUnit Wise2_access_display_char_ThreeStateUnit 819 char * Wise2_access_alphabet_ThreeStateModel(ThreeStateModel * obj); 820 #define access_alphabet_ThreeStateModel Wise2_access_alphabet_ThreeStateModel 821 boolean Wise2_replace_display_char_ThreeStateUnit(ThreeStateUnit * obj,char display_char); 822 #define replace_display_char_ThreeStateUnit Wise2_replace_display_char_ThreeStateUnit 823 boolean Wise2_replace_accession_ThreeStateModel(ThreeStateModel * obj,char * accession); 824 #define replace_accession_ThreeStateModel Wise2_replace_accession_ThreeStateModel 825 RandomModel * Wise2_access_rm_ThreeStateModel(ThreeStateModel * obj); 826 #define access_rm_ThreeStateModel Wise2_access_rm_ThreeStateModel 827 char * Wise2_access_accession_ThreeStateModel(ThreeStateModel * obj); 828 #define access_accession_ThreeStateModel Wise2_access_accession_ThreeStateModel 829 ThreeStateUnit * Wise2_access_unit_ThreeStateModel(ThreeStateModel * obj,int i); 830 #define access_unit_ThreeStateModel Wise2_access_unit_ThreeStateModel 831 boolean Wise2_replace_threshold_ThreeStateModel(ThreeStateModel * obj,double threshold); 832 #define replace_threshold_ThreeStateModel Wise2_replace_threshold_ThreeStateModel 833 boolean Wise2_replace_rm_ThreeStateModel(ThreeStateModel * obj,RandomModel * rm); 834 #define replace_rm_ThreeStateModel Wise2_replace_rm_ThreeStateModel 835 double Wise2_access_threshold_ThreeStateModel(ThreeStateModel * obj); 836 #define access_threshold_ThreeStateModel Wise2_access_threshold_ThreeStateModel 837 ThreeStateScoreUnit * Wise2_ThreeStateScoreUnit_from_ThreeStateUnit(ThreeStateUnit * prev,ThreeStateUnit * tsu); 838 #define ThreeStateScoreUnit_from_ThreeStateUnit Wise2_ThreeStateScoreUnit_from_ThreeStateUnit 839 void Wise2_show_ThreeStateUnit(ThreeStateUnit * tsu,FILE * ofp); 840 #define show_ThreeStateUnit Wise2_show_ThreeStateUnit 841 ThreeStateUnit * Wise2_ThreeStateUnit_from_half_bit_aminoacid(char aa,CompMat * mat,RandomModel * rm,int gap,int ext); 842 #define ThreeStateUnit_from_half_bit_aminoacid Wise2_ThreeStateUnit_from_half_bit_aminoacid 843 char Wise2_display_char_for_ThreeStateUnit(ThreeStateUnit * tsu) ; 844 #define display_char_for_ThreeStateUnit Wise2_display_char_for_ThreeStateUnit 845 void Wise2_write_HMF_ThreeStateUnit(ThreeStateUnit * tsu,FILE * ofp); 846 #define write_HMF_ThreeStateUnit Wise2_write_HMF_ThreeStateUnit 847 ThreeStateUnit * Wise2_read_HMF_ThreeStateUnit(char * line,FILE * ifp); 848 #define read_HMF_ThreeStateUnit Wise2_read_HMF_ThreeStateUnit 849 void Wise2_write_HMMer_1_7_ascii_ThreeStateUnit(ThreeStateUnit * tsu,int no,FILE * ofp); 850 #define write_HMMer_1_7_ascii_ThreeStateUnit Wise2_write_HMMer_1_7_ascii_ThreeStateUnit 851 ThreeStateModel * Wise2_convert_push_model_to_pull_model(ThreeStateModel * tsm); 852 #define convert_push_model_to_pull_model Wise2_convert_push_model_to_pull_model 853 ThreeStateUnit * Wise2_convert_push_unit_to_pull_unit(ThreeStateUnit * prev,ThreeStateUnit * this); 854 #define convert_push_unit_to_pull_unit Wise2_convert_push_unit_to_pull_unit 855 ThreeStateUnit * Wise2_read_HMMer_1_7_ThreeStateUnit(char * alphabet,FILE * ifp) ; 856 #define read_HMMer_1_7_ThreeStateUnit Wise2_read_HMMer_1_7_ThreeStateUnit 857 ThreeStateUnit * Wise2_blank_ThreeStateUnit(void); 858 #define blank_ThreeStateUnit Wise2_blank_ThreeStateUnit 859 void Wise2_swap_ThreeStateModel(ThreeStateUnit ** list,int i,int j) ; 860 #define swap_ThreeStateModel Wise2_swap_ThreeStateModel 861 void Wise2_qsort_ThreeStateModel(ThreeStateUnit ** list,int left,int right,int (*comp)(ThreeStateUnit * ,ThreeStateUnit * )); 862 #define qsort_ThreeStateModel Wise2_qsort_ThreeStateModel 863 void Wise2_sort_ThreeStateModel(ThreeStateModel * obj,int (*comp)(ThreeStateUnit *, ThreeStateUnit *)); 864 #define sort_ThreeStateModel Wise2_sort_ThreeStateModel 865 boolean Wise2_expand_ThreeStateModel(ThreeStateModel * obj,int len); 866 #define expand_ThreeStateModel Wise2_expand_ThreeStateModel 867 void Wise2_swap_ThreeStateScore(ThreeStateScoreUnit ** list,int i,int j) ; 868 #define swap_ThreeStateScore Wise2_swap_ThreeStateScore 869 void Wise2_qsort_ThreeStateScore(ThreeStateScoreUnit ** list,int left,int right,int (*comp)(ThreeStateScoreUnit * ,ThreeStateScoreUnit * )); 870 #define qsort_ThreeStateScore Wise2_qsort_ThreeStateScore 871 void Wise2_sort_ThreeStateScore(ThreeStateScore * obj,int (*comp)(ThreeStateScoreUnit *, ThreeStateScoreUnit *)); 872 #define sort_ThreeStateScore Wise2_sort_ThreeStateScore 873 boolean Wise2_expand_ThreeStateScore(ThreeStateScore * obj,int len); 874 #define expand_ThreeStateScore Wise2_expand_ThreeStateScore 875 876 #ifdef _cplusplus 877 } 878 #endif 879 880 #endif 881