| 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 |
#ifndef P7_HMMERH_INCLUDED |
| 28 |
#define P7_HMMERH_INCLUDED |
| 29 |
#include <p7_config.h> |
| 30 |
|
| 31 |
#include <stdio.h> |
| 32 |
#include <stddef.h> |
| 33 |
|
| 34 |
#ifdef HMMER_MPI |
| 35 |
#include "mpi.h" |
| 36 |
#endif |
| 37 |
|
| 38 |
#ifdef HMMER_THREADS |
| 39 |
#include <pthread.h> |
| 40 |
#endif |
| 41 |
|
| 42 |
#include "easel.h" |
| 43 |
#include "esl_alphabet.h" |
| 44 |
#include "esl_dmatrix.h" |
| 45 |
#include "esl_getopts.h" |
| 46 |
#include "esl_histogram.h" |
| 47 |
#include "esl_hmm.h" |
| 48 |
#include "esl_keyhash.h" |
| 49 |
#include "esl_mixdchlet.h" |
| 50 |
#include "esl_msa.h" |
| 51 |
#include "esl_random.h" |
| 52 |
#include "esl_rand64.h" |
| 53 |
#include "esl_sq.h" |
| 54 |
#include "esl_scorematrix.h" |
| 55 |
#include "esl_stopwatch.h" |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
#define p7_NO_MODE 0 |
| 61 |
#define p7_LOCAL 1 |
| 62 |
#define p7_GLOCAL 2 |
| 63 |
#define p7_UNILOCAL 3 |
| 64 |
#define p7_UNIGLOCAL 4 |
| 65 |
|
| 66 |
#define p7_IsLocal(mode) (mode == p7_LOCAL || mode == p7_UNILOCAL) |
| 67 |
#define p7_IsMulti(mode) (mode == p7_LOCAL || mode == p7_GLOCAL) |
| 68 |
|
| 69 |
#define p7_NEVPARAM 6 |
| 70 |
#define p7_NCUTOFFS 6 |
| 71 |
#define p7_NOFFSETS 3 |
| 72 |
enum p7_evparams_e { p7_MMU = 0, p7_MLAMBDA = 1, p7_VMU = 2, p7_VLAMBDA = 3, p7_FTAU = 4, p7_FLAMBDA = 5 }; |
| 73 |
enum p7_cutoffs_e { p7_GA1 = 0, p7_GA2 = 1, p7_TC1 = 2, p7_TC2 = 3, p7_NC1 = 4, p7_NC2 = 5 }; |
| 74 |
enum p7_offsets_e { p7_MOFFSET = 0, p7_FOFFSET = 1, p7_POFFSET = 2 }; |
| 75 |
|
| 76 |
#define p7_EVPARAM_UNSET -99999.0f |
| 77 |
#define p7_CUTOFF_UNSET -99999.0f |
| 78 |
#define p7_COMPO_UNSET -1.0f |
| 79 |
|
| 80 |
|
| 81 |
#define p7_DEFAULT 0 |
| 82 |
#define p7_DIGITIZE (1<<0) |
| 83 |
#define p7_ALL_CONSENSUS_COLS (1<<1) |
| 84 |
#define p7_TRIM (1<<2) |
| 85 |
|
| 86 |
|
| 87 |
#define p7_MSA_COORDS (1<<0) |
| 88 |
|
| 89 |
|
| 90 |
enum p7_strands_e { p7_STRAND_TOPONLY = 0, p7_STRAND_BOTTOMONLY = 1, p7_STRAND_BOTH = 2}; |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
#define p7H_HASBITS (1<<0) |
| 110 |
#define p7H_DESC (1<<1) |
| 111 |
#define p7H_RF (1<<2) |
| 112 |
#define p7H_CS (1<<3) |
| 113 |
#define p7H_XRAY (1<<4) |
| 114 |
#define p7H_HASPROB (1<<5) |
| 115 |
#define p7H_HASDNA (1<<6) |
| 116 |
#define p7H_STATS (1<<7) |
| 117 |
#define p7H_MAP (1<<8) |
| 118 |
#define p7H_ACC (1<<9) |
| 119 |
#define p7H_GA (1<<10) |
| 120 |
#define p7H_TC (1<<11) |
| 121 |
#define p7H_NC (1<<12) |
| 122 |
#define p7H_CA (1<<13) |
| 123 |
#define p7H_COMPO (1<<14) |
| 124 |
#define p7H_CHKSUM (1<<15) |
| 125 |
#define p7H_CONS (1<<16) |
| 126 |
#define p7H_MMASK (1<<17) |
| 127 |
|
| 128 |
|
| 129 |
enum p7h_transitions_e { |
| 130 |
p7H_MM = 0, |
| 131 |
p7H_MI = 1, |
| 132 |
p7H_MD = 2, |
| 133 |
p7H_IM = 3, |
| 134 |
p7H_II = 4, |
| 135 |
p7H_DM = 5, |
| 136 |
p7H_DD = 6 |
| 137 |
}; |
| 138 |
#define p7H_NTRANSITIONS 7 |
| 139 |
|
| 140 |
|
| 141 |
#define P7H_TMAT(hmm, k) ((hmm)->t[k]) |
| 142 |
#define P7H_TINS(hmm, k) ((hmm)->t[k]+3) |
| 143 |
#define P7H_TDEL(hmm, k) ((hmm)->t[k]+5) |
| 144 |
#define p7H_NTMAT 3 |
| 145 |
#define p7H_NTDEL 2 |
| 146 |
#define p7H_NTINS 2 |
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
typedef struct p7_hmm_s { |
| 161 |
|
| 162 |
int M; |
| 163 |
float **t; |
| 164 |
float **mat; |
| 165 |
float **ins; |
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
char *name; |
| 173 |
char *acc; |
| 174 |
char *desc; |
| 175 |
char *rf; |
| 176 |
char *mm; |
| 177 |
char *consensus; |
| 178 |
char *cs; |
| 179 |
char *ca; |
| 180 |
|
| 181 |
char *comlog; |
| 182 |
int nseq; |
| 183 |
float eff_nseq; |
| 184 |
int max_length; |
| 185 |
char *ctime; |
| 186 |
int *map; |
| 187 |
uint32_t checksum; |
| 188 |
float evparam[p7_NEVPARAM]; |
| 189 |
float cutoff[p7_NCUTOFFS]; |
| 190 |
float compo[p7_MAXABET]; |
| 191 |
|
| 192 |
off_t offset; |
| 193 |
const ESL_ALPHABET *abc; |
| 194 |
int flags; |
| 195 |
} P7_HMM; |
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
enum p7p_xstates_e { |
| 205 |
p7P_E = 0, |
| 206 |
p7P_N = 1, |
| 207 |
p7P_J = 2, |
| 208 |
p7P_C = 3 |
| 209 |
}; |
| 210 |
#define p7P_NXSTATES 4 |
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
enum p7p_xtransitions_e { |
| 215 |
p7P_LOOP = 0, |
| 216 |
p7P_MOVE = 1 |
| 217 |
}; |
| 218 |
#define p7P_NXTRANS 2 |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
enum p7p_tsc_e { |
| 223 |
p7P_MM = 0, |
| 224 |
p7P_IM = 1, |
| 225 |
p7P_DM = 2, |
| 226 |
p7P_BM = 3, |
| 227 |
p7P_MD = 4, |
| 228 |
p7P_DD = 5, |
| 229 |
p7P_MI = 6, |
| 230 |
p7P_II = 7, |
| 231 |
}; |
| 232 |
#define p7P_NTRANS 8 |
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
enum p7p_rsc_e { |
| 237 |
p7P_MSC = 0, |
| 238 |
p7P_ISC = 1 |
| 239 |
}; |
| 240 |
#define p7P_NR 2 |
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
#define p7P_TSC(gm, k, s) ((gm)->tsc[(k) * p7P_NTRANS + (s)]) |
| 245 |
#define p7P_MSC(gm, k, x) ((gm)->rsc[x][(k) * p7P_NR + p7P_MSC]) |
| 246 |
#define p7P_ISC(gm, k, x) ((gm)->rsc[x][(k) * p7P_NR + p7P_ISC]) |
| 247 |
|
| 248 |
|
| 249 |
typedef struct p7_profile_s { |
| 250 |
float *tsc; |
| 251 |
float **rsc; |
| 252 |
float xsc[p7P_NXSTATES][p7P_NXTRANS]; |
| 253 |
|
| 254 |
int mode; |
| 255 |
int L; |
| 256 |
int allocM; |
| 257 |
int M; |
| 258 |
int max_length; |
| 259 |
float nj; |
| 260 |
|
| 261 |
|
| 262 |
char *name; |
| 263 |
char *acc; |
| 264 |
char *desc; |
| 265 |
char *rf; |
| 266 |
char *mm; |
| 267 |
char *cs; |
| 268 |
char *consensus; |
| 269 |
float evparam[p7_NEVPARAM]; |
| 270 |
float cutoff[p7_NCUTOFFS]; |
| 271 |
float compo[p7_MAXABET]; |
| 272 |
|
| 273 |
|
| 274 |
off_t offs[p7_NOFFSETS]; |
| 275 |
|
| 276 |
off_t roff; |
| 277 |
off_t eoff; |
| 278 |
|
| 279 |
const ESL_ALPHABET *abc; |
| 280 |
} P7_PROFILE; |
| 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 |
typedef struct p7_bg_s { |
| 307 |
float *f; |
| 308 |
float p1; |
| 309 |
|
| 310 |
ESL_HMM *fhmm; |
| 311 |
|
| 312 |
float omega; |
| 313 |
|
| 314 |
const ESL_ALPHABET *abc; |
| 315 |
} P7_BG; |
| 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 |
enum p7t_statetype_e { |
| 359 |
p7T_BOGUS = 0, |
| 360 |
p7T_M = 1, |
| 361 |
p7T_D = 2, |
| 362 |
p7T_I = 3, |
| 363 |
p7T_S = 4, |
| 364 |
p7T_N = 5, |
| 365 |
p7T_B = 6, |
| 366 |
p7T_E = 7, |
| 367 |
p7T_C = 8, |
| 368 |
p7T_T = 9, |
| 369 |
p7T_J = 10, |
| 370 |
p7T_X = 11, |
| 371 |
}; |
| 372 |
#define p7T_NSTATETYPES 12 |
| 373 |
|
| 374 |
typedef struct p7_trace_s { |
| 375 |
int N; |
| 376 |
int nalloc; |
| 377 |
char *st; |
| 378 |
int *k; |
| 379 |
int *i; |
| 380 |
float *pp; |
| 381 |
int M; |
| 382 |
int L; |
| 383 |
|
| 384 |
|
| 385 |
int ndom; |
| 386 |
int *tfrom, *tto; |
| 387 |
int *sqfrom, *sqto; |
| 388 |
int *hmmfrom, *hmmto; |
| 389 |
int ndomalloc; |
| 390 |
|
| 391 |
} P7_TRACE; |
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
|
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
enum p7_hmmfile_formats_e { |
| 403 |
p7_HMMFILE_20 = 0, |
| 404 |
p7_HMMFILE_3a = 1, |
| 405 |
p7_HMMFILE_3b = 2, |
| 406 |
p7_HMMFILE_3c = 3, |
| 407 |
p7_HMMFILE_3d = 4, |
| 408 |
p7_HMMFILE_3e = 5, |
| 409 |
p7_HMMFILE_3f = 6, |
| 410 |
}; |
| 411 |
|
| 412 |
typedef struct p7_hmmfile_s { |
| 413 |
FILE *f; |
| 414 |
char *fname; |
| 415 |
ESL_SSI *ssi; |
| 416 |
|
| 417 |
int do_gzip; |
| 418 |
int do_stdin; |
| 419 |
int newly_opened; |
| 420 |
int is_pressed; |
| 421 |
|
| 422 |
int format; |
| 423 |
int (*parser)(struct p7_hmmfile_s *, ESL_ALPHABET **, P7_HMM **); |
| 424 |
ESL_FILEPARSER *efp; |
| 425 |
|
| 426 |
|
| 427 |
FILE *ffp; |
| 428 |
FILE *pfp; |
| 429 |
|
| 430 |
#ifdef HMMER_THREADS |
| 431 |
int syncRead; |
| 432 |
pthread_mutex_t readMutex; |
| 433 |
#endif |
| 434 |
|
| 435 |
char errbuf[eslERRBUFSIZE]; |
| 436 |
char rr_errbuf[eslERRBUFSIZE]; |
| 437 |
} P7_HMMFILE; |
| 438 |
|
| 439 |
|
| 440 |
|
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
|
| 446 |
|
| 447 |
|
| 448 |
|
| 449 |
|
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
enum p7g_scells_e { |
| 456 |
p7G_M = 0, |
| 457 |
p7G_I = 1, |
| 458 |
p7G_D = 2, |
| 459 |
}; |
| 460 |
#define p7G_NSCELLS 3 |
| 461 |
|
| 462 |
enum p7g_xcells_e { |
| 463 |
p7G_E = 0, |
| 464 |
p7G_N = 1, |
| 465 |
p7G_J = 2, |
| 466 |
p7G_B = 3, |
| 467 |
p7G_C = 4 |
| 468 |
}; |
| 469 |
#define p7G_NXCELLS 5 |
| 470 |
|
| 471 |
|
| 472 |
typedef struct p7_gmx_s { |
| 473 |
int M; |
| 474 |
int L; |
| 475 |
|
| 476 |
int allocR; |
| 477 |
int validR; |
| 478 |
int allocW; |
| 479 |
uint64_t ncells; |
| 480 |
|
| 481 |
float **dp; |
| 482 |
float *xmx; |
| 483 |
|
| 484 |
float *dp_mem; |
| 485 |
} P7_GMX; |
| 486 |
|
| 487 |
|
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
|
| 493 |
|
| 494 |
|
| 495 |
#define MMX(i,k) (dp[(i)][(k) * p7G_NSCELLS + p7G_M]) |
| 496 |
#define IMX(i,k) (dp[(i)][(k) * p7G_NSCELLS + p7G_I]) |
| 497 |
#define DMX(i,k) (dp[(i)][(k) * p7G_NSCELLS + p7G_D]) |
| 498 |
#define XMX(i,s) (xmx[(i) * p7G_NXCELLS + (s)]) |
| 499 |
|
| 500 |
#define TSC(s,k) (tsc[(k) * p7P_NTRANS + (s)]) |
| 501 |
#define MSC(k) (rsc[(k) * p7P_NR + p7P_MSC]) |
| 502 |
#define ISC(k) (rsc[(k) * p7P_NR + p7P_ISC]) |
| 503 |
|
| 504 |
|
| 505 |
#define p7_HIDE_SPECIALS (1<<0) |
| 506 |
#define p7_SHOW_LOG (1<<1) |
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
typedef struct p7_prior_s { |
| 514 |
ESL_MIXDCHLET *tm; |
| 515 |
ESL_MIXDCHLET *ti; |
| 516 |
ESL_MIXDCHLET *td; |
| 517 |
ESL_MIXDCHLET *em; |
| 518 |
ESL_MIXDCHLET *ei; |
| 519 |
} P7_PRIOR; |
| 520 |
|
| 521 |
|
| 522 |
|
| 523 |
|
| 524 |
|
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
struct p7_spcoord_s { |
| 532 |
int idx; |
| 533 |
int i, j; |
| 534 |
int k, m; |
| 535 |
float prob; |
| 536 |
}; |
| 537 |
|
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
|
| 542 |
|
| 543 |
|
| 544 |
typedef struct p7_spensemble_s { |
| 545 |
|
| 546 |
int nsamples; |
| 547 |
struct p7_spcoord_s *sp; |
| 548 |
int nalloc; |
| 549 |
int n; |
| 550 |
|
| 551 |
|
| 552 |
int *workspace; |
| 553 |
int *assignment; |
| 554 |
int nc; |
| 555 |
|
| 556 |
|
| 557 |
int *epc; |
| 558 |
int epc_alloc; |
| 559 |
|
| 560 |
|
| 561 |
struct p7_spcoord_s *sigc; |
| 562 |
int nsigc; |
| 563 |
int nsigc_alloc; |
| 564 |
} P7_SPENSEMBLE; |
| 565 |
|
| 566 |
|
| 567 |
|
| 568 |
|
| 569 |
|
| 570 |
|
| 571 |
|
| 572 |
|
| 573 |
|
| 574 |
|
| 575 |
|
| 576 |
|
| 577 |
|
| 578 |
|
| 579 |
|
| 580 |
typedef struct p7_alidisplay_s { |
| 581 |
char *rfline; |
| 582 |
char *mmline; |
| 583 |
char *csline; |
| 584 |
char *model; |
| 585 |
char *mline; |
| 586 |
char *aseq; |
| 587 |
char *ntseq; |
| 588 |
char *ppline; |
| 589 |
int N; |
| 590 |
|
| 591 |
char *hmmname; |
| 592 |
char *hmmacc; |
| 593 |
char *hmmdesc; |
| 594 |
int hmmfrom; |
| 595 |
int hmmto; |
| 596 |
int M; |
| 597 |
|
| 598 |
char *sqname; |
| 599 |
char *sqacc; |
| 600 |
char *sqdesc; |
| 601 |
int64_t sqfrom; |
| 602 |
int64_t sqto; |
| 603 |
int64_t L; |
| 604 |
|
| 605 |
int memsize; |
| 606 |
char *mem; |
| 607 |
} P7_ALIDISPLAY; |
| 608 |
|
| 609 |
|
| 610 |
|
| 611 |
|
| 612 |
|
| 613 |
|
| 614 |
typedef struct p7_dom_s { |
| 615 |
int64_t ienv, jenv; |
| 616 |
int64_t iali, jali; |
| 617 |
int64_t iorf, jorf; |
| 618 |
float envsc; |
| 619 |
float domcorrection; |
| 620 |
float dombias; |
| 621 |
float oasc; |
| 622 |
float bitscore; |
| 623 |
double lnP; |
| 624 |
int is_reported; |
| 625 |
int is_included; |
| 626 |
float *scores_per_pos; |
| 627 |
P7_ALIDISPLAY *ad; |
| 628 |
} P7_DOMAIN; |
| 629 |
|
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
|
| 634 |
|
| 635 |
|
| 636 |
|
| 637 |
|
| 638 |
|
| 639 |
|
| 640 |
|
| 641 |
|
| 642 |
|
| 643 |
typedef struct p7_domaindef_s { |
| 644 |
|
| 645 |
float *mocc; |
| 646 |
float *btot; |
| 647 |
float *etot; |
| 648 |
int L; |
| 649 |
int Lalloc; |
| 650 |
|
| 651 |
|
| 652 |
float *n2sc; |
| 653 |
|
| 654 |
|
| 655 |
ESL_RANDOMNESS *r; |
| 656 |
int do_reseeding; |
| 657 |
P7_SPENSEMBLE *sp; |
| 658 |
P7_TRACE *tr; |
| 659 |
P7_TRACE *gtr; |
| 660 |
|
| 661 |
|
| 662 |
|
| 663 |
float rt1; |
| 664 |
float rt2; |
| 665 |
float rt3; |
| 666 |
|
| 667 |
|
| 668 |
int nsamples; |
| 669 |
float min_overlap; |
| 670 |
int of_smaller; |
| 671 |
int max_diagdiff; |
| 672 |
float min_posterior; |
| 673 |
float min_endpointp; |
| 674 |
|
| 675 |
|
| 676 |
P7_DOMAIN *dcl; |
| 677 |
int ndom; |
| 678 |
int nalloc; |
| 679 |
|
| 680 |
|
| 681 |
float nexpected; |
| 682 |
int nregions; |
| 683 |
int nclustered; |
| 684 |
int noverlaps; |
| 685 |
int nenvelopes; |
| 686 |
|
| 687 |
} P7_DOMAINDEF; |
| 688 |
|
| 689 |
|
| 690 |
|
| 691 |
|
| 692 |
|
| 693 |
|
| 694 |
#define p7_HITFLAGS_DEFAULT 0 |
| 695 |
#define p7_IS_INCLUDED (1<<0) |
| 696 |
#define p7_IS_REPORTED (1<<1) |
| 697 |
#define p7_IS_NEW (1<<2) |
| 698 |
#define p7_IS_DROPPED (1<<3) |
| 699 |
#define p7_IS_DUPLICATE (1<<4) |
| 700 |
|
| 701 |
|
| 702 |
|
| 703 |
|
| 704 |
|
| 705 |
|
| 706 |
|
| 707 |
|
| 708 |
|
| 709 |
|
| 710 |
|
| 711 |
typedef struct p7_hit_s { |
| 712 |
char *name; |
| 713 |
char *acc; |
| 714 |
char *desc; |
| 715 |
int window_length; |
| 716 |
double sortkey; |
| 717 |
|
| 718 |
float score; |
| 719 |
float pre_score; |
| 720 |
float sum_score; |
| 721 |
|
| 722 |
double lnP; |
| 723 |
double pre_lnP; |
| 724 |
double sum_lnP; |
| 725 |
|
| 726 |
float nexpected; |
| 727 |
int nregions; |
| 728 |
int nclustered; |
| 729 |
int noverlaps; |
| 730 |
int nenvelopes; |
| 731 |
int ndom; |
| 732 |
|
| 733 |
uint32_t flags; |
| 734 |
int nreported; |
| 735 |
int nincluded; |
| 736 |
int best_domain; |
| 737 |
|
| 738 |
int64_t seqidx; |
| 739 |
int64_t subseq_start; |
| 740 |
|
| 741 |
P7_DOMAIN *dcl; |
| 742 |
esl_pos_t offset; |
| 743 |
} P7_HIT; |
| 744 |
|
| 745 |
|
| 746 |
|
| 747 |
|
| 748 |
|
| 749 |
|
| 750 |
typedef struct p7_tophits_s { |
| 751 |
P7_HIT **hit; |
| 752 |
P7_HIT *unsrt; |
| 753 |
uint64_t Nalloc; |
| 754 |
uint64_t N; |
| 755 |
uint64_t nreported; |
| 756 |
uint64_t nincluded; |
| 757 |
int is_sorted_by_sortkey; |
| 758 |
int is_sorted_by_seqidx; |
| 759 |
} P7_TOPHITS; |
| 760 |
|
| 761 |
|
| 762 |
|
| 763 |
|
| 764 |
|
| 765 |
|
| 766 |
|
| 767 |
|
| 768 |
|
| 769 |
enum p7_scoredatatype_e { |
| 770 |
p7_sd_std = 0, |
| 771 |
p7_sd_fm = 1, |
| 772 |
}; |
| 773 |
|
| 774 |
|
| 775 |
|
| 776 |
|
| 777 |
|
| 778 |
|
| 779 |
|
| 780 |
typedef struct p7_scoredata_s { |
| 781 |
int type; |
| 782 |
int M; |
| 783 |
union { |
| 784 |
uint8_t *ssv_scores; |
| 785 |
float *ssv_scores_f; |
| 786 |
}; |
| 787 |
float *prefix_lengths; |
| 788 |
float *suffix_lengths; |
| 789 |
float *fwd_scores; |
| 790 |
float **fwd_transitions; |
| 791 |
float **opt_ext_fwd; |
| 792 |
float **opt_ext_rev; |
| 793 |
} P7_SCOREDATA; |
| 794 |
|
| 795 |
|
| 796 |
|
| 797 |
|
| 798 |
|
| 799 |
|
| 800 |
|
| 801 |
typedef struct p7_hmm_window_s { |
| 802 |
float score; |
| 803 |
float null_sc; |
| 804 |
int32_t id; |
| 805 |
int64_t n; |
| 806 |
int64_t fm_n; |
| 807 |
int32_t length; |
| 808 |
int16_t k; |
| 809 |
int64_t target_len; |
| 810 |
int8_t complementarity; |
| 811 |
int8_t used_to_extend; |
| 812 |
} P7_HMM_WINDOW; |
| 813 |
|
| 814 |
typedef struct p7_hmm_window_list_s { |
| 815 |
P7_HMM_WINDOW *windows; |
| 816 |
int count; |
| 817 |
int size; |
| 818 |
} P7_HMM_WINDOWLIST; |
| 819 |
|
| 820 |
|
| 821 |
|
| 822 |
|
| 823 |
|
| 824 |
|
| 825 |
#if defined (eslENABLE_NEON) |
| 826 |
#include "impl_neon/impl_neon.h" |
| 827 |
#elif defined (eslENABLE_SSE) |
| 828 |
#include "impl_sse/impl_sse.h" |
| 829 |
#elif defined (eslENABLE_VMX) |
| 830 |
#include "impl_vmx/impl_vmx.h" |
| 831 |
#else |
| 832 |
#error "No vector implementation enabled" |
| 833 |
#endif |
| 834 |
|
| 835 |
|
| 836 |
|
| 837 |
|
| 838 |
|
| 839 |
#define FM_MAX_LINE 256 |
| 840 |
|
| 841 |
|
| 842 |
|
| 843 |
|
| 844 |
|
| 845 |
|
| 846 |
#define FM_OCC_CNT( type, i, c) ( occCnts_##type[(meta->alph_size)*(i) + (c)]) |
| 847 |
|
| 848 |
enum fm_alphabettypes_e { |
| 849 |
fm_DNA = 0, |
| 850 |
|
| 851 |
fm_AMINO = 4, |
| 852 |
}; |
| 853 |
|
| 854 |
|
| 855 |
|
| 856 |
|
| 857 |
|
| 858 |
enum fm_direction_e { |
| 859 |
fm_forward = 0, |
| 860 |
fm_backward = 1, |
| 861 |
}; |
| 862 |
|
| 863 |
|
| 864 |
typedef struct fm_interval_s { |
| 865 |
int lower; |
| 866 |
int upper; |
| 867 |
} FM_INTERVAL; |
| 868 |
|
| 869 |
typedef struct fm_hit_s { |
| 870 |
uint64_t start; |
| 871 |
uint32_t block; |
| 872 |
int direction; |
| 873 |
int length; |
| 874 |
int sortkey; |
| 875 |
} FM_HIT; |
| 876 |
|
| 877 |
|
| 878 |
|
| 879 |
typedef struct fm_ambiglist_s { |
| 880 |
FM_INTERVAL *ranges; |
| 881 |
uint32_t count; |
| 882 |
uint32_t size; |
| 883 |
} FM_AMBIGLIST; |
| 884 |
|
| 885 |
|
| 886 |
typedef struct fm_seqdata_s { |
| 887 |
|
| 888 |
uint32_t target_id; |
| 889 |
uint64_t target_start; |
| 890 |
uint32_t fm_start; |
| 891 |
uint32_t length; |
| 892 |
|
| 893 |
|
| 894 |
|
| 895 |
uint16_t name_length; |
| 896 |
uint16_t source_length; |
| 897 |
uint16_t acc_length; |
| 898 |
uint16_t desc_length; |
| 899 |
char *name; |
| 900 |
char *source; |
| 901 |
char *acc; |
| 902 |
char *desc; |
| 903 |
} FM_SEQDATA; |
| 904 |
|
| 905 |
|
| 906 |
typedef struct fm_metadata_s { |
| 907 |
uint8_t fwd_only; |
| 908 |
uint8_t alph_type; |
| 909 |
uint8_t alph_size; |
| 910 |
uint8_t charBits; |
| 911 |
uint32_t freq_SA; |
| 912 |
uint32_t freq_cnt_sb; |
| 913 |
uint32_t freq_cnt_b; |
| 914 |
uint16_t block_count; |
| 915 |
uint32_t seq_count; |
| 916 |
uint64_t char_count; |
| 917 |
char *alph; |
| 918 |
char *inv_alph; |
| 919 |
int *compl_alph; |
| 920 |
FILE *fp; |
| 921 |
FM_SEQDATA *seq_data; |
| 922 |
FM_AMBIGLIST *ambig_list; |
| 923 |
} FM_METADATA; |
| 924 |
|
| 925 |
|
| 926 |
typedef struct fm_data_s { |
| 927 |
uint64_t N; |
| 928 |
uint32_t term_loc; |
| 929 |
uint32_t seq_offset; |
| 930 |
uint32_t ambig_offset; |
| 931 |
uint32_t seq_cnt; |
| 932 |
uint32_t ambig_cnt; |
| 933 |
uint32_t overlap; |
| 934 |
uint8_t *T; |
| 935 |
uint8_t *BWT_mem; |
| 936 |
uint8_t *BWT; |
| 937 |
uint32_t *SA; |
| 938 |
int64_t *C; |
| 939 |
uint32_t *occCnts_sb; |
| 940 |
uint16_t *occCnts_b; |
| 941 |
} FM_DATA; |
| 942 |
|
| 943 |
typedef struct fm_dp_pair_s { |
| 944 |
uint16_t pos; |
| 945 |
float score; |
| 946 |
float max_score; |
| 947 |
uint8_t score_peak_len; |
| 948 |
uint8_t consec_pos; |
| 949 |
uint8_t max_consec_pos; |
| 950 |
uint8_t consec_consensus; |
| 951 |
uint8_t model_direction; |
| 952 |
uint8_t complementarity; |
| 953 |
} FM_DP_PAIR; |
| 954 |
|
| 955 |
|
| 956 |
typedef struct fm_diag_s { |
| 957 |
uint64_t n; |
| 958 |
union { |
| 959 |
double sortkey; |
| 960 |
double score; |
| 961 |
}; |
| 962 |
uint16_t k; |
| 963 |
uint16_t length; |
| 964 |
uint8_t complementarity; |
| 965 |
} FM_DIAG; |
| 966 |
|
| 967 |
typedef struct fm_diaglist_s { |
| 968 |
FM_DIAG *diags; |
| 969 |
int count; |
| 970 |
int size; |
| 971 |
} FM_DIAGLIST; |
| 972 |
|
| 973 |
|
| 974 |
|
| 975 |
|
| 976 |
|
| 977 |
|
| 978 |
|
| 979 |
typedef struct { |
| 980 |
#if defined (eslENABLE_SSE) |
| 981 |
|
| 982 |
__m128i *fm_masks_mem; |
| 983 |
__m128i *fm_masks_v; |
| 984 |
__m128i *fm_reverse_masks_mem; |
| 985 |
__m128i *fm_reverse_masks_v; |
| 986 |
__m128i *fm_chars_mem; |
| 987 |
__m128i *fm_chars_v; |
| 988 |
|
| 989 |
|
| 990 |
__m128i fm_allones_v; |
| 991 |
__m128i fm_zeros_v; |
| 992 |
__m128i fm_neg128_v; |
| 993 |
__m128i fm_m0f; |
| 994 |
__m128i fm_m01; |
| 995 |
__m128i fm_m11; |
| 996 |
|
| 997 |
|
| 998 |
#endif |
| 999 |
|
| 1000 |
|
| 1001 |
int occCallCnt; |
| 1002 |
|
| 1003 |
|
| 1004 |
int max_depth; |
| 1005 |
float drop_lim; |
| 1006 |
int drop_max_len; |
| 1007 |
int consec_pos_req; |
| 1008 |
int consensus_match_req; |
| 1009 |
float score_density_req; |
| 1010 |
int ssv_length; |
| 1011 |
float scthreshFM; |
| 1012 |
float sc_thresh_ratio; |
| 1013 |
|
| 1014 |
|
| 1015 |
FM_METADATA *meta; |
| 1016 |
|
| 1017 |
} FM_CFG; |
| 1018 |
|
| 1019 |
|
| 1020 |
#if defined (eslENABLE_SSE) |
| 1021 |
|
| 1022 |
typedef union { |
| 1023 |
uint8_t bytes[16]; |
| 1024 |
__m128i m128; |
| 1025 |
} byte_m128; |
| 1026 |
|
| 1027 |
|
| 1028 |
|
| 1029 |
|
| 1030 |
|
| 1031 |
|
| 1032 |
|
| 1033 |
|
| 1034 |
|
| 1035 |
|
| 1036 |
#define FM_GATHER_8BIT_COUNTS( in_v, mid_v, out_v ) do {\ |
| 1037 |
mid_v = _mm_sad_epu8 (in_v, cfg->fm_zeros_v);\ |
| 1038 |
tmp_v = _mm_shuffle_epi32(mid_v, _MM_SHUFFLE(1, 1, 1, 2));\ |
| 1039 |
out_v = _mm_add_epi16(mid_v, tmp_v);\ |
| 1040 |
} while (0) |
| 1041 |
|
| 1042 |
|
| 1043 |
|
| 1044 |
|
| 1045 |
|
| 1046 |
|
| 1047 |
|
| 1048 |
|
| 1049 |
|
| 1050 |
|
| 1051 |
|
| 1052 |
|
| 1053 |
|
| 1054 |
|
| 1055 |
|
| 1056 |
|
| 1057 |
|
| 1058 |
|
| 1059 |
|
| 1060 |
|
| 1061 |
|
| 1062 |
#define FM_MATCH_2BIT(in_v, c_v, a_v, b_v, out_v) do {\ |
| 1063 |
a_v = _mm_xor_si128(in_v, c_v);\ |
| 1064 |
\ |
| 1065 |
b_v = _mm_srli_epi16(a_v, 1);\ |
| 1066 |
a_v = _mm_or_si128(a_v, b_v);\ |
| 1067 |
b_v = _mm_and_si128(a_v, cfg->fm_m01);\ |
| 1068 |
\ |
| 1069 |
out_v = _mm_subs_epi8(cfg->fm_m01,b_v);\ |
| 1070 |
} while (0) |
| 1071 |
|
| 1072 |
|
| 1073 |
|
| 1074 |
|
| 1075 |
|
| 1076 |
|
| 1077 |
|
| 1078 |
|
| 1079 |
|
| 1080 |
|
| 1081 |
|
| 1082 |
|
| 1083 |
|
| 1084 |
|
| 1085 |
|
| 1086 |
#define FM_COUNT_2BIT(a_v, b_v, cnts_v) do {\ |
| 1087 |
b_v = _mm_srli_epi16(a_v, 4);\ |
| 1088 |
a_v = _mm_add_epi16(a_v, b_v);\ |
| 1089 |
\ |
| 1090 |
b_v = _mm_srli_epi16(a_v, 2);\ |
| 1091 |
a_v = _mm_and_si128(a_v,cfg->fm_m11);\ |
| 1092 |
b_v = _mm_and_si128(b_v,cfg->fm_m11);\ |
| 1093 |
\ |
| 1094 |
cnts_v = _mm_add_epi16(cnts_v, a_v);\ |
| 1095 |
cnts_v = _mm_add_epi16(cnts_v, b_v);\ |
| 1096 |
} while (0) |
| 1097 |
|
| 1098 |
|
| 1099 |
|
| 1100 |
|
| 1101 |
|
| 1102 |
|
| 1103 |
|
| 1104 |
|
| 1105 |
|
| 1106 |
|
| 1107 |
|
| 1108 |
|
| 1109 |
|
| 1110 |
|
| 1111 |
|
| 1112 |
|
| 1113 |
|
| 1114 |
|
| 1115 |
|
| 1116 |
|
| 1117 |
#define FM_MATCH_4BIT(in_v, c_v, out1_v, out2_v) do {\ |
| 1118 |
out1_v = _mm_srli_epi16(in_v, 4);\ |
| 1119 |
out2_v = _mm_and_si128(in_v, cfg->fm_m0f);\ |
| 1120 |
out1_v = _mm_and_si128(out1_v, cfg->fm_m0f);\ |
| 1121 |
\ |
| 1122 |
out1_v = _mm_cmpeq_epi8(out1_v, c_v);\ |
| 1123 |
out2_v = _mm_cmpeq_epi8(out2_v, c_v);\ |
| 1124 |
} while (0) |
| 1125 |
|
| 1126 |
|
| 1127 |
|
| 1128 |
|
| 1129 |
|
| 1130 |
|
| 1131 |
|
| 1132 |
|
| 1133 |
|
| 1134 |
|
| 1135 |
|
| 1136 |
|
| 1137 |
|
| 1138 |
|
| 1139 |
|
| 1140 |
|
| 1141 |
|
| 1142 |
|
| 1143 |
|
| 1144 |
#define FM_LT_4BIT(in_v, c_v, out1_v, out2_v) do {\ |
| 1145 |
out1_v = _mm_srli_epi16(in_v, 4);\ |
| 1146 |
out2_v = _mm_and_si128(in_v, cfg->fm_m0f);\ |
| 1147 |
out1_v = _mm_and_si128(out1_v, cfg->fm_m0f);\ |
| 1148 |
\ |
| 1149 |
out1_v = _mm_cmplt_epi8(out1_v, c_v);\ |
| 1150 |
out2_v = _mm_cmplt_epi8(out2_v, c_v);\ |
| 1151 |
} while (0) |
| 1152 |
|
| 1153 |
|
| 1154 |
|
| 1155 |
|
| 1156 |
|
| 1157 |
|
| 1158 |
|
| 1159 |
|
| 1160 |
|
| 1161 |
|
| 1162 |
|
| 1163 |
|
| 1164 |
#define FM_COUNT_4BIT(in1_v, in2_v, cnts_v) do {\ |
| 1165 |
cnts_v = _mm_subs_epi8(cnts_v, in1_v);\ |
| 1166 |
cnts_v = _mm_subs_epi8(cnts_v, in2_v);\ |
| 1167 |
} while (0) |
| 1168 |
|
| 1169 |
|
| 1170 |
#endif |
| 1171 |
|
| 1172 |
|
| 1173 |
|
| 1174 |
|
| 1175 |
|
| 1176 |
enum p7_pipemodes_e { p7_SEARCH_SEQS = 0, p7_SCAN_MODELS = 1 }; |
| 1177 |
enum p7_zsetby_e { p7_ZSETBY_NTARGETS = 0, p7_ZSETBY_OPTION = 1, p7_ZSETBY_FILEINFO = 2 }; |
| 1178 |
enum p7_complementarity_e { p7_NOCOMPLEMENT = 0, p7_COMPLEMENT = 1 }; |
| 1179 |
|
| 1180 |
typedef struct p7_pipeline_s { |
| 1181 |
|
| 1182 |
P7_OMX *oxf; |
| 1183 |
P7_OMX *oxb; |
| 1184 |
P7_OMX *fwd; |
| 1185 |
P7_OMX *bck; |
| 1186 |
|
| 1187 |
|
| 1188 |
ESL_RANDOMNESS *r; |
| 1189 |
int do_reseeding; |
| 1190 |
int do_alignment_score_calc; |
| 1191 |
P7_DOMAINDEF *ddef; |
| 1192 |
|
| 1193 |
|
| 1194 |
int by_E; |
| 1195 |
double E; |
| 1196 |
double T; |
| 1197 |
int dom_by_E; |
| 1198 |
double domE; |
| 1199 |
double domT; |
| 1200 |
int use_bit_cutoffs; |
| 1201 |
|
| 1202 |
|
| 1203 |
int inc_by_E; |
| 1204 |
double incE; |
| 1205 |
double incT; |
| 1206 |
int incdom_by_E; |
| 1207 |
double incdomE; |
| 1208 |
double incdomT; |
| 1209 |
|
| 1210 |
|
| 1211 |
double Z; |
| 1212 |
double domZ; |
| 1213 |
enum p7_zsetby_e Z_setby; |
| 1214 |
enum p7_zsetby_e domZ_setby; |
| 1215 |
|
| 1216 |
|
| 1217 |
int do_max; |
| 1218 |
double F1; |
| 1219 |
double F2; |
| 1220 |
double F3; |
| 1221 |
int B1; |
| 1222 |
int B2; |
| 1223 |
int B3; |
| 1224 |
int do_biasfilter; |
| 1225 |
int do_null2; |
| 1226 |
|
| 1227 |
|
| 1228 |
uint64_t nmodels; |
| 1229 |
uint64_t nseqs; |
| 1230 |
uint64_t nres; |
| 1231 |
uint64_t nnodes; |
| 1232 |
uint64_t n_past_msv; |
| 1233 |
uint64_t n_past_bias; |
| 1234 |
uint64_t n_past_vit; |
| 1235 |
uint64_t n_past_fwd; |
| 1236 |
uint64_t n_output; |
| 1237 |
uint64_t pos_past_msv; |
| 1238 |
uint64_t pos_past_bias; |
| 1239 |
uint64_t pos_past_vit; |
| 1240 |
uint64_t pos_past_fwd; |
| 1241 |
uint64_t pos_output; |
| 1242 |
|
| 1243 |
enum p7_pipemodes_e mode; |
| 1244 |
int long_targets; |
| 1245 |
int strands; |
| 1246 |
int W; |
| 1247 |
int block_length; |
| 1248 |
|
| 1249 |
int show_accessions; |
| 1250 |
int show_alignments; |
| 1251 |
|
| 1252 |
P7_HMMFILE *hfp; |
| 1253 |
char errbuf[eslERRBUFSIZE]; |
| 1254 |
} P7_PIPELINE; |
| 1255 |
|
| 1256 |
|
| 1257 |
|
| 1258 |
|
| 1259 |
|
| 1260 |
|
| 1261 |
|
| 1262 |
#define p7_DEFAULT_WINDOW_BETA 1e-7 |
| 1263 |
|
| 1264 |
enum p7_archchoice_e { p7_ARCH_FAST = 0, p7_ARCH_HAND = 1 }; |
| 1265 |
enum p7_wgtchoice_e { p7_WGT_NONE = 0, p7_WGT_GIVEN = 1, p7_WGT_GSC = 2, p7_WGT_PB = 3, p7_WGT_BLOSUM = 4 }; |
| 1266 |
enum p7_effnchoice_e { p7_EFFN_NONE = 0, p7_EFFN_SET = 1, p7_EFFN_CLUST = 2, p7_EFFN_ENTROPY = 3, p7_EFFN_ENTROPY_EXP = 4 }; |
| 1267 |
|
| 1268 |
typedef struct p7_builder_s { |
| 1269 |
|
| 1270 |
enum p7_archchoice_e arch_strategy; |
| 1271 |
float symfrac; |
| 1272 |
float fragthresh; |
| 1273 |
|
| 1274 |
|
| 1275 |
enum p7_wgtchoice_e wgt_strategy; |
| 1276 |
double wid; |
| 1277 |
|
| 1278 |
|
| 1279 |
enum p7_effnchoice_e effn_strategy; |
| 1280 |
double re_target; |
| 1281 |
double esigma; |
| 1282 |
double eid; |
| 1283 |
double eset; |
| 1284 |
|
| 1285 |
|
| 1286 |
ESL_RANDOMNESS *r; |
| 1287 |
int do_reseeding; |
| 1288 |
|
| 1289 |
|
| 1290 |
int EmL; |
| 1291 |
int EmN; |
| 1292 |
int EvL; |
| 1293 |
int EvN; |
| 1294 |
int EfL; |
| 1295 |
int EfN; |
| 1296 |
double Eft; |
| 1297 |
|
| 1298 |
|
| 1299 |
P7_PRIOR *prior; |
| 1300 |
int max_insert_len; |
| 1301 |
|
| 1302 |
|
| 1303 |
ESL_SCOREMATRIX *S; |
| 1304 |
ESL_DMATRIX *Q; |
| 1305 |
double popen; |
| 1306 |
double pextend; |
| 1307 |
|
| 1308 |
double w_beta; |
| 1309 |
int w_len; |
| 1310 |
|
| 1311 |
const ESL_ALPHABET *abc; |
| 1312 |
char errbuf[eslERRBUFSIZE]; |
| 1313 |
} P7_BUILDER; |
| 1314 |
|
| 1315 |
|
| 1316 |
|
| 1317 |
|
| 1318 |
|
| 1319 |
|
| 1320 |
|
| 1321 |
|
| 1322 |
extern int p7_Handmodelmaker(ESL_MSA *msa, P7_BUILDER *bld, P7_HMM **ret_hmm, P7_TRACE ***ret_tr); |
| 1323 |
extern int p7_Fastmodelmaker(ESL_MSA *msa, float symfrac, P7_BUILDER *bld, P7_HMM **ret_hmm, P7_TRACE ***ret_tr); |
| 1324 |
|
| 1325 |
|
| 1326 |
extern int p7_CoreEmit (ESL_RANDOMNESS *r, const P7_HMM *hmm, ESL_SQ *sq, P7_TRACE *tr); |
| 1327 |
extern int p7_ProfileEmit(ESL_RANDOMNESS *r, const P7_HMM *hmm, const P7_PROFILE *gm, const P7_BG *bg, ESL_SQ *sq, P7_TRACE *tr); |
| 1328 |
extern int p7_emit_SimpleConsensus(const P7_HMM *hmm, ESL_SQ *sq); |
| 1329 |
extern int p7_emit_FancyConsensus (const P7_HMM *hmm, float min_lower, float min_upper, ESL_SQ *sq); |
| 1330 |
|
| 1331 |
|
| 1332 |
extern void p7_Die (char *format, ...); |
| 1333 |
extern void p7_Fail(char *format, ...); |
| 1334 |
|
| 1335 |
|
| 1336 |
extern int p7_Calibrate(P7_HMM *hmm, P7_BUILDER *cfg_b, ESL_RANDOMNESS **byp_rng, P7_BG **byp_bg, P7_PROFILE **byp_gm, P7_OPROFILE **byp_om); |
| 1337 |
extern int p7_Lambda(P7_HMM *hmm, P7_BG *bg, double *ret_lambda); |
| 1338 |
extern int p7_MSVMu (ESL_RANDOMNESS *r, P7_OPROFILE *om, P7_BG *bg, int L, int N, double lambda, double *ret_mmu); |
| 1339 |
extern int p7_ViterbiMu (ESL_RANDOMNESS *r, P7_OPROFILE *om, P7_BG *bg, int L, int N, double lambda, double *ret_vmu); |
| 1340 |
extern int p7_Tau (ESL_RANDOMNESS *r, P7_OPROFILE *om, P7_BG *bg, int L, int N, double lambda, double tailp, double *ret_tau); |
| 1341 |
|
| 1342 |
|
| 1343 |
extern int p7_EntropyWeight(const P7_HMM *hmm, const P7_BG *bg, const P7_PRIOR *pri, double infotarget, double *ret_Neff); |
| 1344 |
|
| 1345 |
extern int p7_EntropyWeight_exp(const P7_HMM *hmm, const P7_BG *bg, const P7_PRIOR *pri, double etarget, double *ret_exp); |
| 1346 |
|
| 1347 |
extern int p7_GDecoding (const P7_PROFILE *gm, const P7_GMX *fwd, P7_GMX *bck, P7_GMX *pp); |
| 1348 |
extern int p7_GDomainDecoding(const P7_PROFILE *gm, const P7_GMX *fwd, const P7_GMX *bck, P7_DOMAINDEF *ddef); |
| 1349 |
|
| 1350 |
|
| 1351 |
extern int p7_GForward (const ESL_DSQ *dsq, int L, const P7_PROFILE *gm, P7_GMX *gx, float *ret_sc); |
| 1352 |
extern int p7_GBackward (const ESL_DSQ *dsq, int L, const P7_PROFILE *gm, P7_GMX *gx, float *ret_sc); |
| 1353 |
extern int p7_GHybrid (const ESL_DSQ *dsq, int L, const P7_PROFILE *gm, P7_GMX *gx, float *opt_fwdscore, float *opt_hybscore); |
| 1354 |
|
| 1355 |
|
| 1356 |
extern int p7_GMSV (const ESL_DSQ *dsq, int L, const P7_PROFILE *gm, P7_GMX *gx, float nu, float *ret_sc); |
| 1357 |
extern int p7_GMSV_longtarget(const ESL_DSQ *dsq, int L, P7_PROFILE *gm, P7_GMX *gx, float nu, P7_BG *bg, double P, P7_HMM_WINDOWLIST *windowlist); |
| 1358 |
|
| 1359 |
|
| 1360 |
extern int p7_GNull2_ByExpectation(const P7_PROFILE *gm, P7_GMX *pp, float *null2); |
| 1361 |
extern int p7_GNull2_ByTrace (const P7_PROFILE *gm, const P7_TRACE *tr, int zstart, int zend, P7_GMX *wrk, float *null2); |
| 1362 |
|
| 1363 |
|
| 1364 |
extern int p7_GOptimalAccuracy(const P7_PROFILE *gm, const P7_GMX *pp, P7_GMX *gx, float *ret_e); |
| 1365 |
extern int p7_GOATrace (const P7_PROFILE *gm, const P7_GMX *pp, const P7_GMX *gx, P7_TRACE *tr); |
| 1366 |
|
| 1367 |
|
| 1368 |
extern int p7_GStochasticTrace(ESL_RANDOMNESS *r, const ESL_DSQ *dsq, int L, const P7_PROFILE *gm, const P7_GMX *gx, P7_TRACE *tr); |
| 1369 |
|
| 1370 |
|
| 1371 |
extern int p7_GViterbi (const ESL_DSQ *dsq, int L, const P7_PROFILE *gm, P7_GMX *gx, float *ret_sc); |
| 1372 |
|
| 1373 |
|
| 1374 |
extern int p7_GTrace (const ESL_DSQ *dsq, int L, const P7_PROFILE *gm, const P7_GMX *gx, P7_TRACE *tr); |
| 1375 |
extern int p7_GViterbi_longtarget(const ESL_DSQ *dsq, int L, const P7_PROFILE *gm, P7_GMX *gx, |
| 1376 |
float filtersc, double P, P7_HMM_WINDOWLIST *windowlist); |
| 1377 |
|
| 1378 |
|
| 1379 |
|
| 1380 |
extern double dmx_upper_max(ESL_DMATRIX *D); |
| 1381 |
extern double dmx_upper_min(ESL_DMATRIX *D); |
| 1382 |
extern double dmx_upper_element_sum(ESL_DMATRIX *D); |
| 1383 |
extern double dmx_upper_norm(ESL_DMATRIX *D); |
| 1384 |
extern int dmx_Visualize(FILE *fp, ESL_DMATRIX *D, double min, double max); |
| 1385 |
|
| 1386 |
|
| 1387 |
extern void p7_openlog(const char *ident, int option, int facility); |
| 1388 |
extern void p7_syslog(int priority, const char *format, ...); |
| 1389 |
extern void p7_closelog(void); |
| 1390 |
|
| 1391 |
|
| 1392 |
extern float hmmlogo_maxHeight (P7_BG *bg); |
| 1393 |
extern int hmmlogo_RelativeEntropy_all (P7_HMM *hmm, P7_BG *bg, float *rel_ents, float **probs, float **heights ); |
| 1394 |
extern int hmmlogo_RelativeEntropy_above_bg (P7_HMM *hmm, P7_BG *bg, float *rel_ents, float **probs, float **heights ); |
| 1395 |
extern int hmmlogo_ScoreHeights (P7_HMM *hmm, P7_BG *bg, float **heights ); |
| 1396 |
extern int hmmlogo_IndelValues (P7_HMM *hmm, float *insert_P, float *insert_expL, float *delete_P ); |
| 1397 |
|
| 1398 |
|
| 1399 |
|
| 1400 |
|
| 1401 |
extern int hmmpgmd2msa(void *data, P7_HMM *hmm, ESL_SQ *qsq, int *incl, int incl_size, int *excl, int excl_size, int excl_all, ESL_MSA **ret_msa); |
| 1402 |
|
| 1403 |
|
| 1404 |
|
| 1405 |
|
| 1406 |
extern int p7_island_Viterbi(ESL_DSQ *dsq, int L, P7_PROFILE *gm, P7_GMX *mx, ESL_HISTOGRAM *h); |
| 1407 |
|
| 1408 |
|
| 1409 |
extern int p7_h2io_WriteASCII(FILE *fp, P7_HMM *hmm); |
| 1410 |
|
| 1411 |
|
| 1412 |
extern void p7_banner(FILE *fp, const char *progname, char *banner); |
| 1413 |
extern ESL_GETOPTS *p7_CreateDefaultApp(ESL_OPTIONS *options, int nargs, int argc, char **argv, char *banner, char *usage); |
| 1414 |
extern int p7_AminoFrequencies(float *f); |
| 1415 |
|
| 1416 |
|
| 1417 |
extern int p7_FLogsumInit(void); |
| 1418 |
extern float p7_FLogsum(float a, float b); |
| 1419 |
extern float p7_FLogsumError(float a, float b); |
| 1420 |
extern int p7_ILogsumInit(void); |
| 1421 |
extern int p7_ILogsum(int s1, int s2); |
| 1422 |
|
| 1423 |
|
| 1424 |
|
| 1425 |
extern int p7_ProfileConfig(const P7_HMM *hmm, const P7_BG *bg, P7_PROFILE *gm, int L, int mode); |
| 1426 |
extern int p7_ReconfigLength (P7_PROFILE *gm, int L); |
| 1427 |
extern int p7_ReconfigMultihit(P7_PROFILE *gm, int L); |
| 1428 |
extern int p7_ReconfigUnihit (P7_PROFILE *gm, int L); |
| 1429 |
|
| 1430 |
|
| 1431 |
extern double p7_MeanMatchInfo (const P7_HMM *hmm, const P7_BG *bg); |
| 1432 |
extern double p7_MeanMatchEntropy (const P7_HMM *hmm); |
| 1433 |
extern double p7_MeanMatchRelativeEntropy(const P7_HMM *hmm, const P7_BG *bg); |
| 1434 |
extern double p7_MeanForwardScore (const P7_HMM *hmm, const P7_BG *bg); |
| 1435 |
extern int p7_MeanPositionRelativeEntropy(const P7_HMM *hmm, const P7_BG *bg, double *ret_entropy); |
| 1436 |
extern int p7_hmm_CompositionKLD(const P7_HMM *hmm, const P7_BG *bg, float *ret_KL, float **opt_avp); |
| 1437 |
|
| 1438 |
|
| 1439 |
|
| 1440 |
#ifdef HMMER_MPI |
| 1441 |
extern int p7_hmm_MPISend(P7_HMM *hmm, int dest, int tag, MPI_Comm comm, char **buf, int *nalloc); |
| 1442 |
extern int p7_hmm_MPIPackSize(P7_HMM *hmm, MPI_Comm comm, int *ret_n); |
| 1443 |
extern int p7_hmm_MPIPack(P7_HMM *hmm, char *buf, int n, int *position, MPI_Comm comm); |
| 1444 |
extern int p7_hmm_MPIUnpack(char *buf, int n, int *pos, MPI_Comm comm, ESL_ALPHABET **abc, P7_HMM **ret_hmm); |
| 1445 |
extern int p7_hmm_MPIRecv(int source, int tag, MPI_Comm comm, char **buf, int *nalloc, ESL_ALPHABET **abc, P7_HMM **ret_hmm); |
| 1446 |
|
| 1447 |
extern int p7_profile_MPISend(P7_PROFILE *gm, int dest, int tag, MPI_Comm comm, char **buf, int *nalloc); |
| 1448 |
extern int p7_profile_MPIRecv(int source, int tag, MPI_Comm comm, const ESL_ALPHABET *abc, const P7_BG *bg, |
| 1449 |
char **buf, int *nalloc, P7_PROFILE **ret_gm); |
| 1450 |
|
| 1451 |
extern int p7_pipeline_MPISend(P7_PIPELINE *pli, int dest, int tag, MPI_Comm comm, char **buf, int *nalloc); |
| 1452 |
extern int p7_pipeline_MPIRecv(int source, int tag, MPI_Comm comm, char **buf, int *nalloc, ESL_GETOPTS *go, P7_PIPELINE **ret_pli); |
| 1453 |
|
| 1454 |
extern int p7_tophits_MPISend(P7_TOPHITS *th, int dest, int tag, MPI_Comm comm, char **buf, int *nalloc); |
| 1455 |
extern int p7_tophits_MPIRecv(int source, int tag, MPI_Comm comm, char **buf, int *nalloc, P7_TOPHITS **ret_th); |
| 1456 |
|
| 1457 |
extern int p7_oprofile_MPISend(P7_OPROFILE *om, int dest, int tag, MPI_Comm comm, char **buf, int *nalloc); |
| 1458 |
extern int p7_oprofile_MPIPackSize(P7_OPROFILE *om, MPI_Comm comm, int *ret_n); |
| 1459 |
extern int p7_oprofile_MPIPack(P7_OPROFILE *om, char *buf, int n, int *pos, MPI_Comm comm); |
| 1460 |
extern int p7_oprofile_MPIUnpack(char *buf, int n, int *pos, MPI_Comm comm, ESL_ALPHABET **abc, P7_OPROFILE **ret_om); |
| 1461 |
extern int p7_oprofile_MPIRecv(int source, int tag, MPI_Comm comm, char **buf, int *nalloc, ESL_ALPHABET **abc, P7_OPROFILE **ret_om); |
| 1462 |
#endif |
| 1463 |
|
| 1464 |
|
| 1465 |
extern int p7_tracealign_Seqs(ESL_SQ **sq, P7_TRACE **tr, int nseq, int M, int optflags, P7_HMM *hmm, ESL_MSA **ret_msa); |
| 1466 |
extern int p7_tracealign_MSA (const ESL_MSA *premsa, P7_TRACE **tr, int M, int optflags, ESL_MSA **ret_postmsa); |
| 1467 |
extern int p7_tracealign_computeTraces(P7_HMM *hmm, ESL_SQ **sq, int offset, int N, P7_TRACE **tr); |
| 1468 |
extern int p7_tracealign_getMSAandStats(P7_HMM *hmm, ESL_SQ **sq, int N, ESL_MSA **ret_msa, float **ret_pp, float **ret_relent, float **ret_scores ); |
| 1469 |
|
| 1470 |
|
| 1471 |
extern P7_ALIDISPLAY *p7_alidisplay_Create(const P7_TRACE *tr, int which, const P7_OPROFILE *om, const ESL_SQ *sq, const ESL_SQ *ntsq); |
| 1472 |
extern P7_ALIDISPLAY *p7_alidisplay_Create_empty(); |
| 1473 |
extern P7_ALIDISPLAY *p7_alidisplay_Clone(const P7_ALIDISPLAY *ad); |
| 1474 |
extern size_t p7_alidisplay_Sizeof(const P7_ALIDISPLAY *ad); |
| 1475 |
extern int p7_alidisplay_Serialize(const P7_ALIDISPLAY *obj, uint8_t **buf, uint32_t *n, uint32_t *nalloc); |
| 1476 |
extern int p7_alidisplay_Deserialize(const uint8_t *buf, uint32_t *n, P7_ALIDISPLAY *ret_obj); |
| 1477 |
extern int p7_alidisplay_Serialize_old(P7_ALIDISPLAY *ad); |
| 1478 |
extern int p7_alidisplay_Deserialize_old(P7_ALIDISPLAY *ad); |
| 1479 |
extern void p7_alidisplay_Destroy(P7_ALIDISPLAY *ad); |
| 1480 |
extern char p7_alidisplay_EncodePostProb(float p); |
| 1481 |
extern float p7_alidisplay_DecodePostProb(char pc); |
| 1482 |
extern char p7_alidisplay_EncodeAliPostProb(float p, float hi, float med, float lo); |
| 1483 |
|
| 1484 |
extern int p7_alidisplay_Print(FILE *fp, P7_ALIDISPLAY *ad, int min_aliwidth, int linewidth, P7_PIPELINE *pli); |
| 1485 |
extern int p7_translated_alidisplay_Print(FILE *fp, P7_ALIDISPLAY *ad, int min_aliwidth, int linewidth, P7_PIPELINE *pli); |
| 1486 |
extern int p7_nontranslated_alidisplay_Print(FILE *fp, P7_ALIDISPLAY *ad, int min_aliwidth, int linewidth, int show_accessions); |
| 1487 |
|
| 1488 |
extern int p7_alidisplay_Backconvert(const P7_ALIDISPLAY *ad, const ESL_ALPHABET *abc, ESL_SQ **ret_sq, P7_TRACE **ret_tr); |
| 1489 |
extern int p7_alidisplay_Sample(ESL_RANDOMNESS *rng, int N, P7_ALIDISPLAY **ret_ad); |
| 1490 |
extern int p7_alidisplay_Dump(FILE *fp, const P7_ALIDISPLAY *ad); |
| 1491 |
extern int p7_alidisplay_Compare(const P7_ALIDISPLAY *ad1, const P7_ALIDISPLAY *ad2); |
| 1492 |
|
| 1493 |
|
| 1494 |
extern P7_BG *p7_bg_Create(const ESL_ALPHABET *abc); |
| 1495 |
extern P7_BG *p7_bg_CreateUniform(const ESL_ALPHABET *abc); |
| 1496 |
extern P7_BG *p7_bg_Clone(const P7_BG *bg); |
| 1497 |
extern int p7_bg_Dump(FILE *ofp, const P7_BG *bg); |
| 1498 |
extern void p7_bg_Destroy(P7_BG *bg); |
| 1499 |
extern int p7_bg_SetLength(P7_BG *bg, int L); |
| 1500 |
extern int p7_bg_NullOne(const P7_BG *bg, const ESL_DSQ *dsq, int L, float *ret_sc); |
| 1501 |
|
| 1502 |
extern int p7_bg_Read(char *bgfile, P7_BG *bg, char *errbuf); |
| 1503 |
extern int p7_bg_Write(FILE *fp, P7_BG *bg); |
| 1504 |
|
| 1505 |
extern int p7_bg_SetFilter (P7_BG *bg, int M, const float *compo); |
| 1506 |
extern int p7_bg_FilterScore(P7_BG *bg, const ESL_DSQ *dsq, int L, float *ret_sc); |
| 1507 |
|
| 1508 |
|
| 1509 |
extern P7_BUILDER *p7_builder_Create(const ESL_GETOPTS *go, const ESL_ALPHABET *abc); |
| 1510 |
extern int p7_builder_LoadScoreSystem(P7_BUILDER *bld, const char *matrix, double popen, double pextend, P7_BG *bg); |
| 1511 |
extern int p7_builder_SetScoreSystem (P7_BUILDER *bld, const char *mxfile, const char *env, double popen, double pextend, P7_BG *bg); |
| 1512 |
extern void p7_builder_Destroy(P7_BUILDER *bld); |
| 1513 |
|
| 1514 |
extern int p7_Builder (P7_BUILDER *bld, ESL_MSA *msa, P7_BG *bg, P7_HMM **opt_hmm, P7_TRACE ***opt_trarr, P7_PROFILE **opt_gm, P7_OPROFILE **opt_om, ESL_MSA **opt_postmsa); |
| 1515 |
extern int p7_SingleBuilder(P7_BUILDER *bld, ESL_SQ *sq, P7_BG *bg, P7_HMM **opt_hmm, P7_TRACE **opt_tr, P7_PROFILE **opt_gm, P7_OPROFILE **opt_om); |
| 1516 |
extern int p7_Builder_MaxLength (P7_HMM *hmm, double emit_thresh); |
| 1517 |
|
| 1518 |
|
| 1519 |
extern P7_DOMAIN *p7_domain_Create_empty(); |
| 1520 |
extern void p7_domain_Destroy(P7_DOMAIN *obj); |
| 1521 |
extern int p7_domain_Copy(const P7_DOMAIN *src, P7_DOMAIN *dst); |
| 1522 |
extern int p7_domain_Serialize(const P7_DOMAIN *obj, uint8_t **buf, uint32_t *n, uint32_t *nalloc); |
| 1523 |
extern int p7_domain_Deserialize(const uint8_t *buf, uint32_t *n, P7_DOMAIN *ret_obj); |
| 1524 |
extern int p7_domain_TestSample(ESL_RAND64 *rng, P7_DOMAIN **ret_obj); |
| 1525 |
extern int p7_domain_Compare(P7_DOMAIN *first, P7_DOMAIN *second, double atol, double rtol); |
| 1526 |
|
| 1527 |
|
| 1528 |
extern P7_DOMAINDEF *p7_domaindef_Create (ESL_RANDOMNESS *r); |
| 1529 |
extern int p7_domaindef_Fetch (P7_DOMAINDEF *ddef, int which, int *opt_i, int *opt_j, float *opt_sc, P7_ALIDISPLAY **opt_ad); |
| 1530 |
extern int p7_domaindef_GrowTo (P7_DOMAINDEF *ddef, int L); |
| 1531 |
extern int p7_domaindef_Reuse (P7_DOMAINDEF *ddef); |
| 1532 |
extern int p7_domaindef_DumpPosteriors(FILE *ofp, P7_DOMAINDEF *ddef); |
| 1533 |
extern void p7_domaindef_Destroy(P7_DOMAINDEF *ddef); |
| 1534 |
|
| 1535 |
extern int p7_domaindef_ByViterbi (P7_PROFILE *gm, const ESL_SQ *sq, const ESL_SQ *ntsq, P7_GMX *gx1, P7_GMX *gx2, P7_DOMAINDEF *ddef); |
| 1536 |
extern int p7_domaindef_ByPosteriorHeuristics(const ESL_SQ *sq, const ESL_SQ *ntsq, P7_OPROFILE *om, P7_OMX *oxf, P7_OMX *oxb, P7_OMX *fwd, P7_OMX *bck, |
| 1537 |
P7_DOMAINDEF *ddef, P7_BG *bg, int long_target, |
| 1538 |
P7_BG *bg_tmp, float *scores_arr, float *fwd_emissions_arr); |
| 1539 |
|
| 1540 |
|
| 1541 |
|
| 1542 |
extern P7_GMX *p7_gmx_Create (int allocM, int allocL); |
| 1543 |
extern int p7_gmx_GrowTo (P7_GMX *gx, int allocM, int allocL); |
| 1544 |
extern size_t p7_gmx_Sizeof (P7_GMX *gx); |
| 1545 |
extern int p7_gmx_Reuse (P7_GMX *gx); |
| 1546 |
extern void p7_gmx_Destroy(P7_GMX *gx); |
| 1547 |
extern int p7_gmx_Compare(P7_GMX *gx1, P7_GMX *gx2, float tolerance); |
| 1548 |
extern int p7_gmx_Dump(FILE *fp, P7_GMX *gx, int flags); |
| 1549 |
extern int p7_gmx_DumpWindow(FILE *fp, P7_GMX *gx, int istart, int iend, int kstart, int kend, int show_specials); |
| 1550 |
|
| 1551 |
|
| 1552 |
extern P7_HIT *p7_hit_Create_empty(); |
| 1553 |
extern void p7_hit_Destroy(P7_HIT *the_hit); |
| 1554 |
extern int p7_hit_Copy(const P7_HIT *src, P7_HIT *dst); |
| 1555 |
extern int p7_hit_Serialize(const P7_HIT *obj, uint8_t **buf, uint32_t *n, uint32_t *nalloc); |
| 1556 |
extern int p7_hit_Deserialize(const uint8_t *buf, uint32_t *n, P7_HIT *ret_obj); |
| 1557 |
extern int p7_hit_TestSample(ESL_RAND64 *rng, P7_HIT **ret_obj); |
| 1558 |
extern int p7_hit_Compare(P7_HIT *first, P7_HIT *second, double atol, double rtol); |
| 1559 |
|
| 1560 |
|
| 1561 |
|
| 1562 |
extern P7_HMM *p7_hmm_Create(int M, const ESL_ALPHABET *abc); |
| 1563 |
extern P7_HMM *p7_hmm_CreateShell(void); |
| 1564 |
extern int p7_hmm_CreateBody(P7_HMM *hmm, int M, const ESL_ALPHABET *abc); |
| 1565 |
extern void p7_hmm_Destroy(P7_HMM *hmm); |
| 1566 |
extern int p7_hmm_CopyParameters(const P7_HMM *src, P7_HMM *dest); |
| 1567 |
extern P7_HMM *p7_hmm_Clone(const P7_HMM *hmm); |
| 1568 |
extern int p7_hmm_Zero(P7_HMM *hmm); |
| 1569 |
extern char p7_hmm_EncodeStatetype(char *typestring); |
| 1570 |
extern char *p7_hmm_DecodeStatetype(char st); |
| 1571 |
|
| 1572 |
extern int p7_hmm_SetName (P7_HMM *hmm, char *name); |
| 1573 |
extern int p7_hmm_SetAccession (P7_HMM *hmm, char *acc); |
| 1574 |
extern int p7_hmm_SetDescription(P7_HMM *hmm, char *desc); |
| 1575 |
extern int p7_hmm_AppendComlog (P7_HMM *hmm, int argc, char **argv); |
| 1576 |
extern int p7_hmm_SetCtime (P7_HMM *hmm); |
| 1577 |
extern int p7_hmm_SetComposition(P7_HMM *hmm); |
| 1578 |
extern int p7_hmm_SetConsensus (P7_HMM *hmm, ESL_SQ *sq); |
| 1579 |
|
| 1580 |
extern int p7_hmm_Scale (P7_HMM *hmm, double scale); |
| 1581 |
extern int p7_hmm_ScaleExponential(P7_HMM *hmm, double exp); |
| 1582 |
extern int p7_hmm_Renormalize(P7_HMM *hmm); |
| 1583 |
|
| 1584 |
extern int p7_hmm_Dump(FILE *fp, P7_HMM *hmm); |
| 1585 |
extern int p7_hmm_Sample (ESL_RANDOMNESS *r, int M, const ESL_ALPHABET *abc, P7_HMM **ret_hmm); |
| 1586 |
extern int p7_hmm_SampleUngapped (ESL_RANDOMNESS *r, int M, const ESL_ALPHABET *abc, P7_HMM **ret_hmm); |
| 1587 |
extern int p7_hmm_SampleEnumerable(ESL_RANDOMNESS *r, int M, const ESL_ALPHABET *abc, P7_HMM **ret_hmm); |
| 1588 |
extern int p7_hmm_SampleUniform (ESL_RANDOMNESS *r, int M, const ESL_ALPHABET *abc, |
| 1589 |
float tmi, float tii, float tmd, float tdd, P7_HMM **ret_hmm); |
| 1590 |
extern int p7_hmm_Compare(P7_HMM *h1, P7_HMM *h2, float tol); |
| 1591 |
extern int p7_hmm_Validate(P7_HMM *hmm, char *errbuf, float tol); |
| 1592 |
|
| 1593 |
extern int p7_hmm_CalculateOccupancy(const P7_HMM *hmm, float *mocc, float *iocc); |
| 1594 |
|
| 1595 |
|
| 1596 |
|
| 1597 |
|
| 1598 |
extern int p7_hmmfile_Open (const char *filename, char *env, P7_HMMFILE **ret_hfp, char *errbuf); |
| 1599 |
extern int p7_hmmfile_OpenNoDB (const char *filename, char *env, P7_HMMFILE **ret_hfp, char *errbuf); |
| 1600 |
extern int p7_hmmfile_OpenBuffer(const char *buffer, int size, P7_HMMFILE **ret_hfp); |
| 1601 |
extern void p7_hmmfile_Close(P7_HMMFILE *hfp); |
| 1602 |
#ifdef HMMER_THREADS |
| 1603 |
extern int p7_hmmfile_CreateLock(P7_HMMFILE *hfp); |
| 1604 |
#endif |
| 1605 |
extern int p7_hmmfile_WriteBinary(FILE *fp, int format, P7_HMM *hmm); |
| 1606 |
extern int p7_hmmfile_WriteASCII (FILE *fp, int format, P7_HMM *hmm); |
| 1607 |
extern int p7_hmmfile_WriteToString (char **s, int format, P7_HMM *hmm); |
| 1608 |
extern int p7_hmmfile_Read(P7_HMMFILE *hfp, ESL_ALPHABET **ret_abc, P7_HMM **opt_hmm); |
| 1609 |
extern int p7_hmmfile_PositionByKey(P7_HMMFILE *hfp, const char *key); |
| 1610 |
extern int p7_hmmfile_Position(P7_HMMFILE *hfp, const off_t offset); |
| 1611 |
|
| 1612 |
|
| 1613 |
|
| 1614 |
int p7_hmmwindow_init (P7_HMM_WINDOWLIST *list); |
| 1615 |
P7_HMM_WINDOW *p7_hmmwindow_new (P7_HMM_WINDOWLIST *list, uint32_t id, uint32_t pos, uint32_t fm_pos, uint16_t k, uint32_t length, float score, uint8_t complementarity, uint32_t target_len); |
| 1616 |
|
| 1617 |
|
| 1618 |
|
| 1619 |
|
| 1620 |
extern P7_SCOREDATA *p7_hmm_ScoreDataCreate(P7_OPROFILE *om, P7_PROFILE *gm ); |
| 1621 |
extern P7_SCOREDATA *p7_hmm_ScoreDataClone(P7_SCOREDATA *src, int K); |
| 1622 |
extern int p7_hmm_ScoreDataComputeRest(P7_OPROFILE *om, P7_SCOREDATA *data ); |
| 1623 |
extern void p7_hmm_ScoreDataDestroy( P7_SCOREDATA *data ); |
| 1624 |
extern int p7_hmm_initWindows (P7_HMM_WINDOWLIST *list); |
| 1625 |
extern P7_HMM_WINDOW *p7_hmm_newWindow (P7_HMM_WINDOWLIST *list, uint32_t id, uint32_t pos, uint32_t fm_pos, uint16_t k, uint32_t length, float score, uint8_t complementarity); |
| 1626 |
|
| 1627 |
|
| 1628 |
|
| 1629 |
|
| 1630 |
extern void p7_null3_score(const ESL_ALPHABET *abc, const ESL_DSQ *dsq, P7_TRACE *tr, int start, int stop, P7_BG *bg, float *ret_sc); |
| 1631 |
extern void p7_null3_windowed_score(const ESL_ALPHABET *abc, const ESL_DSQ *dsq, int start, int stop, P7_BG *bg, float *ret_sc); |
| 1632 |
|
| 1633 |
|
| 1634 |
extern P7_PIPELINE *p7_pipeline_Create(const ESL_GETOPTS *go, int M_hint, int L_hint, int long_targets, enum p7_pipemodes_e mode); |
| 1635 |
extern int p7_pipeline_Reuse (P7_PIPELINE *pli); |
| 1636 |
extern void p7_pipeline_Destroy(P7_PIPELINE *pli); |
| 1637 |
extern int p7_pipeline_Merge (P7_PIPELINE *p1, P7_PIPELINE *p2); |
| 1638 |
|
| 1639 |
extern int p7_pli_ExtendAndMergeWindows (P7_OPROFILE *om, const P7_SCOREDATA *msvdata, P7_HMM_WINDOWLIST *windowlist, float pct_overlap); |
| 1640 |
extern int p7_pli_TargetReportable (P7_PIPELINE *pli, float score, double lnP); |
| 1641 |
extern int p7_pli_DomainReportable (P7_PIPELINE *pli, float dom_score, double lnP); |
| 1642 |
|
| 1643 |
extern int p7_pli_TargetIncludable (P7_PIPELINE *pli, float score, double lnP); |
| 1644 |
extern int p7_pli_DomainIncludable (P7_PIPELINE *pli, float dom_score, double lnP); |
| 1645 |
extern int p7_pli_NewModel (P7_PIPELINE *pli, const P7_OPROFILE *om, P7_BG *bg); |
| 1646 |
extern int p7_pli_NewModelThresholds(P7_PIPELINE *pli, const P7_OPROFILE *om); |
| 1647 |
extern int p7_pli_NewSeq (P7_PIPELINE *pli, const ESL_SQ *sq); |
| 1648 |
extern int p7_Pipeline (P7_PIPELINE *pli, P7_OPROFILE *om, P7_BG *bg, const ESL_SQ *sq, const ESL_SQ *ntsq, P7_TOPHITS *th); |
| 1649 |
extern int p7_Pipeline_LongTarget (P7_PIPELINE *pli, P7_OPROFILE *om, P7_SCOREDATA *data, |
| 1650 |
P7_BG *bg, P7_TOPHITS *hitlist, int64_t seqidx, |
| 1651 |
const ESL_SQ *sq, int complementarity, |
| 1652 |
const FM_DATA *fmf, const FM_DATA *fmb, FM_CFG *fm_cfg |
| 1653 |
); |
| 1654 |
|
| 1655 |
|
| 1656 |
|
| 1657 |
extern int p7_pli_Statistics(FILE *ofp, P7_PIPELINE *pli, ESL_STOPWATCH *w); |
| 1658 |
|
| 1659 |
|
| 1660 |
|
| 1661 |
extern P7_PRIOR *p7_prior_CreateAmino(void); |
| 1662 |
extern P7_PRIOR *p7_prior_CreateNucleic(void); |
| 1663 |
extern P7_PRIOR *p7_prior_CreateLaplace(const ESL_ALPHABET *abc); |
| 1664 |
extern void p7_prior_Destroy(P7_PRIOR *pri); |
| 1665 |
|
| 1666 |
extern int p7_ParameterEstimation(P7_HMM *hmm, const P7_PRIOR *pri); |
| 1667 |
|
| 1668 |
|
| 1669 |
extern P7_PROFILE *p7_profile_Create(int M, const ESL_ALPHABET *abc); |
| 1670 |
extern P7_PROFILE *p7_profile_Clone(const P7_PROFILE *gm); |
| 1671 |
extern int p7_profile_Copy(const P7_PROFILE *src, P7_PROFILE *dst); |
| 1672 |
extern int p7_profile_SetNullEmissions(P7_PROFILE *gm); |
| 1673 |
extern int p7_profile_Reuse(P7_PROFILE *gm); |
| 1674 |
extern size_t p7_profile_Sizeof(P7_PROFILE *gm); |
| 1675 |
extern void p7_profile_Destroy(P7_PROFILE *gm); |
| 1676 |
extern int p7_profile_IsLocal(const P7_PROFILE *gm); |
| 1677 |
extern int p7_profile_IsMultihit(const P7_PROFILE *gm); |
| 1678 |
extern int p7_profile_GetT(const P7_PROFILE *gm, char st1, int k1, |
| 1679 |
char st2, int k2, float *ret_tsc); |
| 1680 |
extern int p7_profile_Validate(const P7_PROFILE *gm, char *errbuf, float tol); |
| 1681 |
extern int p7_profile_Compare(P7_PROFILE *gm1, P7_PROFILE *gm2, float tol); |
| 1682 |
|
| 1683 |
|
| 1684 |
P7_SPENSEMBLE *p7_spensemble_Create(int init_n, int init_epc, int init_sigc); |
| 1685 |
extern int p7_spensemble_Reuse(P7_SPENSEMBLE *sp); |
| 1686 |
extern int p7_spensemble_Add(P7_SPENSEMBLE *sp, int sampleidx, int i, int j, int k, int m); |
| 1687 |
extern int p7_spensemble_Cluster(P7_SPENSEMBLE *sp, |
| 1688 |
float min_overlap, int of_smaller, int max_diagdiff, |
| 1689 |
float min_posterior, float min_endpointp, |
| 1690 |
int *ret_nclusters); |
| 1691 |
extern int p7_spensemble_GetClusterCoords(P7_SPENSEMBLE *sp, int which, |
| 1692 |
int *ret_i, int *ret_j, int *ret_k, int *ret_m, float *ret_p); |
| 1693 |
extern void p7_spensemble_Destroy(P7_SPENSEMBLE *sp); |
| 1694 |
|
| 1695 |
|
| 1696 |
extern P7_TOPHITS *p7_tophits_Create(void); |
| 1697 |
extern int p7_tophits_Grow(P7_TOPHITS *h); |
| 1698 |
extern P7_TOPHITS *p7_tophits_Clone(const P7_TOPHITS *h); |
| 1699 |
extern int p7_tophits_CreateNextHit(P7_TOPHITS *h, P7_HIT **ret_hit); |
| 1700 |
extern int p7_tophits_Add(P7_TOPHITS *h, |
| 1701 |
char *name, char *acc, char *desc, |
| 1702 |
double sortkey, |
| 1703 |
float score, double lnP, |
| 1704 |
float mothersc, double mother_lnP, |
| 1705 |
int sqfrom, int sqto, int sqlen, |
| 1706 |
int hmmfrom, int hmmto, int hmmlen, |
| 1707 |
int domidx, int ndom, |
| 1708 |
P7_ALIDISPLAY *ali); |
| 1709 |
extern int p7_tophits_SortBySortkey(P7_TOPHITS *h); |
| 1710 |
extern int p7_tophits_SortBySeqidxAndAlipos(P7_TOPHITS *h); |
| 1711 |
extern int p7_tophits_SortByModelnameAndAlipos(P7_TOPHITS *h); |
| 1712 |
|
| 1713 |
extern int p7_tophits_Merge(P7_TOPHITS *h1, P7_TOPHITS *h2); |
| 1714 |
extern int p7_tophits_GetMaxPositionLength(P7_TOPHITS *h); |
| 1715 |
extern int p7_tophits_GetMaxNameLength(P7_TOPHITS *h); |
| 1716 |
extern int p7_tophits_GetMaxAccessionLength(P7_TOPHITS *h); |
| 1717 |
extern int p7_tophits_GetMaxShownLength(P7_TOPHITS *h); |
| 1718 |
extern void p7_tophits_Destroy(P7_TOPHITS *h); |
| 1719 |
|
| 1720 |
extern int p7_tophits_ComputeNhmmerEvalues(P7_TOPHITS *th, double N, int W); |
| 1721 |
extern int p7_tophits_RemoveDuplicates(P7_TOPHITS *th, int using_bit_cutoffs); |
| 1722 |
extern int p7_tophits_Threshold(P7_TOPHITS *th, P7_PIPELINE *pli); |
| 1723 |
extern int p7_tophits_CompareRanking(P7_TOPHITS *th, ESL_KEYHASH *kh, int *opt_nnew); |
| 1724 |
extern int p7_tophits_Targets(FILE *ofp, P7_TOPHITS *th, P7_PIPELINE *pli, int textw); |
| 1725 |
extern int p7_tophits_Domains(FILE *ofp, P7_TOPHITS *th, P7_PIPELINE *pli, int textw); |
| 1726 |
|
| 1727 |
|
| 1728 |
extern int p7_tophits_Alignment(const P7_TOPHITS *th, const ESL_ALPHABET *abc, |
| 1729 |
ESL_SQ **inc_sqarr, P7_TRACE **inc_trarr, int inc_n, int optflags, |
| 1730 |
ESL_MSA **ret_msa); |
| 1731 |
extern int p7_tophits_TabularTargets(FILE *ofp, char *qname, char *qacc, P7_TOPHITS *th, P7_PIPELINE *pli, int show_header); |
| 1732 |
extern int p7_tophits_TabularDomains(FILE *ofp, char *qname, char *qacc, P7_TOPHITS *th, P7_PIPELINE *pli, int show_header); |
| 1733 |
extern int p7_tophits_TabularXfam(FILE *ofp, char *qname, char *qacc, P7_TOPHITS *th, P7_PIPELINE *pli); |
| 1734 |
extern int p7_tophits_TabularTail(FILE *ofp, const char *progname, enum p7_pipemodes_e pipemode, |
| 1735 |
const char *qfile, const char *tfile, const ESL_GETOPTS *go); |
| 1736 |
extern int p7_tophits_AliScores(FILE *ofp, char *qname, P7_TOPHITS *th ); |
| 1737 |
|
| 1738 |
|
| 1739 |
extern P7_TRACE *p7_trace_Create(void); |
| 1740 |
extern P7_TRACE *p7_trace_CreateWithPP(void); |
| 1741 |
extern int p7_trace_Reuse(P7_TRACE *tr); |
| 1742 |
extern int p7_trace_Grow(P7_TRACE *tr); |
| 1743 |
extern int p7_trace_GrowIndex(P7_TRACE *tr); |
| 1744 |
extern int p7_trace_GrowTo(P7_TRACE *tr, int N); |
| 1745 |
extern int p7_trace_GrowIndexTo(P7_TRACE *tr, int ndom); |
| 1746 |
extern void p7_trace_Destroy(P7_TRACE *tr); |
| 1747 |
extern void p7_trace_DestroyArray(P7_TRACE **tr, int N); |
| 1748 |
|
| 1749 |
extern int p7_trace_GetDomainCount (const P7_TRACE *tr, int *ret_ndom); |
| 1750 |
extern int p7_trace_GetStateUseCounts(const P7_TRACE *tr, int *counts); |
| 1751 |
extern int p7_trace_GetDomainCoords (const P7_TRACE *tr, int which, int *ret_i1, int *ret_i2, |
| 1752 |
int *ret_k1, int *ret_k2); |
| 1753 |
|
| 1754 |
extern int p7_trace_Validate(const P7_TRACE *tr, const ESL_ALPHABET *abc, const ESL_DSQ *dsq, char *errbuf); |
| 1755 |
extern int p7_trace_Dump(FILE *fp, const P7_TRACE *tr, const P7_PROFILE *gm, const ESL_DSQ *dsq); |
| 1756 |
extern int p7_trace_Compare(P7_TRACE *tr1, P7_TRACE *tr2, float pptol); |
| 1757 |
extern int p7_trace_Score(P7_TRACE *tr, ESL_DSQ *dsq, P7_PROFILE *gm, float *ret_sc); |
| 1758 |
extern int p7_trace_SetPP(P7_TRACE *tr, const P7_GMX *pp); |
| 1759 |
extern float p7_trace_GetExpectedAccuracy(const P7_TRACE *tr); |
| 1760 |
|
| 1761 |
extern int p7_trace_Append(P7_TRACE *tr, char st, int k, int i); |
| 1762 |
extern int p7_trace_AppendWithPP(P7_TRACE *tr, char st, int k, int i, float pp); |
| 1763 |
extern int p7_trace_Reverse(P7_TRACE *tr); |
| 1764 |
extern int p7_trace_Index(P7_TRACE *tr); |
| 1765 |
|
| 1766 |
extern int p7_trace_FauxFromMSA(ESL_MSA *msa, int *matassign, int optflags, P7_TRACE **tr); |
| 1767 |
extern int p7_trace_Doctor(P7_TRACE *tr, int *opt_ndi, int *opt_nid); |
| 1768 |
|
| 1769 |
extern int p7_trace_Count(P7_HMM *hmm, ESL_DSQ *dsq, float wt, P7_TRACE *tr); |
| 1770 |
|
| 1771 |
|
| 1772 |
|
| 1773 |
extern int p7_Seqmodel(const ESL_ALPHABET *abc, ESL_DSQ *dsq, int M, char *name, |
| 1774 |
ESL_DMATRIX *P, float *f, double popen, double pextend, |
| 1775 |
P7_HMM **ret_hmm); |
| 1776 |
|
| 1777 |
|
| 1778 |
extern int fm_alphabetCreate (FM_METADATA *meta, uint8_t *alph_bits); |
| 1779 |
extern int fm_alphabetDestroy (FM_METADATA *meta); |
| 1780 |
extern int fm_reverseString (char *str, int N); |
| 1781 |
extern int fm_getComplement (char c, uint8_t alph_type); |
| 1782 |
|
| 1783 |
|
| 1784 |
|
| 1785 |
extern uint64_t fm_computeSequenceOffset (const FM_DATA *fms, const FM_METADATA *meta, int block, uint64_t pos); |
| 1786 |
extern int fm_getOriginalPosition (const FM_DATA *fms, const FM_METADATA *meta, int fm_id, int length, int direction, uint64_t fm_pos, |
| 1787 |
uint32_t *segment_id, uint64_t *seg_pos); |
| 1788 |
extern int fm_readFMmeta( FM_METADATA *meta); |
| 1789 |
extern int fm_FM_read( FM_DATA *fm, FM_METADATA *meta, int getAll ); |
| 1790 |
extern void fm_FM_destroy ( FM_DATA *fm, int isMainFM); |
| 1791 |
extern uint8_t fm_getChar(uint8_t alph_type, int j, const uint8_t *B ); |
| 1792 |
extern int fm_getSARangeReverse( const FM_DATA *fm, FM_CFG *cfg, char *query, char *inv_alph, FM_INTERVAL *interval); |
| 1793 |
extern int fm_getSARangeForward( const FM_DATA *fm, FM_CFG *cfg, char *query, char *inv_alph, FM_INTERVAL *interval); |
| 1794 |
extern int fm_configAlloc(FM_CFG **cfg); |
| 1795 |
extern int fm_configDestroy(FM_CFG *cfg); |
| 1796 |
extern int fm_metaDestroy(FM_METADATA *meta ); |
| 1797 |
extern int fm_updateIntervalForward( const FM_DATA *fm, const FM_CFG *cfg, char c, FM_INTERVAL *interval_f, FM_INTERVAL *interval_bk); |
| 1798 |
extern int fm_updateIntervalReverse( const FM_DATA *fm, const FM_CFG *cfg, char c, FM_INTERVAL *interval); |
| 1799 |
extern int fm_initSeeds (FM_DIAGLIST *list) ; |
| 1800 |
extern FM_DIAG * fm_newSeed (FM_DIAGLIST *list); |
| 1801 |
extern int fm_initAmbiguityList (FM_AMBIGLIST *list); |
| 1802 |
extern int fm_addAmbiguityRange (FM_AMBIGLIST *list, uint32_t start, uint32_t stop); |
| 1803 |
extern int fm_convertRange2DSQ(const FM_DATA *fm, const FM_METADATA *meta, uint64_t first, int length, int complementarity, ESL_SQ *sq, int fix_ambiguities ); |
| 1804 |
extern int fm_initConfigGeneric( FM_CFG *cfg, ESL_GETOPTS *go); |
| 1805 |
|
| 1806 |
|
| 1807 |
extern int p7_SSVFM_longlarget( P7_OPROFILE *om, float nu, P7_BG *bg, double F1, |
| 1808 |
const FM_DATA *fmf, const FM_DATA *fmb, FM_CFG *fm_cfg, const P7_SCOREDATA *ssvdata, |
| 1809 |
int strands, ESL_RANDOMNESS *r, P7_HMM_WINDOWLIST *windowlist); |
| 1810 |
|
| 1811 |
|
| 1812 |
|
| 1813 |
extern int fm_configInit (FM_CFG *cfg, ESL_GETOPTS *go); |
| 1814 |
extern int fm_getOccCount (const FM_DATA *fm, const FM_CFG *cfg, int pos, uint8_t c); |
| 1815 |
extern int fm_getOccCountLT (const FM_DATA *fm, const FM_CFG *cfg, int pos, uint8_t c, uint32_t *cnteq, uint32_t *cntlt); |
| 1816 |
|
| 1817 |
#endif |
| 1818 |
|
| 1819 |
|