| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#include <p7_config.h> |
| 17 |
|
| 18 |
#include <stdio.h> |
| 19 |
#include <string.h> |
| 20 |
#include <math.h> |
| 21 |
|
| 22 |
#ifndef __APPLE_ALTIVEC__ |
| 23 |
#include <altivec.h> |
| 24 |
#endif |
| 25 |
|
| 26 |
#include "easel.h" |
| 27 |
#include "esl_random.h" |
| 28 |
#include "esl_vmx.h" |
| 29 |
#include "esl_vectorops.h" |
| 30 |
|
| 31 |
#include "hmmer.h" |
| 32 |
#include "impl_vmx.h" |
| 33 |
|
| 34 |
static uint8_t unbiased_byteify(P7_OPROFILE *om, float sc); |
| 35 |
static uint8_t biased_byteify(P7_OPROFILE *om, float sc); |
| 36 |
static int16_t wordify(P7_OPROFILE *om, float sc); |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
P7_OPROFILE * |
| 51 |
p7_oprofile_Create(int allocM, const ESL_ALPHABET *abc) |
| 52 |
{ |
| 53 |
int status; |
| 54 |
P7_OPROFILE *om = NULL; |
| 55 |
int nqb = p7O_NQB(allocM); |
| 56 |
int nqw = p7O_NQW(allocM); |
| 57 |
int nqf = p7O_NQF(allocM); |
| 58 |
int x; |
| 59 |
|
| 60 |
|
| 61 |
ESL_ALLOC(om, sizeof(P7_OPROFILE)); |
| 62 |
om->rbv_mem = NULL; |
| 63 |
om->rwv_mem = NULL; |
| 64 |
om->twv_mem = NULL; |
| 65 |
om->rfv_mem = NULL; |
| 66 |
om->tfv_mem = NULL; |
| 67 |
om->rbv = NULL; |
| 68 |
om->rwv = NULL; |
| 69 |
om->twv = NULL; |
| 70 |
om->rfv = NULL; |
| 71 |
om->tfv = NULL; |
| 72 |
om->clone = 0; |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
ESL_ALLOC(om->rbv_mem, sizeof(vector unsigned char) * nqb * abc->Kp +15); |
| 78 |
ESL_ALLOC(om->rwv_mem, sizeof(vector signed short) * nqw * abc->Kp +15); |
| 79 |
ESL_ALLOC(om->twv_mem, sizeof(vector signed short) * nqw * p7O_NTRANS +15); |
| 80 |
ESL_ALLOC(om->rfv_mem, sizeof(vector float) * nqf * abc->Kp +15); |
| 81 |
ESL_ALLOC(om->tfv_mem, sizeof(vector float) * nqf * p7O_NTRANS +15); |
| 82 |
|
| 83 |
ESL_ALLOC(om->rbv, sizeof(vector unsigned char *) * abc->Kp); |
| 84 |
ESL_ALLOC(om->rwv, sizeof(vector signed short *) * abc->Kp); |
| 85 |
ESL_ALLOC(om->rfv, sizeof(vector float *) * abc->Kp); |
| 86 |
|
| 87 |
|
| 88 |
om->rbv[0] = (vector unsigned char *) (((unsigned long int) om->rbv_mem + 15) & (~0xf)); |
| 89 |
om->rwv[0] = (vector signed short *) (((unsigned long int) om->rwv_mem + 15) & (~0xf)); |
| 90 |
om->twv = (vector signed short *) (((unsigned long int) om->twv_mem + 15) & (~0xf)); |
| 91 |
om->rfv[0] = (vector float *) (((unsigned long int) om->rfv_mem + 15) & (~0xf)); |
| 92 |
om->tfv = (vector float *) (((unsigned long int) om->tfv_mem + 15) & (~0xf)); |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
for (x = 1; x < abc->Kp; x++) { |
| 97 |
om->rbv[x] = om->rbv[0] + (x * nqb); |
| 98 |
om->rwv[x] = om->rwv[0] + (x * nqw); |
| 99 |
om->rfv[x] = om->rfv[0] + (x * nqf); |
| 100 |
} |
| 101 |
om->allocQ16 = nqb; |
| 102 |
om->allocQ8 = nqw; |
| 103 |
om->allocQ4 = nqf; |
| 104 |
|
| 105 |
|
| 106 |
om->tbm_b = 0; |
| 107 |
om->tec_b = 0; |
| 108 |
om->tjb_b = 0; |
| 109 |
om->scale_b = 0.0f; |
| 110 |
om->base_b = 0; |
| 111 |
om->bias_b = 0; |
| 112 |
|
| 113 |
om->scale_w = 0.0f; |
| 114 |
om->base_w = 0; |
| 115 |
om->ddbound_w = 0; |
| 116 |
om->ncj_roundoff = 0.0f; |
| 117 |
|
| 118 |
for (x = 0; x < p7_NOFFSETS; x++) om->offs[x] = -1; |
| 119 |
for (x = 0; x < p7_NEVPARAM; x++) om->evparam[x] = p7_EVPARAM_UNSET; |
| 120 |
for (x = 0; x < p7_NCUTOFFS; x++) om->cutoff[x] = p7_CUTOFF_UNSET; |
| 121 |
for (x = 0; x < p7_MAXABET; x++) om->compo[x] = p7_COMPO_UNSET; |
| 122 |
|
| 123 |
om->name = NULL; |
| 124 |
om->acc = NULL; |
| 125 |
om->desc = NULL; |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
ESL_ALLOC(om->rf, sizeof(char) * (allocM+2)); |
| 133 |
ESL_ALLOC(om->mm, sizeof(char) * (allocM+2)); |
| 134 |
ESL_ALLOC(om->cs, sizeof(char) * (allocM+2)); |
| 135 |
ESL_ALLOC(om->consensus, sizeof(char) * (allocM+2)); |
| 136 |
memset(om->rf, '\0', sizeof(char) * (allocM+2)); |
| 137 |
memset(om->mm, '\0', sizeof(char) * (allocM+2)); |
| 138 |
memset(om->cs, '\0', sizeof(char) * (allocM+2)); |
| 139 |
memset(om->consensus,'\0', sizeof(char) * (allocM+2)); |
| 140 |
|
| 141 |
om->abc = abc; |
| 142 |
om->L = 0; |
| 143 |
om->M = 0; |
| 144 |
om->max_length = -1; |
| 145 |
om->allocM = allocM; |
| 146 |
om->mode = p7_NO_MODE; |
| 147 |
om->nj = 0.0f; |
| 148 |
return om; |
| 149 |
|
| 150 |
ERROR: |
| 151 |
p7_oprofile_Destroy(om); |
| 152 |
return NULL; |
| 153 |
} |
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
int |
| 160 |
p7_oprofile_IsLocal(const P7_OPROFILE *om) |
| 161 |
{ |
| 162 |
if (om->mode == p7_LOCAL || om->mode == p7_UNILOCAL) return TRUE; |
| 163 |
return FALSE; |
| 164 |
} |
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
void |
| 173 |
p7_oprofile_Destroy(P7_OPROFILE *om) |
| 174 |
{ |
| 175 |
if (om == NULL) return; |
| 176 |
|
| 177 |
if (om->clone == 0) |
| 178 |
{ |
| 179 |
if (om->rbv_mem != NULL) free(om->rbv_mem); |
| 180 |
if (om->rwv_mem != NULL) free(om->rwv_mem); |
| 181 |
if (om->twv_mem != NULL) free(om->twv_mem); |
| 182 |
if (om->rfv_mem != NULL) free(om->rfv_mem); |
| 183 |
if (om->tfv_mem != NULL) free(om->tfv_mem); |
| 184 |
if (om->rbv != NULL) free(om->rbv); |
| 185 |
if (om->rwv != NULL) free(om->rwv); |
| 186 |
if (om->rfv != NULL) free(om->rfv); |
| 187 |
if (om->name != NULL) free(om->name); |
| 188 |
if (om->acc != NULL) free(om->acc); |
| 189 |
if (om->desc != NULL) free(om->desc); |
| 190 |
if (om->rf != NULL) free(om->rf); |
| 191 |
if (om->mm != NULL) free(om->mm); |
| 192 |
if (om->cs != NULL) free(om->cs); |
| 193 |
if (om->consensus != NULL) free(om->consensus); |
| 194 |
} |
| 195 |
|
| 196 |
free(om); |
| 197 |
} |
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
size_t |
| 207 |
p7_oprofile_Sizeof(P7_OPROFILE *om) |
| 208 |
{ |
| 209 |
size_t n = 0; |
| 210 |
int nqb = om->allocQ16; |
| 211 |
int nqw = om->allocQ8; |
| 212 |
int nqf = om->allocQ4; |
| 213 |
|
| 214 |
n += sizeof(P7_OPROFILE); |
| 215 |
n += sizeof(vector unsigned char) * nqb * om->abc->Kp +15; |
| 216 |
n += sizeof(vector signed short) * nqw * om->abc->Kp +15; |
| 217 |
n += sizeof(vector signed short) * nqw * p7O_NTRANS +15; |
| 218 |
n += sizeof(vector float) * nqf * om->abc->Kp +15; |
| 219 |
n += sizeof(vector float) * nqf * p7O_NTRANS +15; |
| 220 |
|
| 221 |
n += sizeof(vector unsigned char *) * om->abc->Kp; |
| 222 |
n += sizeof(vector signed short *) * om->abc->Kp; |
| 223 |
n += sizeof(vector float *) * om->abc->Kp; |
| 224 |
|
| 225 |
n += sizeof(char) * (om->allocM+2); |
| 226 |
n += sizeof(char) * (om->allocM+2); |
| 227 |
n += sizeof(char) * (om->allocM+2); |
| 228 |
n += sizeof(char) * (om->allocM+2); |
| 229 |
|
| 230 |
return n; |
| 231 |
} |
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
P7_OPROFILE * |
| 242 |
p7_oprofile_Copy(P7_OPROFILE *om1) |
| 243 |
{ |
| 244 |
int x, y; |
| 245 |
int status; |
| 246 |
|
| 247 |
int nqb = p7O_NQB(om1->allocM); |
| 248 |
int nqw = p7O_NQW(om1->allocM); |
| 249 |
int nqf = p7O_NQF(om1->allocM); |
| 250 |
|
| 251 |
size_t size = sizeof(char) * (om1->allocM+2); |
| 252 |
|
| 253 |
P7_OPROFILE *om2 = NULL; |
| 254 |
|
| 255 |
const ESL_ALPHABET *abc = om1->abc; |
| 256 |
|
| 257 |
|
| 258 |
ESL_ALLOC(om2, sizeof(P7_OPROFILE)); |
| 259 |
om2->rbv_mem = NULL; |
| 260 |
om2->rwv_mem = NULL; |
| 261 |
om2->twv_mem = NULL; |
| 262 |
om2->rfv_mem = NULL; |
| 263 |
om2->tfv_mem = NULL; |
| 264 |
om2->rbv = NULL; |
| 265 |
om2->rwv = NULL; |
| 266 |
om2->twv = NULL; |
| 267 |
om2->rfv = NULL; |
| 268 |
om2->tfv = NULL; |
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
ESL_ALLOC(om2->rbv_mem, sizeof(vector unsigned char) * nqb * abc->Kp +15); |
| 274 |
ESL_ALLOC(om2->rwv_mem, sizeof(vector signed short) * nqw * abc->Kp +15); |
| 275 |
ESL_ALLOC(om2->twv_mem, sizeof(vector signed short) * nqw * p7O_NTRANS +15); |
| 276 |
ESL_ALLOC(om2->rfv_mem, sizeof(vector float) * nqf * abc->Kp +15); |
| 277 |
ESL_ALLOC(om2->tfv_mem, sizeof(vector float) * nqf * p7O_NTRANS +15); |
| 278 |
|
| 279 |
ESL_ALLOC(om2->rbv, sizeof(vector unsigned char *) * abc->Kp); |
| 280 |
ESL_ALLOC(om2->rwv, sizeof(vector signed short *) * abc->Kp); |
| 281 |
ESL_ALLOC(om2->rfv, sizeof(vector float *) * abc->Kp); |
| 282 |
|
| 283 |
|
| 284 |
om2->rbv[0] = (vector unsigned char *) (((unsigned long int) om2->rbv_mem + 15) & (~0xf)); |
| 285 |
om2->rwv[0] = (vector signed short *) (((unsigned long int) om2->rwv_mem + 15) & (~0xf)); |
| 286 |
om2->twv = (vector signed short *) (((unsigned long int) om2->twv_mem + 15) & (~0xf)); |
| 287 |
om2->rfv[0] = (vector float *) (((unsigned long int) om2->rfv_mem + 15) & (~0xf)); |
| 288 |
om2->tfv = (vector float *) (((unsigned long int) om2->tfv_mem + 15) & (~0xf)); |
| 289 |
|
| 290 |
|
| 291 |
memcpy(om2->rbv[0], om1->rbv[0], sizeof(vector unsigned char) * nqb * abc->Kp); |
| 292 |
memcpy(om2->rwv[0], om1->rwv[0], sizeof(vector signed short) * nqw * abc->Kp); |
| 293 |
memcpy(om2->rfv[0], om1->rfv[0], sizeof(vector float) * nqf * abc->Kp); |
| 294 |
|
| 295 |
|
| 296 |
for (x = 1; x < abc->Kp; x++) { |
| 297 |
om2->rbv[x] = om2->rbv[0] + (x * nqb); |
| 298 |
om2->rwv[x] = om2->rwv[0] + (x * nqw); |
| 299 |
om2->rfv[x] = om2->rfv[0] + (x * nqf); |
| 300 |
} |
| 301 |
om2->allocQ16 = nqb; |
| 302 |
om2->allocQ8 = nqw; |
| 303 |
om2->allocQ4 = nqf; |
| 304 |
|
| 305 |
|
| 306 |
om2->tbm_b = om1->tbm_b; |
| 307 |
om2->tec_b = om1->tec_b; |
| 308 |
om2->tjb_b = om1->tjb_b; |
| 309 |
om2->scale_b = om1->scale_b; |
| 310 |
om2->base_b = om1->base_b; |
| 311 |
om2->bias_b = om1->bias_b; |
| 312 |
|
| 313 |
om2->scale_w = om1->scale_w; |
| 314 |
om2->base_w = om1->base_w; |
| 315 |
om2->ddbound_w = om1->ddbound_w; |
| 316 |
om2->ncj_roundoff = om1->ncj_roundoff; |
| 317 |
|
| 318 |
for (x = 0; x < p7_NOFFSETS; x++) om2->offs[x] = om1->offs[x]; |
| 319 |
for (x = 0; x < p7_NEVPARAM; x++) om2->evparam[x] = om1->evparam[x]; |
| 320 |
for (x = 0; x < p7_NCUTOFFS; x++) om2->cutoff[x] = om1->cutoff[x]; |
| 321 |
for (x = 0; x < p7_MAXABET; x++) om2->compo[x] = om1->compo[x]; |
| 322 |
|
| 323 |
for (x = 0; x < nqw * p7O_NTRANS; ++x) om2->twv[x] = om1->twv[x]; |
| 324 |
for (x = 0; x < nqf * p7O_NTRANS; ++x) om2->tfv[x] = om1->tfv[x]; |
| 325 |
|
| 326 |
for (x = 0; x < p7O_NXSTATES; x++) |
| 327 |
for (y = 0; y < p7O_NXTRANS; y++) |
| 328 |
{ |
| 329 |
om2->xw[x][y] = om1->xw[x][y]; |
| 330 |
om2->xf[x][y] = om1->xf[x][y]; |
| 331 |
} |
| 332 |
|
| 333 |
if ((status = esl_strdup(om1->name, -1, &om2->name)) != eslOK) goto ERROR; |
| 334 |
if ((status = esl_strdup(om1->acc, -1, &om2->acc)) != eslOK) goto ERROR; |
| 335 |
if ((status = esl_strdup(om1->desc, -1, &om2->desc)) != eslOK) goto ERROR; |
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
ESL_ALLOC(om2->rf, size); |
| 343 |
ESL_ALLOC(om2->mm, size); |
| 344 |
ESL_ALLOC(om2->cs, size); |
| 345 |
ESL_ALLOC(om2->consensus, size); |
| 346 |
|
| 347 |
memcpy(om2->rf, om1->rf, size); |
| 348 |
memcpy(om2->mm, om1->mm, size); |
| 349 |
memcpy(om2->cs, om1->cs, size); |
| 350 |
memcpy(om2->consensus, om1->consensus, size); |
| 351 |
|
| 352 |
om2->abc = om1->abc; |
| 353 |
om2->L = om1->L; |
| 354 |
om2->M = om1->M; |
| 355 |
om2->allocM = om1->allocM; |
| 356 |
om2->mode = om1->mode; |
| 357 |
om2->nj = om1->nj; |
| 358 |
om2->max_length = om1->max_length; |
| 359 |
|
| 360 |
om2->clone = om1->clone; |
| 361 |
|
| 362 |
return om2; |
| 363 |
|
| 364 |
ERROR: |
| 365 |
p7_oprofile_Destroy(om2); |
| 366 |
return NULL; |
| 367 |
} |
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
P7_OPROFILE * |
| 380 |
p7_oprofile_Clone(const P7_OPROFILE *om1) |
| 381 |
{ |
| 382 |
int status; |
| 383 |
|
| 384 |
P7_OPROFILE *om2 = NULL; |
| 385 |
|
| 386 |
ESL_ALLOC(om2, sizeof(P7_OPROFILE)); |
| 387 |
memcpy(om2, om1, sizeof(P7_OPROFILE)); |
| 388 |
|
| 389 |
om2->clone = 1; |
| 390 |
|
| 391 |
return om2; |
| 392 |
|
| 393 |
ERROR: |
| 394 |
p7_oprofile_Destroy(om2); |
| 395 |
return NULL; |
| 396 |
} |
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
|
| 405 |
|
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
int |
| 416 |
p7_oprofile_UpdateFwdEmissionScores(P7_OPROFILE *om, P7_BG *bg, float *fwd_emissions, float *sc_arr) |
| 417 |
{ |
| 418 |
int M = om->M; |
| 419 |
int k, q, x, z; |
| 420 |
int nq = p7O_NQF(M); |
| 421 |
int K = om->abc->K; |
| 422 |
int Kp = om->abc->Kp; |
| 423 |
union { vector float v; float x[4]; } tmp; |
| 424 |
|
| 425 |
for (k = 1, q = 0; q < nq; q++, k++) { |
| 426 |
|
| 427 |
|
| 428 |
for (x = 0; x < K; x++) { |
| 429 |
for (z = 0; z < 4; z++) { |
| 430 |
if (k+ z*nq <= M) sc_arr[z*Kp + x] = (om->mm && om->mm[(k+z*nq)]=='m') ? 0 : log(fwd_emissions[Kp * (k+z*nq) + x]/bg->f[x]); |
| 431 |
else sc_arr[z*Kp + x] = -eslINFINITY; |
| 432 |
|
| 433 |
tmp.x[z] = sc_arr[z*Kp + x]; |
| 434 |
} |
| 435 |
om->rfv[x][q] = esl_vmx_expf(tmp.v); |
| 436 |
} |
| 437 |
|
| 438 |
|
| 439 |
for (z = 0; z < 4; z++) |
| 440 |
esl_abc_FExpectScVec(om->abc, sc_arr+(z*Kp), bg->f); |
| 441 |
|
| 442 |
|
| 443 |
for (x = K; x < Kp; x++) { |
| 444 |
for (z = 0; z < 4; z++) |
| 445 |
tmp.x[z] = sc_arr[z*Kp + x]; |
| 446 |
om->rfv[x][q] = esl_vmx_expf(tmp.v); |
| 447 |
} |
| 448 |
} |
| 449 |
|
| 450 |
return eslOK; |
| 451 |
|
| 452 |
} |
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
int |
| 471 |
p7_oprofile_UpdateVitEmissionScores(P7_OPROFILE *om, P7_BG *bg, float *fwd_emissions, float *sc_arr) |
| 472 |
{ |
| 473 |
int M = om->M; |
| 474 |
int k, q, x, z; |
| 475 |
int nq = p7O_NQW(M); |
| 476 |
int K = om->abc->K; |
| 477 |
int Kp = om->abc->Kp; |
| 478 |
int idx; |
| 479 |
union { vector signed short v; int16_t i[8]; } tmp; |
| 480 |
|
| 481 |
for (k = 1, q = 0; q < nq; q++, k++) { |
| 482 |
|
| 483 |
|
| 484 |
for (x = 0; x < K; x++) { |
| 485 |
for (z = 0; z < 8; z++) { |
| 486 |
idx = z*Kp + x; |
| 487 |
if (k+ z*nq <= M) { |
| 488 |
sc_arr[idx] = (om->mm && om->mm[(k+z*nq)]=='m') ? 0 : log( (double)(fwd_emissions[Kp * (k+z*nq) + x])/bg->f[x]); |
| 489 |
tmp.i[z] = wordify(om, sc_arr[idx]); |
| 490 |
} |
| 491 |
else |
| 492 |
{ |
| 493 |
sc_arr[idx] = -eslINFINITY; |
| 494 |
tmp.i[z] = -32768; |
| 495 |
} |
| 496 |
|
| 497 |
} |
| 498 |
om->rwv[x][q] = tmp.v; |
| 499 |
|
| 500 |
} |
| 501 |
|
| 502 |
|
| 503 |
for (z = 0; z < 8; z++) |
| 504 |
esl_abc_FExpectScVec(om->abc, sc_arr+(z*Kp), bg->f); |
| 505 |
|
| 506 |
|
| 507 |
for (x = K; x < Kp; x++) { |
| 508 |
for (z = 0; z < 8; z++) { |
| 509 |
idx = z*Kp + x; |
| 510 |
if (x==K || x>Kp-3 || sc_arr[idx] == -eslINFINITY) |
| 511 |
tmp.i[z] = -32768; |
| 512 |
else |
| 513 |
tmp.i[z] = wordify(om, sc_arr[idx]); |
| 514 |
} |
| 515 |
om->rwv[x][q] = tmp.v; |
| 516 |
} |
| 517 |
} |
| 518 |
|
| 519 |
return eslOK; |
| 520 |
} |
| 521 |
|
| 522 |
|
| 523 |
|
| 524 |
|
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
|
| 538 |
|
| 539 |
|
| 540 |
int |
| 541 |
p7_oprofile_UpdateMSVEmissionScores(P7_OPROFILE *om, P7_BG *bg, float *fwd_emissions, float *sc_arr) |
| 542 |
{ |
| 543 |
int M = om->M; |
| 544 |
int k, q, x, z; |
| 545 |
int nq = p7O_NQB(M); |
| 546 |
int K = om->abc->K; |
| 547 |
int Kp = om->abc->Kp; |
| 548 |
int idx; |
| 549 |
float max = 0.0; |
| 550 |
union { vector unsigned char v; uint8_t i[16]; } tmp; |
| 551 |
|
| 552 |
|
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
|
| 557 |
|
| 558 |
for (k = 1, q = 0; q < nq; q++, k++) { |
| 559 |
for (x = 0; x < K; x++) { |
| 560 |
for (z = 0; z < 16; z++) { |
| 561 |
idx = z*Kp + x; |
| 562 |
if (k+ z*nq <= M && !(om->mm && om->mm[(k+z*nq)]=='m')) |
| 563 |
max = ESL_MAX(max, log( (double)(fwd_emissions[Kp * (k+z*nq) + x])/bg->f[x])); |
| 564 |
} |
| 565 |
} |
| 566 |
} |
| 567 |
om->scale_b = 3.0 / eslCONST_LOG2; |
| 568 |
om->base_b = 190; |
| 569 |
om->bias_b = unbiased_byteify(om, -1.0 * max); |
| 570 |
|
| 571 |
for (k = 1, q = 0; q < nq; q++, k++) { |
| 572 |
|
| 573 |
|
| 574 |
for (x = 0; x < K; x++) { |
| 575 |
for (z = 0; z < 16; z++) { |
| 576 |
idx = z*Kp + x; |
| 577 |
if (k+ z*nq <= M) { |
| 578 |
sc_arr[idx] = (om->mm && om->mm[(k+z*nq)]=='m') ? 0 : log( (double)(fwd_emissions[Kp * (k+z*nq) + x])/bg->f[x]); |
| 579 |
tmp.i[z] = biased_byteify(om, sc_arr[idx]); |
| 580 |
} |
| 581 |
else |
| 582 |
{ |
| 583 |
sc_arr[idx] = -eslINFINITY; |
| 584 |
tmp.i[z] = 255; |
| 585 |
} |
| 586 |
|
| 587 |
} |
| 588 |
om->rbv[x][q] = tmp.v; |
| 589 |
|
| 590 |
} |
| 591 |
|
| 592 |
|
| 593 |
for (z = 0; z < 16; z++) |
| 594 |
esl_abc_FExpectScVec(om->abc, sc_arr+(z*Kp), bg->f); |
| 595 |
|
| 596 |
|
| 597 |
for (x = K; x < Kp; x++) { |
| 598 |
for (z = 0; z < 16; z++) { |
| 599 |
idx = z*Kp + x; |
| 600 |
if (x==K || x>Kp-3 || sc_arr[idx] == -eslINFINITY) |
| 601 |
tmp.i[z] = 255; |
| 602 |
else |
| 603 |
tmp.i[z] = biased_byteify(om, sc_arr[idx]); |
| 604 |
} |
| 605 |
om->rbv[x][q] = tmp.v; |
| 606 |
} |
| 607 |
} |
| 608 |
|
| 609 |
return eslOK; |
| 610 |
} |
| 611 |
|
| 612 |
|
| 613 |
|
| 614 |
|
| 615 |
|
| 616 |
|
| 617 |
|
| 618 |
|
| 619 |
|
| 620 |
|
| 621 |
|
| 622 |
|
| 623 |
|
| 624 |
|
| 625 |
|
| 626 |
|
| 627 |
|
| 628 |
|
| 629 |
|
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
|
| 634 |
|
| 635 |
|
| 636 |
|
| 637 |
|
| 638 |
|
| 639 |
|
| 640 |
|
| 641 |
static uint8_t |
| 642 |
biased_byteify(P7_OPROFILE *om, float sc) |
| 643 |
{ |
| 644 |
uint8_t b; |
| 645 |
|
| 646 |
sc = -1.0f * roundf(om->scale_b * sc); |
| 647 |
b = (sc > 255 - om->bias_b) ? 255 : (uint8_t) (int) sc + om->bias_b; |
| 648 |
return b; |
| 649 |
} |
| 650 |
|
| 651 |
|
| 652 |
|
| 653 |
|
| 654 |
|
| 655 |
|
| 656 |
|
| 657 |
|
| 658 |
|
| 659 |
static uint8_t |
| 660 |
unbiased_byteify(P7_OPROFILE *om, float sc) |
| 661 |
{ |
| 662 |
uint8_t b; |
| 663 |
|
| 664 |
sc = -1.0f * roundf(om->scale_b * sc); |
| 665 |
b = (sc > 255.) ? 255 : (uint8_t) (int) sc; |
| 666 |
return b; |
| 667 |
} |
| 668 |
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
|
| 673 |
|
| 674 |
|
| 675 |
static int16_t |
| 676 |
wordify(P7_OPROFILE *om, float sc) |
| 677 |
{ |
| 678 |
sc = roundf(om->scale_w * sc); |
| 679 |
if (sc >= 32767.0) return 32767; |
| 680 |
else if (sc <= -32768.0) return -32768; |
| 681 |
else return (int16_t) sc; |
| 682 |
} |
| 683 |
|
| 684 |
|
| 685 |
|
| 686 |
|
| 687 |
|
| 688 |
|
| 689 |
|
| 690 |
|
| 691 |
|
| 692 |
|
| 693 |
static int |
| 694 |
mf_conversion(const P7_PROFILE *gm, P7_OPROFILE *om) |
| 695 |
{ |
| 696 |
int M = gm->M; |
| 697 |
int nq = p7O_NQB(M); |
| 698 |
float max = 0.0; |
| 699 |
int x; |
| 700 |
int q; |
| 701 |
int k; |
| 702 |
int z; |
| 703 |
|
| 704 |
|
| 705 |
union { vector unsigned char v; uint8_t i[16]; } tmp; |
| 706 |
|
| 707 |
if (nq > om->allocQ16) ESL_EXCEPTION(eslEINVAL, "optimized profile is too small to hold conversion"); |
| 708 |
|
| 709 |
|
| 710 |
|
| 711 |
|
| 712 |
|
| 713 |
for (x = 0; x < gm->abc->K; x++) max = ESL_MAX(max, esl_vec_FMax(gm->rsc[x], (M+1)*2)); |
| 714 |
om->scale_b = 3.0 / eslCONST_LOG2; |
| 715 |
om->base_b = 190; |
| 716 |
om->bias_b = unbiased_byteify(om, -1.0 * max); |
| 717 |
|
| 718 |
|
| 719 |
for (x = 0; x < gm->abc->Kp; x++) |
| 720 |
for (q = 0, k = 1; q < nq; q++, k++) |
| 721 |
{ |
| 722 |
for (z = 0; z < 16; z++) tmp.i[z] = ((k+ z*nq <= M) ? biased_byteify(om, p7P_MSC(gm, k+z*nq, x)) : 255); |
| 723 |
om->rbv[x][q] = tmp.v; |
| 724 |
} |
| 725 |
|
| 726 |
|
| 727 |
om->tbm_b = unbiased_byteify(om, logf(2.0f / ((float) gm->M * (float) (gm->M+1)))); |
| 728 |
om->tec_b = unbiased_byteify(om, logf(0.5f)); |
| 729 |
om->tjb_b = unbiased_byteify(om, logf(3.0f / (float) (gm->L+3))); |
| 730 |
|
| 731 |
return eslOK; |
| 732 |
} |
| 733 |
|
| 734 |
|
| 735 |
|
| 736 |
|
| 737 |
|
| 738 |
|
| 739 |
|
| 740 |
|
| 741 |
|
| 742 |
|
| 743 |
|
| 744 |
static int |
| 745 |
vf_conversion(const P7_PROFILE *gm, P7_OPROFILE *om) |
| 746 |
{ |
| 747 |
int M = gm->M; |
| 748 |
int nq = p7O_NQW(M); |
| 749 |
int x; |
| 750 |
int q; |
| 751 |
int k; |
| 752 |
int kb; |
| 753 |
int z; |
| 754 |
int t; |
| 755 |
int tg; |
| 756 |
int j; |
| 757 |
int ddtmp; |
| 758 |
int16_t maxval; |
| 759 |
int16_t val; |
| 760 |
|
| 761 |
|
| 762 |
union { vector signed short v; int16_t i[8]; } tmp; |
| 763 |
|
| 764 |
if (nq > om->allocQ8) ESL_EXCEPTION(eslEINVAL, "optimized profile is too small to hold conversion"); |
| 765 |
|
| 766 |
|
| 767 |
|
| 768 |
|
| 769 |
|
| 770 |
om->scale_w = 500.0 / eslCONST_LOG2; |
| 771 |
om->base_w = 12000; |
| 772 |
|
| 773 |
|
| 774 |
for (x = 0; x < gm->abc->Kp; x++) |
| 775 |
for (k = 1, q = 0; q < nq; q++, k++) |
| 776 |
{ |
| 777 |
for (z = 0; z < 8; z++) tmp.i[z] = ((k+ z*nq <= M) ? wordify(om, p7P_MSC(gm, k+z*nq, x)) : -32768); |
| 778 |
om->rwv[x][q] = tmp.v; |
| 779 |
} |
| 780 |
|
| 781 |
|
| 782 |
for (j = 0, k = 1, q = 0; q < nq; q++, k++) |
| 783 |
{ |
| 784 |
for (t = p7O_BM; t <= p7O_II; t++) |
| 785 |
{ |
| 786 |
switch (t) { |
| 787 |
case p7O_BM: tg = p7P_BM; kb = k-1; maxval = 0; break; |
| 788 |
case p7O_MM: tg = p7P_MM; kb = k-1; maxval = 0; break; |
| 789 |
case p7O_IM: tg = p7P_IM; kb = k-1; maxval = 0; break; |
| 790 |
case p7O_DM: tg = p7P_DM; kb = k-1; maxval = 0; break; |
| 791 |
case p7O_MD: tg = p7P_MD; kb = k; maxval = 0; break; |
| 792 |
case p7O_MI: tg = p7P_MI; kb = k; maxval = 0; break; |
| 793 |
case p7O_II: tg = p7P_II; kb = k; maxval = -1; break; |
| 794 |
} |
| 795 |
|
| 796 |
for (z = 0; z < 8; z++) { |
| 797 |
val = ((kb+ z*nq < M) ? wordify(om, p7P_TSC(gm, kb+ z*nq, tg)) : -32768); |
| 798 |
tmp.i[z] = (val <= maxval) ? val : maxval; |
| 799 |
} |
| 800 |
om->twv[j++] = tmp.v; |
| 801 |
} |
| 802 |
} |
| 803 |
|
| 804 |
|
| 805 |
for (k = 1, q = 0; q < nq; q++, k++) |
| 806 |
{ |
| 807 |
for (z = 0; z < 8; z++) tmp.i[z] = ((k+ z*nq < M) ? wordify(om, p7P_TSC(gm, k+ z*nq, p7P_DD)) : -32768); |
| 808 |
om->twv[j++] = tmp.v; |
| 809 |
} |
| 810 |
|
| 811 |
|
| 812 |
|
| 813 |
|
| 814 |
|
| 815 |
|
| 816 |
|
| 817 |
|
| 818 |
om->xw[p7O_E][p7O_LOOP] = wordify(om, gm->xsc[p7P_E][p7P_LOOP]); |
| 819 |
om->xw[p7O_E][p7O_MOVE] = wordify(om, gm->xsc[p7P_E][p7P_MOVE]); |
| 820 |
om->xw[p7O_N][p7O_MOVE] = wordify(om, gm->xsc[p7P_N][p7P_MOVE]); |
| 821 |
om->xw[p7O_N][p7O_LOOP] = 0; |
| 822 |
om->xw[p7O_C][p7O_MOVE] = wordify(om, gm->xsc[p7P_C][p7P_MOVE]); |
| 823 |
om->xw[p7O_C][p7O_LOOP] = 0; |
| 824 |
om->xw[p7O_J][p7O_MOVE] = wordify(om, gm->xsc[p7P_J][p7P_MOVE]); |
| 825 |
om->xw[p7O_J][p7O_LOOP] = 0; |
| 826 |
|
| 827 |
om->ncj_roundoff = 0.0; |
| 828 |
|
| 829 |
|
| 830 |
|
| 831 |
|
| 832 |
om->ddbound_w = -32768; |
| 833 |
for (k = 2; k < M-1; k++) |
| 834 |
{ |
| 835 |
ddtmp = (int) wordify(om, p7P_TSC(gm, k, p7P_DD)); |
| 836 |
ddtmp += (int) wordify(om, p7P_TSC(gm, k+1, p7P_DM)); |
| 837 |
ddtmp -= (int) wordify(om, p7P_TSC(gm, k+1, p7P_BM)); |
| 838 |
om->ddbound_w = ESL_MAX(om->ddbound_w, ddtmp); |
| 839 |
} |
| 840 |
|
| 841 |
return eslOK; |
| 842 |
} |
| 843 |
|
| 844 |
|
| 845 |
|
| 846 |
|
| 847 |
|
| 848 |
|
| 849 |
static int |
| 850 |
fb_conversion(const P7_PROFILE *gm, P7_OPROFILE *om) |
| 851 |
{ |
| 852 |
int M = gm->M; |
| 853 |
int nq = p7O_NQF(M); |
| 854 |
int x; |
| 855 |
int q; |
| 856 |
int k; |
| 857 |
int kb; |
| 858 |
int z; |
| 859 |
int t; |
| 860 |
int tg; |
| 861 |
int j; |
| 862 |
|
| 863 |
|
| 864 |
union { vector float v; float x[4]; } tmp; |
| 865 |
|
| 866 |
if (nq > om->allocQ4) ESL_EXCEPTION(eslEINVAL, "optimized profile is too small to hold conversion"); |
| 867 |
|
| 868 |
|
| 869 |
for (x = 0; x < gm->abc->Kp; x++) |
| 870 |
for (k = 1, q = 0; q < nq; q++, k++) |
| 871 |
{ |
| 872 |
for (z = 0; z < 4; z++) tmp.x[z] = (k+ z*nq <= M) ? p7P_MSC(gm, k+z*nq, x) : -eslINFINITY; |
| 873 |
om->rfv[x][q] = esl_vmx_expf(tmp.v); |
| 874 |
} |
| 875 |
|
| 876 |
|
| 877 |
for (j = 0, k = 1, q = 0; q < nq; q++, k++) |
| 878 |
{ |
| 879 |
for (t = p7O_BM; t <= p7O_II; t++) |
| 880 |
{ |
| 881 |
switch (t) { |
| 882 |
case p7O_BM: tg = p7P_BM; kb = k-1; break; |
| 883 |
case p7O_MM: tg = p7P_MM; kb = k-1; break; |
| 884 |
case p7O_IM: tg = p7P_IM; kb = k-1; break; |
| 885 |
case p7O_DM: tg = p7P_DM; kb = k-1; break; |
| 886 |
case p7O_MD: tg = p7P_MD; kb = k; break; |
| 887 |
case p7O_MI: tg = p7P_MI; kb = k; break; |
| 888 |
case p7O_II: tg = p7P_II; kb = k; break; |
| 889 |
} |
| 890 |
|
| 891 |
for (z = 0; z < 4; z++) tmp.x[z] = (kb+z*nq < M) ? p7P_TSC(gm, kb+z*nq, tg) : -eslINFINITY; |
| 892 |
om->tfv[j++] = esl_vmx_expf(tmp.v); |
| 893 |
} |
| 894 |
} |
| 895 |
|
| 896 |
|
| 897 |
for (k = 1, q = 0; q < nq; q++, k++) |
| 898 |
{ |
| 899 |
for (z = 0; z < 4; z++) tmp.x[z] = (k+z*nq < M) ? p7P_TSC(gm, k+z*nq, p7P_DD) : -eslINFINITY; |
| 900 |
om->tfv[j++] = esl_vmx_expf(tmp.v); |
| 901 |
} |
| 902 |
|
| 903 |
|
| 904 |
|
| 905 |
|
| 906 |
om->xf[p7O_E][p7O_LOOP] = expf(gm->xsc[p7P_E][p7P_LOOP]); |
| 907 |
om->xf[p7O_E][p7O_MOVE] = expf(gm->xsc[p7P_E][p7P_MOVE]); |
| 908 |
om->xf[p7O_N][p7O_LOOP] = expf(gm->xsc[p7P_N][p7P_LOOP]); |
| 909 |
om->xf[p7O_N][p7O_MOVE] = expf(gm->xsc[p7P_N][p7P_MOVE]); |
| 910 |
om->xf[p7O_C][p7O_LOOP] = expf(gm->xsc[p7P_C][p7P_LOOP]); |
| 911 |
om->xf[p7O_C][p7O_MOVE] = expf(gm->xsc[p7P_C][p7P_MOVE]); |
| 912 |
om->xf[p7O_J][p7O_LOOP] = expf(gm->xsc[p7P_J][p7P_LOOP]); |
| 913 |
om->xf[p7O_J][p7O_MOVE] = expf(gm->xsc[p7P_J][p7P_MOVE]); |
| 914 |
|
| 915 |
return eslOK; |
| 916 |
} |
| 917 |
|
| 918 |
|
| 919 |
|
| 920 |
|
| 921 |
|
| 922 |
|
| 923 |
|
| 924 |
|
| 925 |
|
| 926 |
|
| 927 |
|
| 928 |
|
| 929 |
|
| 930 |
|
| 931 |
|
| 932 |
|
| 933 |
|
| 934 |
|
| 935 |
int |
| 936 |
p7_oprofile_Convert(const P7_PROFILE *gm, P7_OPROFILE *om) |
| 937 |
{ |
| 938 |
int status, z; |
| 939 |
|
| 940 |
if (gm->abc->type != om->abc->type) ESL_EXCEPTION(eslEINVAL, "alphabets of the two profiles don't match"); |
| 941 |
if (gm->M > om->allocM) ESL_EXCEPTION(eslEINVAL, "oprofile is too small"); |
| 942 |
|
| 943 |
if ((status = mf_conversion(gm, om)) != eslOK) return status; |
| 944 |
if ((status = vf_conversion(gm, om)) != eslOK) return status; |
| 945 |
if ((status = fb_conversion(gm, om)) != eslOK) return status; |
| 946 |
|
| 947 |
if (om->name != NULL) free(om->name); |
| 948 |
if (om->acc != NULL) free(om->acc); |
| 949 |
if (om->desc != NULL) free(om->desc); |
| 950 |
if ((status = esl_strdup(gm->name, -1, &(om->name))) != eslOK) goto ERROR; |
| 951 |
if ((status = esl_strdup(gm->acc, -1, &(om->acc))) != eslOK) goto ERROR; |
| 952 |
if ((status = esl_strdup(gm->desc, -1, &(om->desc))) != eslOK) goto ERROR; |
| 953 |
strcpy(om->rf, gm->rf); |
| 954 |
strcpy(om->mm, gm->mm); |
| 955 |
strcpy(om->cs, gm->cs); |
| 956 |
strcpy(om->consensus, gm->consensus); |
| 957 |
for (z = 0; z < p7_NEVPARAM; z++) om->evparam[z] = gm->evparam[z]; |
| 958 |
for (z = 0; z < p7_NCUTOFFS; z++) om->cutoff[z] = gm->cutoff[z]; |
| 959 |
for (z = 0; z < p7_MAXABET; z++) om->compo[z] = gm->compo[z]; |
| 960 |
|
| 961 |
om->mode = gm->mode; |
| 962 |
om->L = gm->L; |
| 963 |
om->M = gm->M; |
| 964 |
om->max_length = gm->max_length; |
| 965 |
om->nj = gm->nj; |
| 966 |
|
| 967 |
return eslOK; |
| 968 |
|
| 969 |
ERROR: |
| 970 |
return status; |
| 971 |
} |
| 972 |
|
| 973 |
|
| 974 |
|
| 975 |
|
| 976 |
|
| 977 |
|
| 978 |
|
| 979 |
|
| 980 |
|
| 981 |
|
| 982 |
|
| 983 |
|
| 984 |
|
| 985 |
|
| 986 |
|
| 987 |
|
| 988 |
|
| 989 |
|
| 990 |
|
| 991 |
int |
| 992 |
p7_oprofile_ReconfigLength(P7_OPROFILE *om, int L) |
| 993 |
{ |
| 994 |
int status; |
| 995 |
if ((status = p7_oprofile_ReconfigMSVLength (om, L)) != eslOK) return status; |
| 996 |
if ((status = p7_oprofile_ReconfigRestLength(om, L)) != eslOK) return status; |
| 997 |
return eslOK; |
| 998 |
} |
| 999 |
|
| 1000 |
|
| 1001 |
|
| 1002 |
|
| 1003 |
|
| 1004 |
|
| 1005 |
|
| 1006 |
|
| 1007 |
|
| 1008 |
|
| 1009 |
|
| 1010 |
|
| 1011 |
|
| 1012 |
|
| 1013 |
|
| 1014 |
|
| 1015 |
int |
| 1016 |
p7_oprofile_ReconfigMSVLength(P7_OPROFILE *om, int L) |
| 1017 |
{ |
| 1018 |
om->tjb_b = unbiased_byteify(om, logf(3.0f / (float) (L+3))); |
| 1019 |
return eslOK; |
| 1020 |
} |
| 1021 |
|
| 1022 |
|
| 1023 |
|
| 1024 |
|
| 1025 |
|
| 1026 |
|
| 1027 |
|
| 1028 |
|
| 1029 |
|
| 1030 |
|
| 1031 |
|
| 1032 |
|
| 1033 |
|
| 1034 |
|
| 1035 |
|
| 1036 |
|
| 1037 |
|
| 1038 |
int |
| 1039 |
p7_oprofile_ReconfigRestLength(P7_OPROFILE *om, int L) |
| 1040 |
{ |
| 1041 |
float pmove, ploop; |
| 1042 |
|
| 1043 |
pmove = (2.0f + om->nj) / ((float) L + 2.0f + om->nj); |
| 1044 |
ploop = 1.0f - pmove; |
| 1045 |
|
| 1046 |
|
| 1047 |
om->xf[p7O_N][p7O_LOOP] = om->xf[p7O_C][p7O_LOOP] = om->xf[p7O_J][p7O_LOOP] = ploop; |
| 1048 |
om->xf[p7O_N][p7O_MOVE] = om->xf[p7O_C][p7O_MOVE] = om->xf[p7O_J][p7O_MOVE] = pmove; |
| 1049 |
|
| 1050 |
|
| 1051 |
om->xw[p7O_N][p7O_MOVE] = om->xw[p7O_C][p7O_MOVE] = om->xw[p7O_J][p7O_MOVE] = wordify(om, logf(pmove)); |
| 1052 |
|
| 1053 |
|
| 1054 |
|
| 1055 |
om->L = L; |
| 1056 |
return eslOK; |
| 1057 |
} |
| 1058 |
|
| 1059 |
|
| 1060 |
|
| 1061 |
|
| 1062 |
|
| 1063 |
|
| 1064 |
|
| 1065 |
|
| 1066 |
|
| 1067 |
|
| 1068 |
|
| 1069 |
|
| 1070 |
|
| 1071 |
|
| 1072 |
|
| 1073 |
|
| 1074 |
|
| 1075 |
|
| 1076 |
|
| 1077 |
|
| 1078 |
|
| 1079 |
|
| 1080 |
int |
| 1081 |
p7_oprofile_ReconfigMultihit(P7_OPROFILE *om, int L) |
| 1082 |
{ |
| 1083 |
om->xf[p7O_E][p7O_MOVE] = 0.5; |
| 1084 |
om->xf[p7O_E][p7O_LOOP] = 0.5; |
| 1085 |
om->nj = 1.0f; |
| 1086 |
|
| 1087 |
om->xw[p7O_E][p7O_MOVE] = wordify(om, -eslCONST_LOG2); |
| 1088 |
om->xw[p7O_E][p7O_LOOP] = wordify(om, -eslCONST_LOG2); |
| 1089 |
|
| 1090 |
return p7_oprofile_ReconfigLength(om, L); |
| 1091 |
} |
| 1092 |
|
| 1093 |
|
| 1094 |
|
| 1095 |
|
| 1096 |
|
| 1097 |
|
| 1098 |
|
| 1099 |
|
| 1100 |
|
| 1101 |
|
| 1102 |
|
| 1103 |
|
| 1104 |
|
| 1105 |
int |
| 1106 |
p7_oprofile_ReconfigUnihit(P7_OPROFILE *om, int L) |
| 1107 |
{ |
| 1108 |
om->xf[p7O_E][p7O_MOVE] = 1.0f; |
| 1109 |
om->xf[p7O_E][p7O_LOOP] = 0.0f; |
| 1110 |
om->nj = 0.0f; |
| 1111 |
|
| 1112 |
om->xw[p7O_E][p7O_MOVE] = 0; |
| 1113 |
om->xw[p7O_E][p7O_LOOP] = -32768; |
| 1114 |
|
| 1115 |
return p7_oprofile_ReconfigLength(om, L); |
| 1116 |
} |
| 1117 |
|
| 1118 |
|
| 1119 |
|
| 1120 |
|
| 1121 |
|
| 1122 |
|
| 1123 |
|
| 1124 |
|
| 1125 |
|
| 1126 |
|
| 1127 |
|
| 1128 |
|
| 1129 |
|
| 1130 |
|
| 1131 |
|
| 1132 |
|
| 1133 |
|
| 1134 |
|
| 1135 |
|
| 1136 |
|
| 1137 |
|
| 1138 |
|
| 1139 |
|
| 1140 |
|
| 1141 |
|
| 1142 |
int |
| 1143 |
p7_oprofile_GetFwdTransitionArray(const P7_OPROFILE *om, int type, float *arr ) |
| 1144 |
{ |
| 1145 |
int nq = p7O_NQF(om->M); |
| 1146 |
int i, j; |
| 1147 |
union { vector float v; float x[4]; } tmp; |
| 1148 |
|
| 1149 |
for (i=0; i<nq; i++) { |
| 1150 |
|
| 1151 |
tmp.v = om->tfv[ (type==p7O_DD ? nq*7+i : type+7*i) ]; |
| 1152 |
for (j=0; j<4; j++) |
| 1153 |
if ( i+1+ j*nq < om->M+1) |
| 1154 |
arr[i+1+ j*nq] = tmp.x[j]; |
| 1155 |
} |
| 1156 |
|
| 1157 |
return eslOK; |
| 1158 |
|
| 1159 |
} |
| 1160 |
|
| 1161 |
|
| 1162 |
|
| 1163 |
|
| 1164 |
|
| 1165 |
|
| 1166 |
|
| 1167 |
|
| 1168 |
|
| 1169 |
|
| 1170 |
|
| 1171 |
|
| 1172 |
|
| 1173 |
|
| 1174 |
|
| 1175 |
|
| 1176 |
|
| 1177 |
|
| 1178 |
|
| 1179 |
|
| 1180 |
|
| 1181 |
|
| 1182 |
|
| 1183 |
|
| 1184 |
|
| 1185 |
int |
| 1186 |
p7_oprofile_GetSSVEmissionScoreArray(const P7_OPROFILE *om, uint8_t *arr ) |
| 1187 |
{ |
| 1188 |
int x, q, z, k; |
| 1189 |
union { vector unsigned char v; uint8_t i[16]; } tmp; |
| 1190 |
int M = om->M; |
| 1191 |
int K = om->abc->Kp; |
| 1192 |
int nq = p7O_NQB(M); |
| 1193 |
int cell_cnt = (om->M + 1) * K; |
| 1194 |
|
| 1195 |
|
| 1196 |
for (x = 0; x < K ; x++) { |
| 1197 |
for (q = 0, k = 1; q < nq; q++, k++) { |
| 1198 |
tmp.v = om->rbv[x][q]; |
| 1199 |
for (z=0; z<16; z++) |
| 1200 |
if ( (K * (k+z*nq) + x) < cell_cnt) |
| 1201 |
arr[ K * (k+z*nq) + x ] = tmp.i[z]; |
| 1202 |
} |
| 1203 |
} |
| 1204 |
|
| 1205 |
return eslOK; |
| 1206 |
} |
| 1207 |
|
| 1208 |
|
| 1209 |
|
| 1210 |
|
| 1211 |
|
| 1212 |
|
| 1213 |
|
| 1214 |
|
| 1215 |
|
| 1216 |
|
| 1217 |
|
| 1218 |
|
| 1219 |
|
| 1220 |
|
| 1221 |
|
| 1222 |
|
| 1223 |
|
| 1224 |
|
| 1225 |
|
| 1226 |
|
| 1227 |
|
| 1228 |
|
| 1229 |
|
| 1230 |
|
| 1231 |
int |
| 1232 |
p7_oprofile_GetFwdEmissionScoreArray(const P7_OPROFILE *om, float *arr ) |
| 1233 |
{ |
| 1234 |
int x, q, z, k; |
| 1235 |
union { vector float v; float f[4]; } tmp; |
| 1236 |
int M = om->M; |
| 1237 |
int K = om->abc->Kp; |
| 1238 |
int nq = p7O_NQF(M); |
| 1239 |
int cell_cnt = (om->M + 1) * K; |
| 1240 |
|
| 1241 |
for (x = 0; x < K; x++) { |
| 1242 |
for (q = 0, k = 1; q < nq; q++, k++) { |
| 1243 |
tmp.v = esl_vmx_logf(om->rfv[x][q]); |
| 1244 |
for (z = 0; z < 4; z++) |
| 1245 |
if ( (K * (k+z*nq) + x) < cell_cnt) |
| 1246 |
arr[ K * (k+z*nq) + x ] = tmp.f[z]; |
| 1247 |
} |
| 1248 |
} |
| 1249 |
|
| 1250 |
return eslOK; |
| 1251 |
} |
| 1252 |
|
| 1253 |
|
| 1254 |
|
| 1255 |
|
| 1256 |
|
| 1257 |
|
| 1258 |
|
| 1259 |
|
| 1260 |
|
| 1261 |
|
| 1262 |
|
| 1263 |
|
| 1264 |
|
| 1265 |
|
| 1266 |
|
| 1267 |
|
| 1268 |
|
| 1269 |
|
| 1270 |
|
| 1271 |
|
| 1272 |
|
| 1273 |
|
| 1274 |
|
| 1275 |
|
| 1276 |
|
| 1277 |
int |
| 1278 |
p7_oprofile_GetFwdEmissionArray(const P7_OPROFILE *om, P7_BG *bg, float *arr ) |
| 1279 |
{ |
| 1280 |
int x, q, z, k; |
| 1281 |
union { vector float v; float f[4]; } tmp; |
| 1282 |
int M = om->M; |
| 1283 |
int Kp = om->abc->Kp; |
| 1284 |
int K = om->abc->K; |
| 1285 |
int nq = p7O_NQF(M); |
| 1286 |
int cell_cnt = (om->M + 1) * Kp; |
| 1287 |
|
| 1288 |
for (x = 0; x < K; x++) { |
| 1289 |
for (q = 0, k = 1; q < nq; q++, k++) { |
| 1290 |
tmp.v = om->rfv[x][q]; |
| 1291 |
for (z = 0; z < 4; z++) |
| 1292 |
if ( (Kp * (k+z*nq) + x) < cell_cnt) |
| 1293 |
arr[ Kp * (k+z*nq) + x ] = tmp.f[z] * bg->f[x]; |
| 1294 |
} |
| 1295 |
} |
| 1296 |
|
| 1297 |
|
| 1298 |
for (x = 0; x <= M; x++) |
| 1299 |
esl_abc_FExpectScVec(om->abc, arr+Kp*x, bg->f); |
| 1300 |
|
| 1301 |
return eslOK; |
| 1302 |
} |
| 1303 |
|
| 1304 |
|
| 1305 |
|
| 1306 |
|
| 1307 |
|
| 1308 |
|
| 1309 |
|
| 1310 |
|
| 1311 |
|
| 1312 |
|
| 1313 |
|
| 1314 |
static int |
| 1315 |
oprofile_dump_mf(FILE *fp, const P7_OPROFILE *om) |
| 1316 |
{ |
| 1317 |
int M = om->M; |
| 1318 |
int nq = p7O_NQB(M); |
| 1319 |
int x; |
| 1320 |
int q; |
| 1321 |
int k; |
| 1322 |
int z; |
| 1323 |
|
| 1324 |
|
| 1325 |
union { vector unsigned char v; uint8_t i[16]; } tmp; |
| 1326 |
|
| 1327 |
|
| 1328 |
fprintf(fp, " "); |
| 1329 |
for (k =1, q = 0; q < nq; q++, k++) |
| 1330 |
{ |
| 1331 |
fprintf(fp, "[ "); |
| 1332 |
for (z = 0; z < 16; z++) |
| 1333 |
if (k+z*nq <= M) fprintf(fp, "%4d ", k+z*nq); |
| 1334 |
else fprintf(fp, "%4s ", "xx"); |
| 1335 |
fprintf(fp, "]"); |
| 1336 |
} |
| 1337 |
fprintf(fp, "\n"); |
| 1338 |
|
| 1339 |
|
| 1340 |
for (x = 0; x < om->abc->Kp; x++) |
| 1341 |
{ |
| 1342 |
fprintf(fp, "(%c): ", om->abc->sym[x]); |
| 1343 |
|
| 1344 |
for (q = 0; q < nq; q++) |
| 1345 |
{ |
| 1346 |
fprintf(fp, "[ "); |
| 1347 |
tmp.v = om->rbv[x][q]; |
| 1348 |
for (z = 0; z < 16; z++) fprintf(fp, "%4d ", tmp.i[z]); |
| 1349 |
fprintf(fp, "]"); |
| 1350 |
} |
| 1351 |
fprintf(fp, "\n"); |
| 1352 |
} |
| 1353 |
fprintf(fp, "\n"); |
| 1354 |
|
| 1355 |
fprintf(fp, "t_EC,EJ: %4d\n", om->tec_b); |
| 1356 |
fprintf(fp, "t_NB,JB,CT: %4d\n", om->tjb_b); |
| 1357 |
fprintf(fp, "t_BMk: %4d\n", om->tbm_b); |
| 1358 |
fprintf(fp, "scale: %.2f\n", om->scale_b); |
| 1359 |
fprintf(fp, "base: %4d\n", om->base_b); |
| 1360 |
fprintf(fp, "bias: %4d\n", om->bias_b); |
| 1361 |
fprintf(fp, "Q: %4d\n", nq); |
| 1362 |
fprintf(fp, "M: %4d\n", M); |
| 1363 |
return eslOK; |
| 1364 |
} |
| 1365 |
|
| 1366 |
|
| 1367 |
|
| 1368 |
|
| 1369 |
|
| 1370 |
|
| 1371 |
|
| 1372 |
static int |
| 1373 |
oprofile_dump_vf(FILE *fp, const P7_OPROFILE *om) |
| 1374 |
{ |
| 1375 |
int M = om->M; |
| 1376 |
int nq = p7O_NQW(M); |
| 1377 |
int x; |
| 1378 |
int q; |
| 1379 |
int k; |
| 1380 |
int kb; |
| 1381 |
int z; |
| 1382 |
int t; |
| 1383 |
int j; |
| 1384 |
|
| 1385 |
|
| 1386 |
union { vector signed short v; int16_t i[8]; } tmp; |
| 1387 |
|
| 1388 |
|
| 1389 |
fprintf(fp, " "); |
| 1390 |
for (k =1, q = 0; q < nq; q++, k++) |
| 1391 |
{ |
| 1392 |
fprintf(fp, "[ "); |
| 1393 |
for (z = 0; z < 8; z++) |
| 1394 |
if (k+z*nq <= M) fprintf(fp, "%6d ", k+z*nq); |
| 1395 |
else fprintf(fp, "%6s ", "xx"); |
| 1396 |
fprintf(fp, "]"); |
| 1397 |
} |
| 1398 |
fprintf(fp, "\n"); |
| 1399 |
|
| 1400 |
|
| 1401 |
for (x = 0; x < om->abc->Kp; x++) |
| 1402 |
{ |
| 1403 |
fprintf(fp, "(%c): ", om->abc->sym[x]); |
| 1404 |
|
| 1405 |
|
| 1406 |
for (q = 0; q < nq; q++) |
| 1407 |
{ |
| 1408 |
fprintf(fp, "[ "); |
| 1409 |
tmp.v = om->rwv[x][q]; |
| 1410 |
for (z = 0; z < 8; z++) fprintf(fp, "%6d ", tmp.i[z]); |
| 1411 |
fprintf(fp, "]"); |
| 1412 |
} |
| 1413 |
fprintf(fp, "\n"); |
| 1414 |
} |
| 1415 |
fprintf(fp, "\n"); |
| 1416 |
|
| 1417 |
|
| 1418 |
for (t = p7O_BM; t <= p7O_II; t++) |
| 1419 |
{ |
| 1420 |
switch (t) { |
| 1421 |
case p7O_BM: fprintf(fp, "\ntBM: "); break; |
| 1422 |
case p7O_MM: fprintf(fp, "\ntMM: "); break; |
| 1423 |
case p7O_IM: fprintf(fp, "\ntIM: "); break; |
| 1424 |
case p7O_DM: fprintf(fp, "\ntDM: "); break; |
| 1425 |
case p7O_MD: fprintf(fp, "\ntMD: "); break; |
| 1426 |
case p7O_MI: fprintf(fp, "\ntMI: "); break; |
| 1427 |
case p7O_II: fprintf(fp, "\ntII: "); break; |
| 1428 |
} |
| 1429 |
|
| 1430 |
for (k = 1, q = 0; q < nq; q++, k++) |
| 1431 |
{ |
| 1432 |
switch (t) { |
| 1433 |
case p7O_BM: kb = k; break; |
| 1434 |
case p7O_MM: kb = (1 + (nq+k-2)) % nq; break; |
| 1435 |
case p7O_IM: kb = (1 + (nq+k-2)) % nq; break; |
| 1436 |
case p7O_DM: kb = (1 + (nq+k-2)) % nq; break; |
| 1437 |
case p7O_MD: kb = k; break; |
| 1438 |
case p7O_MI: kb = k; break; |
| 1439 |
case p7O_II: kb = k; break; |
| 1440 |
} |
| 1441 |
fprintf(fp, "[ "); |
| 1442 |
for (z = 0; z < 8; z++) |
| 1443 |
if (kb+z*nq <= M) fprintf(fp, "%6d ", kb+z*nq); |
| 1444 |
else fprintf(fp, "%6s ", "xx"); |
| 1445 |
fprintf(fp, "]"); |
| 1446 |
} |
| 1447 |
fprintf(fp, "\n "); |
| 1448 |
for (q = 0; q < nq; q++) |
| 1449 |
{ |
| 1450 |
fprintf(fp, "[ "); |
| 1451 |
tmp.v = om->twv[q*7 + t]; |
| 1452 |
for (z = 0; z < 8; z++) fprintf(fp, "%6d ", tmp.i[z]); |
| 1453 |
fprintf(fp, "]"); |
| 1454 |
} |
| 1455 |
fprintf(fp, "\n"); |
| 1456 |
} |
| 1457 |
|
| 1458 |
|
| 1459 |
fprintf(fp, "\ntDD: "); |
| 1460 |
for (k =1, q = 0; q < nq; q++, k++) |
| 1461 |
{ |
| 1462 |
fprintf(fp, "[ "); |
| 1463 |
for (z = 0; z < 8; z++) |
| 1464 |
if (k+z*nq <= M) fprintf(fp, "%6d ", k+z*nq); |
| 1465 |
else fprintf(fp, "%6s ", "xx"); |
| 1466 |
fprintf(fp, "]"); |
| 1467 |
} |
| 1468 |
fprintf(fp, "\n "); |
| 1469 |
for (j = nq*7, q = 0; q < nq; q++, j++) |
| 1470 |
{ |
| 1471 |
fprintf(fp, "[ "); |
| 1472 |
tmp.v = om->twv[j]; |
| 1473 |
for (z = 0; z < 8; z++) fprintf(fp, "%6d ", tmp.i[z]); |
| 1474 |
fprintf(fp, "]"); |
| 1475 |
} |
| 1476 |
fprintf(fp, "\n"); |
| 1477 |
|
| 1478 |
fprintf(fp, "E->C: %6d E->J: %6d\n", om->xw[p7O_E][p7O_MOVE], om->xw[p7O_E][p7O_LOOP]); |
| 1479 |
fprintf(fp, "N->B: %6d N->N: %6d\n", om->xw[p7O_N][p7O_MOVE], om->xw[p7O_N][p7O_LOOP]); |
| 1480 |
fprintf(fp, "J->B: %6d J->J: %6d\n", om->xw[p7O_J][p7O_MOVE], om->xw[p7O_J][p7O_LOOP]); |
| 1481 |
fprintf(fp, "C->T: %6d C->C: %6d\n", om->xw[p7O_C][p7O_MOVE], om->xw[p7O_C][p7O_LOOP]); |
| 1482 |
|
| 1483 |
fprintf(fp, "scale: %6.2f\n", om->scale_w); |
| 1484 |
fprintf(fp, "base: %6d\n", om->base_w); |
| 1485 |
fprintf(fp, "bound: %6d\n", om->ddbound_w); |
| 1486 |
fprintf(fp, "Q: %6d\n", nq); |
| 1487 |
fprintf(fp, "M: %6d\n", M); |
| 1488 |
return eslOK; |
| 1489 |
} |
| 1490 |
|
| 1491 |
|
| 1492 |
|
| 1493 |
|
| 1494 |
|
| 1495 |
|
| 1496 |
|
| 1497 |
|
| 1498 |
|
| 1499 |
static int |
| 1500 |
oprofile_dump_fb(FILE *fp, const P7_OPROFILE *om, int width, int precision) |
| 1501 |
{ |
| 1502 |
int M = om->M; |
| 1503 |
int nq = p7O_NQF(M); |
| 1504 |
int x; |
| 1505 |
int q; |
| 1506 |
int k; |
| 1507 |
int kb; |
| 1508 |
int z; |
| 1509 |
int t; |
| 1510 |
int j; |
| 1511 |
|
| 1512 |
|
| 1513 |
union { vector float v; float x[4]; } tmp; |
| 1514 |
|
| 1515 |
|
| 1516 |
for (x = 0; x < om->abc->Kp; x++) |
| 1517 |
{ |
| 1518 |
fprintf(fp, "(%c): ", om->abc->sym[x]); |
| 1519 |
for (k =1, q = 0; q < nq; q++, k++) |
| 1520 |
{ |
| 1521 |
fprintf(fp, "[ "); |
| 1522 |
for (z = 0; z < 4; z++) |
| 1523 |
if (k+z*nq <= M) fprintf(fp, "%*d ", width, k+z*nq); |
| 1524 |
else fprintf(fp, "%*s ", width, "xx"); |
| 1525 |
fprintf(fp, "]"); |
| 1526 |
} |
| 1527 |
fprintf(fp, "\nmat: "); |
| 1528 |
for (q = 0; q < nq; q++) |
| 1529 |
{ |
| 1530 |
fprintf(fp, "[ "); |
| 1531 |
tmp.v = om->rfv[x][q]; |
| 1532 |
for (z = 0; z < 4; z++) fprintf(fp, "%*.*f ", width, precision, tmp.x[z]); |
| 1533 |
fprintf(fp, "]"); |
| 1534 |
} |
| 1535 |
fprintf(fp, "\n\n"); |
| 1536 |
} |
| 1537 |
|
| 1538 |
|
| 1539 |
for (t = p7O_BM; t <= p7O_II; t++) |
| 1540 |
{ |
| 1541 |
switch (t) { |
| 1542 |
case p7O_BM: fprintf(fp, "\ntBM: "); break; |
| 1543 |
case p7O_MM: fprintf(fp, "\ntMM: "); break; |
| 1544 |
case p7O_IM: fprintf(fp, "\ntIM: "); break; |
| 1545 |
case p7O_DM: fprintf(fp, "\ntDM: "); break; |
| 1546 |
case p7O_MD: fprintf(fp, "\ntMD: "); break; |
| 1547 |
case p7O_MI: fprintf(fp, "\ntMI: "); break; |
| 1548 |
case p7O_II: fprintf(fp, "\ntII: "); break; |
| 1549 |
} |
| 1550 |
for (k = 1, q = 0; q < nq; q++, k++) |
| 1551 |
{ |
| 1552 |
switch (t) { |
| 1553 |
case p7O_MM: |
| 1554 |
case p7O_IM: |
| 1555 |
case p7O_DM: |
| 1556 |
kb = (1 + (nq+k-2)) % nq; |
| 1557 |
break; |
| 1558 |
case p7O_BM: |
| 1559 |
case p7O_MD: |
| 1560 |
case p7O_MI: |
| 1561 |
case p7O_II: |
| 1562 |
kb = k; |
| 1563 |
break; |
| 1564 |
} |
| 1565 |
fprintf(fp, "[ "); |
| 1566 |
for (z = 0; z < 4; z++) |
| 1567 |
if (kb+z*nq <= M) fprintf(fp, "%*d ", width, kb+z*nq); |
| 1568 |
else fprintf(fp, "%*s ", width, "xx"); |
| 1569 |
fprintf(fp, "]"); |
| 1570 |
} |
| 1571 |
fprintf(fp, "\n "); |
| 1572 |
for (q = 0; q < nq; q++) |
| 1573 |
{ |
| 1574 |
fprintf(fp, "[ "); |
| 1575 |
tmp.v = om->tfv[q*7 + t]; |
| 1576 |
for (z = 0; z < 4; z++) fprintf(fp, "%*.*f ", width, precision, tmp.x[z]); |
| 1577 |
fprintf(fp, "]"); |
| 1578 |
} |
| 1579 |
fprintf(fp, "\n"); |
| 1580 |
} |
| 1581 |
|
| 1582 |
|
| 1583 |
fprintf(fp, "\ntDD: "); |
| 1584 |
for (k =1, q = 0; q < nq; q++, k++) |
| 1585 |
{ |
| 1586 |
fprintf(fp, "[ "); |
| 1587 |
for (z = 0; z < 4; z++) |
| 1588 |
if (k+z*nq <= M) fprintf(fp, "%*d ", width, k+z*nq); |
| 1589 |
else fprintf(fp, "%*s ", width, "xx"); |
| 1590 |
fprintf(fp, "]"); |
| 1591 |
} |
| 1592 |
fprintf(fp, "\n "); |
| 1593 |
for (j = nq*7, q = 0; q < nq; q++, j++) |
| 1594 |
{ |
| 1595 |
fprintf(fp, "[ "); |
| 1596 |
tmp.v = om->tfv[j]; |
| 1597 |
for (z = 0; z < 4; z++) fprintf(fp, "%*.*f ", width, precision, tmp.x[z]); |
| 1598 |
fprintf(fp, "]"); |
| 1599 |
} |
| 1600 |
fprintf(fp, "\n"); |
| 1601 |
|
| 1602 |
|
| 1603 |
fprintf(fp, "E->C: %*.*f E->J: %*.*f\n", width, precision, om->xf[p7O_E][p7O_MOVE], width, precision, om->xf[p7O_E][p7O_LOOP]); |
| 1604 |
fprintf(fp, "N->B: %*.*f N->N: %*.*f\n", width, precision, om->xf[p7O_N][p7O_MOVE], width, precision, om->xf[p7O_N][p7O_LOOP]); |
| 1605 |
fprintf(fp, "J->B: %*.*f J->J: %*.*f\n", width, precision, om->xf[p7O_J][p7O_MOVE], width, precision, om->xf[p7O_J][p7O_LOOP]); |
| 1606 |
fprintf(fp, "C->T: %*.*f C->C: %*.*f\n", width, precision, om->xf[p7O_C][p7O_MOVE], width, precision, om->xf[p7O_C][p7O_LOOP]); |
| 1607 |
fprintf(fp, "Q: %d\n", nq); |
| 1608 |
fprintf(fp, "M: %d\n", M); |
| 1609 |
return eslOK; |
| 1610 |
} |
| 1611 |
|
| 1612 |
|
| 1613 |
|
| 1614 |
|
| 1615 |
|
| 1616 |
|
| 1617 |
|
| 1618 |
|
| 1619 |
|
| 1620 |
|
| 1621 |
|
| 1622 |
|
| 1623 |
|
| 1624 |
|
| 1625 |
|
| 1626 |
|
| 1627 |
|
| 1628 |
int |
| 1629 |
p7_oprofile_Dump(FILE *fp, const P7_OPROFILE *om) |
| 1630 |
{ |
| 1631 |
int status; |
| 1632 |
|
| 1633 |
fprintf(fp, "Dump of a <P7_OPROFILE> ::\n"); |
| 1634 |
|
| 1635 |
fprintf(fp, "\n -- float part, odds ratios for Forward/Backward:\n"); |
| 1636 |
if ((status = oprofile_dump_fb(fp, om, 8, 5)) != eslOK) return status; |
| 1637 |
|
| 1638 |
fprintf(fp, "\n -- sword part, log odds for ViterbiFilter(): \n"); |
| 1639 |
if ((status = oprofile_dump_vf(fp, om)) != eslOK) return status; |
| 1640 |
|
| 1641 |
fprintf(fp, "\n -- uchar part, log odds for MSVFilter(): \n"); |
| 1642 |
if ((status = oprofile_dump_mf(fp, om)) != eslOK) return status; |
| 1643 |
|
| 1644 |
return eslOK; |
| 1645 |
} |
| 1646 |
|
| 1647 |
|
| 1648 |
|
| 1649 |
|
| 1650 |
|
| 1651 |
|
| 1652 |
|
| 1653 |
|
| 1654 |
|
| 1655 |
|
| 1656 |
|
| 1657 |
|
| 1658 |
|
| 1659 |
|
| 1660 |
|
| 1661 |
|
| 1662 |
|
| 1663 |
|
| 1664 |
|
| 1665 |
|
| 1666 |
|
| 1667 |
|
| 1668 |
|
| 1669 |
|
| 1670 |
|
| 1671 |
int |
| 1672 |
p7_oprofile_Sample(ESL_RANDOMNESS *r, const ESL_ALPHABET *abc, const P7_BG *bg, int M, int L, |
| 1673 |
P7_HMM **opt_hmm, P7_PROFILE **opt_gm, P7_OPROFILE **ret_om) |
| 1674 |
{ |
| 1675 |
P7_HMM *hmm = NULL; |
| 1676 |
P7_PROFILE *gm = NULL; |
| 1677 |
P7_OPROFILE *om = NULL; |
| 1678 |
int status; |
| 1679 |
|
| 1680 |
if ((gm = p7_profile_Create (M, abc)) == NULL) { status = eslEMEM; goto ERROR; } |
| 1681 |
if ((om = p7_oprofile_Create(M, abc)) == NULL) { status = eslEMEM; goto ERROR; } |
| 1682 |
|
| 1683 |
if ((status = p7_hmm_Sample(r, M, abc, &hmm)) != eslOK) goto ERROR; |
| 1684 |
if ((status = p7_ProfileConfig(hmm, bg, gm, L, p7_LOCAL)) != eslOK) goto ERROR; |
| 1685 |
if ((status = p7_oprofile_Convert(gm, om)) != eslOK) goto ERROR; |
| 1686 |
if ((status = p7_oprofile_ReconfigLength(om, L)) != eslOK) goto ERROR; |
| 1687 |
|
| 1688 |
if (opt_hmm != NULL) *opt_hmm = hmm; else p7_hmm_Destroy(hmm); |
| 1689 |
if (opt_gm != NULL) *opt_gm = gm; else p7_profile_Destroy(gm); |
| 1690 |
*ret_om = om; |
| 1691 |
return eslOK; |
| 1692 |
|
| 1693 |
ERROR: |
| 1694 |
if (opt_hmm != NULL) *opt_hmm = NULL; |
| 1695 |
if (opt_gm != NULL) *opt_gm = NULL; |
| 1696 |
*ret_om = NULL; |
| 1697 |
return status; |
| 1698 |
} |
| 1699 |
|
| 1700 |
|
| 1701 |
|
| 1702 |
|
| 1703 |
|
| 1704 |
|
| 1705 |
|
| 1706 |
|
| 1707 |
|
| 1708 |
|
| 1709 |
|
| 1710 |
|
| 1711 |
|
| 1712 |
|
| 1713 |
|
| 1714 |
|
| 1715 |
|
| 1716 |
|
| 1717 |
|
| 1718 |
|
| 1719 |
|
| 1720 |
|
| 1721 |
|
| 1722 |
|
| 1723 |
|
| 1724 |
|
| 1725 |
int |
| 1726 |
p7_oprofile_Compare(const P7_OPROFILE *om1, const P7_OPROFILE *om2, float tol, char *errmsg) |
| 1727 |
{ |
| 1728 |
int Q4 = p7O_NQF(om1->M); |
| 1729 |
int Q8 = p7O_NQW(om1->M); |
| 1730 |
int Q16 = p7O_NQB(om1->M); |
| 1731 |
int q, r, x, y; |
| 1732 |
|
| 1733 |
union { vector unsigned char v; uint8_t c[16]; } a16, b16; |
| 1734 |
union { vector signed short v; int16_t w[8]; } a8, b8; |
| 1735 |
union { vector float v; float x[4]; } a4, b4; |
| 1736 |
|
| 1737 |
if (om1->mode != om2->mode) ESL_FAIL(eslFAIL, errmsg, "comparison failed: mode"); |
| 1738 |
if (om1->L != om2->L) ESL_FAIL(eslFAIL, errmsg, "comparison failed: L"); |
| 1739 |
if (om1->M != om2->M) ESL_FAIL(eslFAIL, errmsg, "comparison failed: M"); |
| 1740 |
if (om1->nj != om2->nj) ESL_FAIL(eslFAIL, errmsg, "comparison failed: nj"); |
| 1741 |
if (om1->abc->type != om2->abc->type) ESL_FAIL(eslFAIL, errmsg, "comparison failed: alphabet type"); |
| 1742 |
|
| 1743 |
|
| 1744 |
for (x = 0; x < om1->abc->Kp; x++) |
| 1745 |
for (q = 0; q < Q16; q++) |
| 1746 |
{ |
| 1747 |
a16.v = om1->rbv[x][q]; b16.v = om2->rbv[x][q]; |
| 1748 |
for (r = 0; r < 16; r++) if (a16.c[r] != b16.c[r]) ESL_FAIL(eslFAIL, errmsg, "comparison failed: rb[%d] elem %d", q, r); |
| 1749 |
} |
| 1750 |
if (om1->tbm_b != om2->tbm_b) ESL_FAIL(eslFAIL, errmsg, "comparison failed: tbm_b"); |
| 1751 |
if (om1->tec_b != om2->tec_b) ESL_FAIL(eslFAIL, errmsg, "comparison failed: tec_b"); |
| 1752 |
if (om1->tjb_b != om2->tjb_b) ESL_FAIL(eslFAIL, errmsg, "comparison failed: tjb_b"); |
| 1753 |
if (om1->scale_b != om2->scale_b) ESL_FAIL(eslFAIL, errmsg, "comparison failed: scale_b"); |
| 1754 |
if (om1->base_b != om2->base_b) ESL_FAIL(eslFAIL, errmsg, "comparison failed: base_b"); |
| 1755 |
if (om1->bias_b != om2->bias_b) ESL_FAIL(eslFAIL, errmsg, "comparison failed: bias_b"); |
| 1756 |
|
| 1757 |
|
| 1758 |
for (x = 0; x < om1->abc->Kp; x++) |
| 1759 |
for (q = 0; q < Q8; q++) |
| 1760 |
{ |
| 1761 |
a8.v = om1->rwv[x][q]; b8.v = om2->rwv[x][q]; |
| 1762 |
for (r = 0; r < 8; r++) if (a8.w[r] != b8.w[r]) ESL_FAIL(eslFAIL, errmsg, "comparison failed: rw[%d] elem %d", q, r); |
| 1763 |
} |
| 1764 |
for (q = 0; q < 8*Q16; q++) |
| 1765 |
{ |
| 1766 |
a8.v = om1->twv[q]; b8.v = om2->twv[q]; |
| 1767 |
for (r = 0; r < 8; r++) if (a8.w[r] != b8.w[r]) ESL_FAIL(eslFAIL, errmsg, "comparison failed: tw[%d] elem %d", q, r); |
| 1768 |
} |
| 1769 |
for (x = 0; x < p7O_NXSTATES; x++) |
| 1770 |
for (y = 0; y < p7O_NXTRANS; y++) |
| 1771 |
if (om1->xw[x][y] != om2->xw[x][y]) ESL_FAIL(eslFAIL, errmsg, "comparison failed: xw[%d][%d]", x, y); |
| 1772 |
|
| 1773 |
if (om1->scale_w != om2->scale_w) ESL_FAIL(eslFAIL, errmsg, "comparison failed: scale"); |
| 1774 |
if (om1->base_w != om2->base_w) ESL_FAIL(eslFAIL, errmsg, "comparison failed: base"); |
| 1775 |
if (om1->ddbound_w != om2->ddbound_w) ESL_FAIL(eslFAIL, errmsg, "comparison failed: ddbound_w"); |
| 1776 |
|
| 1777 |
|
| 1778 |
for (x = 0; x < om1->abc->Kp; x++) |
| 1779 |
for (q = 0; q < Q4; q++) |
| 1780 |
{ |
| 1781 |
a4.v = om1->rfv[x][q]; b4.v = om2->rfv[x][q]; |
| 1782 |
for (r = 0; r < 4; r++) if (esl_FCompare_old(a4.x[r], b4.x[r], tol) != eslOK) ESL_FAIL(eslFAIL, errmsg, "comparison failed: rf[%d] elem %d", q, r); |
| 1783 |
} |
| 1784 |
for (q = 0; q < 8*Q4; q++) |
| 1785 |
{ |
| 1786 |
a4.v = om1->tfv[q]; b4.v = om2->tfv[q]; |
| 1787 |
for (r = 0; r < 4; r++) if (a4.x[r] != b4.x[r]) ESL_FAIL(eslFAIL, errmsg, "comparison failed: tf[%d] elem %d", q, r); |
| 1788 |
} |
| 1789 |
for (x = 0; x < p7O_NXSTATES; x++) |
| 1790 |
if (esl_vec_FCompare(om1->xf[x], om2->xf[x], p7O_NXTRANS, tol) != eslOK) ESL_FAIL(eslFAIL, errmsg, "comparison failed: xf[%d] vector", x); |
| 1791 |
|
| 1792 |
for (x = 0; x < p7_NOFFSETS; x++) |
| 1793 |
if (om1->offs[x] != om2->offs[x]) ESL_FAIL(eslFAIL, errmsg, "comparison failed: offs[%d]", x); |
| 1794 |
|
| 1795 |
if (esl_strcmp(om1->name, om2->name) != 0) ESL_FAIL(eslFAIL, errmsg, "comparison failed: name"); |
| 1796 |
if (esl_strcmp(om1->acc, om2->acc) != 0) ESL_FAIL(eslFAIL, errmsg, "comparison failed: acc"); |
| 1797 |
if (esl_strcmp(om1->desc, om2->desc) != 0) ESL_FAIL(eslFAIL, errmsg, "comparison failed: desc"); |
| 1798 |
if (esl_strcmp(om1->rf, om2->rf) != 0) ESL_FAIL(eslFAIL, errmsg, "comparison failed: ref"); |
| 1799 |
if (esl_strcmp(om1->mm, om2->mm) != 0) ESL_FAIL(eslFAIL, errmsg, "comparison failed: mm"); |
| 1800 |
if (esl_strcmp(om1->cs, om2->cs) != 0) ESL_FAIL(eslFAIL, errmsg, "comparison failed: cs"); |
| 1801 |
if (esl_strcmp(om1->consensus, om2->consensus) != 0) ESL_FAIL(eslFAIL, errmsg, "comparison failed: consensus"); |
| 1802 |
|
| 1803 |
if (esl_vec_FCompare(om1->evparam, om2->evparam, p7_NEVPARAM, tol) != eslOK) ESL_FAIL(eslFAIL, errmsg, "comparison failed: evparam vector"); |
| 1804 |
if (esl_vec_FCompare(om1->cutoff, om2->cutoff, p7_NCUTOFFS, tol) != eslOK) ESL_FAIL(eslFAIL, errmsg, "comparison failed: cutoff vector"); |
| 1805 |
if (esl_vec_FCompare(om1->compo, om2->compo, p7_MAXABET, tol) != eslOK) ESL_FAIL(eslFAIL, errmsg, "comparison failed: compo vector"); |
| 1806 |
|
| 1807 |
return eslOK; |
| 1808 |
} |
| 1809 |
|
| 1810 |
|
| 1811 |
|
| 1812 |
|
| 1813 |
|
| 1814 |
|
| 1815 |
|
| 1816 |
|
| 1817 |
|
| 1818 |
|
| 1819 |
|
| 1820 |
|
| 1821 |
|
| 1822 |
|
| 1823 |
|
| 1824 |
int |
| 1825 |
p7_profile_SameAsMF(const P7_OPROFILE *om, P7_PROFILE *gm) |
| 1826 |
{ |
| 1827 |
int k,x; |
| 1828 |
float tbm = roundf(om->scale_b * (log(2.0f / ((float) gm->M * (float) (gm->M+1))))); |
| 1829 |
|
| 1830 |
|
| 1831 |
esl_vec_FSet(gm->tsc, p7P_NTRANS * gm->M, -eslINFINITY); |
| 1832 |
for (k = 1; k < gm->M; k++) p7P_TSC(gm, k, p7P_MM) = 0.0f; |
| 1833 |
for (k = 0; k < gm->M; k++) p7P_TSC(gm, k, p7P_BM) = tbm; |
| 1834 |
|
| 1835 |
|
| 1836 |
for (x = 0; x < gm->abc->Kp; x++) |
| 1837 |
for (k = 0; k <= gm->M; k++) |
| 1838 |
{ |
| 1839 |
gm->rsc[x][k*2] = (gm->rsc[x][k*2] <= -eslINFINITY) ? -eslINFINITY : roundf(om->scale_b * gm->rsc[x][k*2]); |
| 1840 |
gm->rsc[x][k*2+1] = 0; |
| 1841 |
} |
| 1842 |
|
| 1843 |
|
| 1844 |
for (k = 0; k < p7P_NXSTATES; k++) |
| 1845 |
for (x = 0; x < p7P_NXTRANS; x++) |
| 1846 |
gm->xsc[k][x] = (gm->xsc[k][x] <= -eslINFINITY) ? -eslINFINITY : roundf(om->scale_b * gm->xsc[k][x]); |
| 1847 |
|
| 1848 |
|
| 1849 |
gm->xsc[p7P_N][p7P_LOOP] = gm->xsc[p7P_J][p7P_LOOP] = gm->xsc[p7P_C][p7P_LOOP] = 0; |
| 1850 |
|
| 1851 |
return eslOK; |
| 1852 |
} |
| 1853 |
|
| 1854 |
|
| 1855 |
|
| 1856 |
|
| 1857 |
|
| 1858 |
|
| 1859 |
|
| 1860 |
|
| 1861 |
|
| 1862 |
|
| 1863 |
|
| 1864 |
|
| 1865 |
|
| 1866 |
|
| 1867 |
|
| 1868 |
|
| 1869 |
|
| 1870 |
|
| 1871 |
|
| 1872 |
|
| 1873 |
|
| 1874 |
|
| 1875 |
|
| 1876 |
|
| 1877 |
|
| 1878 |
|
| 1879 |
|
| 1880 |
|
| 1881 |
|
| 1882 |
|
| 1883 |
|
| 1884 |
|
| 1885 |
int |
| 1886 |
p7_profile_SameAsVF(const P7_OPROFILE *om, P7_PROFILE *gm) |
| 1887 |
{ |
| 1888 |
int k; |
| 1889 |
int x; |
| 1890 |
|
| 1891 |
|
| 1892 |
|
| 1893 |
for (x = 0; x < gm->M*p7P_NTRANS; x++) |
| 1894 |
gm->tsc[x] = (gm->tsc[x] <= -eslINFINITY) ? -eslINFINITY : roundf(om->scale_w * gm->tsc[x]); |
| 1895 |
|
| 1896 |
|
| 1897 |
for (x = p7P_II; x < gm->M*p7P_NTRANS; x += p7P_NTRANS) |
| 1898 |
if (gm->tsc[x] == 0.0) gm->tsc[x] = -1.0; |
| 1899 |
|
| 1900 |
|
| 1901 |
for (x = 0; x < gm->abc->Kp; x++) |
| 1902 |
for (k = 0; k <= gm->M; k++) |
| 1903 |
{ |
| 1904 |
gm->rsc[x][k*2] = (gm->rsc[x][k*2] <= -eslINFINITY) ? -eslINFINITY : roundf(om->scale_w * gm->rsc[x][k*2]); |
| 1905 |
gm->rsc[x][k*2+1] = 0.0; |
| 1906 |
} |
| 1907 |
|
| 1908 |
|
| 1909 |
for (k = 0; k < p7P_NXSTATES; k++) |
| 1910 |
for (x = 0; x < p7P_NXTRANS; x++) |
| 1911 |
gm->xsc[k][x] = (gm->xsc[k][x] <= -eslINFINITY) ? -eslINFINITY : roundf(om->scale_w * gm->xsc[k][x]); |
| 1912 |
|
| 1913 |
|
| 1914 |
gm->xsc[p7P_N][p7P_LOOP] = gm->xsc[p7P_J][p7P_LOOP] = gm->xsc[p7P_C][p7P_LOOP] = 0.0; |
| 1915 |
|
| 1916 |
return eslOK; |
| 1917 |
} |
| 1918 |
|
| 1919 |
|
| 1920 |
|
| 1921 |
|
| 1922 |
|
| 1923 |
|
| 1924 |
|
| 1925 |
|
| 1926 |
|
| 1927 |
#ifdef p7OPROFILE_BENCHMARK |
| 1928 |
|
| 1929 |
|
| 1930 |
|
| 1931 |
|
| 1932 |
|
| 1933 |
|
| 1934 |
#include <p7_config.h> |
| 1935 |
|
| 1936 |
#include "easel.h" |
| 1937 |
#include "esl_alphabet.h" |
| 1938 |
#include "esl_getopts.h" |
| 1939 |
#include "esl_random.h" |
| 1940 |
#include "esl_stopwatch.h" |
| 1941 |
|
| 1942 |
#include "hmmer.h" |
| 1943 |
#include "impl_vmx.h" |
| 1944 |
|
| 1945 |
static ESL_OPTIONS options[] = { |
| 1946 |
|
| 1947 |
{ "-h", eslARG_NONE, FALSE, NULL, NULL, NULL, NULL, NULL, "show brief help on version and usage", 0 }, |
| 1948 |
{ "-L", eslARG_INT, "400", NULL, NULL, NULL, NULL, NULL, "length of target sequence", 0 }, |
| 1949 |
{ "-N", eslARG_INT, "100000", NULL, NULL, NULL, NULL, NULL, "number of conversions to time", 0 }, |
| 1950 |
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, |
| 1951 |
}; |
| 1952 |
static char usage[] = "[-options] <hmmfile>"; |
| 1953 |
static char banner[] = "benchmark driver for the generic implementation"; |
| 1954 |
|
| 1955 |
int |
| 1956 |
main(int argc, char **argv) |
| 1957 |
{ |
| 1958 |
ESL_GETOPTS *go = p7_CreateDefaultApp(options, 1, argc, argv, banner, usage); |
| 1959 |
char *hmmfile = esl_opt_GetArg(go, 1); |
| 1960 |
ESL_STOPWATCH *w = esl_stopwatch_Create(); |
| 1961 |
ESL_ALPHABET *abc = NULL; |
| 1962 |
P7_HMMFILE *hfp = NULL; |
| 1963 |
P7_HMM *hmm = NULL; |
| 1964 |
P7_BG *bg = NULL; |
| 1965 |
P7_PROFILE *gm = NULL; |
| 1966 |
P7_OPROFILE *om = NULL; |
| 1967 |
int L = esl_opt_GetInteger(go, "-L"); |
| 1968 |
int N = esl_opt_GetInteger(go, "-N"); |
| 1969 |
int i; |
| 1970 |
|
| 1971 |
if (p7_hmmfile_Open(hmmfile, NULL, &hfp, NULL) != eslOK) p7_Fail("Failed to open HMM file %s", hmmfile); |
| 1972 |
if (p7_hmmfile_Read(hfp, &abc, &hmm) != eslOK) p7_Fail("Failed to read HMM"); |
| 1973 |
|
| 1974 |
bg = p7_bg_Create(abc); |
| 1975 |
p7_bg_SetLength(bg, L); |
| 1976 |
gm = p7_profile_Create(hmm->M, abc); |
| 1977 |
p7_ProfileConfig(hmm, bg, gm, L, p7_LOCAL); |
| 1978 |
om = p7_oprofile_Create(gm->M, abc); |
| 1979 |
|
| 1980 |
esl_stopwatch_Start(w); |
| 1981 |
for (i = 0; i < N; i++) |
| 1982 |
p7_oprofile_Convert(gm, om); |
| 1983 |
esl_stopwatch_Stop(w); |
| 1984 |
esl_stopwatch_Display(stdout, w, "# CPU time: "); |
| 1985 |
printf("# M = %d\n", gm->M); |
| 1986 |
|
| 1987 |
p7_oprofile_Destroy(om); |
| 1988 |
p7_profile_Destroy(gm); |
| 1989 |
p7_bg_Destroy(bg); |
| 1990 |
p7_hmm_Destroy(hmm); |
| 1991 |
p7_hmmfile_Close(hfp); |
| 1992 |
esl_alphabet_Destroy(abc); |
| 1993 |
esl_stopwatch_Destroy(w); |
| 1994 |
esl_getopts_Destroy(go); |
| 1995 |
return 0; |
| 1996 |
} |
| 1997 |
#endif |
| 1998 |
|
| 1999 |
|
| 2000 |
|
| 2001 |
|
| 2002 |
|
| 2003 |
|
| 2004 |
|
| 2005 |
|
| 2006 |
|
| 2007 |
#ifdef p7OPROFILE_TESTDRIVE |
| 2008 |
|
| 2009 |
|
| 2010 |
#endif |
| 2011 |
|
| 2012 |
|
| 2013 |
|
| 2014 |
|
| 2015 |
|
| 2016 |
|
| 2017 |
|
| 2018 |
|
| 2019 |
#ifdef p7OPROFILE_TESTDRIVE |
| 2020 |
|
| 2021 |
|
| 2022 |
#endif |
| 2023 |
|
| 2024 |
|
| 2025 |
|
| 2026 |
|
| 2027 |
|
| 2028 |
|
| 2029 |
#ifdef p7OPROFILE_EXAMPLE |
| 2030 |
|
| 2031 |
|
| 2032 |
|
| 2033 |
#include <p7_config.h> |
| 2034 |
#include <stdlib.h> |
| 2035 |
#include "easel.h" |
| 2036 |
#include "hmmer.h" |
| 2037 |
|
| 2038 |
int |
| 2039 |
main(int argc, char **argv) |
| 2040 |
{ |
| 2041 |
char *hmmfile = argv[1]; |
| 2042 |
ESL_ALPHABET *abc = NULL; |
| 2043 |
P7_HMMFILE *hfp = NULL; |
| 2044 |
P7_HMM *hmm = NULL; |
| 2045 |
P7_BG *bg = NULL; |
| 2046 |
P7_PROFILE *gm = NULL; |
| 2047 |
P7_OPROFILE *om1 = NULL; |
| 2048 |
P7_OPROFILE *om2 = NULL; |
| 2049 |
int status; |
| 2050 |
char errbuf[eslERRBUFSIZE]; |
| 2051 |
|
| 2052 |
status = p7_hmmfile_Open(hmmfile, NULL, &hfp, errbuf); |
| 2053 |
if (status == eslENOTFOUND) p7_Fail("File existence/permissions problem in trying to open HMM file %s.\n%s\n", hmmfile, errbuf); |
| 2054 |
else if (status == eslEFORMAT) p7_Fail("File format problem in trying to open HMM file %s.\n%s\n", hmmfile, errbuf); |
| 2055 |
else if (status != eslOK) p7_Fail("Unexpected error %d in opening HMM file %s.\n%s\n", status, hmmfile, errbuf); |
| 2056 |
|
| 2057 |
status = p7_hmmfile_Read(hfp, &abc, &hmm); |
| 2058 |
if (status == eslEFORMAT) p7_Fail("Bad file format in HMM file %s:\n%s\n", hfp->fname, hfp->errbuf); |
| 2059 |
else if (status == eslEINCOMPAT) p7_Fail("HMM in %s is not in the expected %s alphabet\n", hfp->fname, esl_abc_DecodeType(abc->type)); |
| 2060 |
else if (status == eslEOF) p7_Fail("Empty HMM file %s? No HMM data found.\n", hfp->fname); |
| 2061 |
else if (status != eslOK) p7_Fail("Unexpected error in reading HMMs from %s\n", hfp->fname); |
| 2062 |
|
| 2063 |
bg = p7_bg_Create(abc); |
| 2064 |
gm = p7_profile_Create(hmm->M, abc); |
| 2065 |
om1 = p7_oprofile_Create(hmm->M, abc); |
| 2066 |
p7_ProfileConfig(hmm, bg, gm, 400, p7_LOCAL); |
| 2067 |
p7_oprofile_Convert(gm, om1); |
| 2068 |
|
| 2069 |
p7_oprofile_Dump(stdout, om1); |
| 2070 |
|
| 2071 |
om2 = p7_oprofile_Copy(om1); |
| 2072 |
if (p7_oprofile_Compare(om1, om2, 0.001f, errbuf) != eslOK) |
| 2073 |
printf ("ERROR %s\n", errbuf); |
| 2074 |
|
| 2075 |
p7_oprofile_Destroy(om1); |
| 2076 |
p7_oprofile_Destroy(om2); |
| 2077 |
p7_profile_Destroy(gm); |
| 2078 |
p7_bg_Destroy(bg); |
| 2079 |
p7_hmm_Destroy(hmm); |
| 2080 |
p7_hmmfile_Close(hfp); |
| 2081 |
esl_alphabet_Destroy(abc); |
| 2082 |
return eslOK; |
| 2083 |
} |
| 2084 |
#endif |
| 2085 |
|
| 2086 |
|
| 2087 |
|