Debian Codegraph @

hmmer/src/impl_neon/vitscore.c

raw symbols SCIP
1 /* Viterbi score implementation; NEON version.
2 *
3 * This is a SIMD vectorized, striped, interleaved, one-row O(M)
4 * memory implementation of the Viterbi algorithm, for calculating an
5 * accurate Viterbi score, without traceback.
6 *
7 * This implementation has full range and precision, so it may be used
8 * in any alignment mode (not just local), and on any target sequence
9 * (not excluding high-scoring ones).
10 *
11 * The optimized profile must be configured to contain lspace float
12 * scores, not its normal pspace float scores.
13 *
14 * Contents:
15 * 1. Viterbi score implementation.
16 * 2. Benchmark driver.
17 * 3. Unit tests.
18 * 4. Test driver.
19 * 5. Example.
20 *
21 * SRE, Sun Aug 3 13:10:24 2008 [St. Louis]
22 */
23 #include <p7_config.h>
24
25 #include <stdio.h>
26 #include <math.h>
27
28
29 #include "easel.h"
30 #include "esl_neon.h"
31
32 #include "hmmer.h"
33 #include "impl_neon.h"
34
35 /*****************************************************************
36 * 1. Viterbi score implementation
37 *****************************************************************/
38
39 /* Function: p7_ViterbiScore()
40 * Synopsis: Calculates Viterbi score, correctly, and vewy vewy fast.
41 * Incept: SRE, Tue Nov 27 09:15:24 2007 [Janelia]
42 *
43 * Purpose: Calculates the Viterbi score for sequence <dsq> of length <L>
44 * residues, using optimized profile <om>, and a preallocated
45 * one-row DP matrix <ox>. Return the Viterbi score (in nats)
46 * in <ret_sc>.
47 *
48 * The model <om> must be configured specially to have
49 * lspace float scores, not its usual pspace float scores for
50 * <p7_ForwardFilter()>.
51 *
52 * As with all <*Score()> implementations, the score is
53 * accurate (full range and precision) and can be
54 * calculated on models in any mode, not only local modes.
55 *
56 * Args: dsq - digital target sequence, 1..L
57 * L - length of dsq in residues
58 * om - optimized profile
59 * ox - DP matrix
60 * ret_sc - RETURN: Viterbi score (in nats)
61 *
62 * Returns: <eslOK> on success.
63 *
64 * Throws: <eslEINVAL> if <ox> allocation is too small.
65 */
66 int
67 p7_ViterbiScore(const ESL_DSQ *dsq, int L, const P7_OPROFILE *om, P7_OMX *ox, float *ret_sc)
68 {
69 register float32x4_t mpv, dpv, ipv; /* previous row values */
70 register float32x4_t sv; /* temp storage of 1 curr row value in progress */
71 register float32x4_t dcv; /* delayed storage of D(i,q+1) */
72 register float32x4_t xEv; /* E state: keeps max for Mk->E as we go */
73 register float32x4_t xBv; /* B state: splatted vector of B[i-1] for B->Mk calculations */
74 register float32x4_t Dmaxv; /* keeps track of maximum D cell on row */
75 float32x4_t infv; /* -eslINFINITY in a vector */
76 float xN, xE, xB, xC, xJ; /* special states' scores */
77 float Dmax; /* maximum D cell on row */
78 int i; /* counter over sequence positions 1..L */
79 int q; /* counter over vectors 0..nq-1 */
80 int Q = p7O_NQF(om->M); /* segment length: # of vectors */
81 float32x4_t *dp = ox->dpf[0]; /* using {MDI}MX(q) macro requires initialization of <dp> */
82 float32x4_t *rsc; /* will point at om->rf[x] for residue x[i] */
83 float32x4_t *tsc; /* will point into (and step thru) om->tf */
84
85 /* Check that the DP matrix is ok for us. */
86 if (Q > ox->allocQ4) ESL_EXCEPTION(eslEINVAL, "DP matrix allocated too small");
87 ox->M = om->M;
88
89 /* Initialization. */
90 infv = vmovq_n_f32(-eslINFINITY);
91 for (q = 0; q < Q; q++)
92 MMXo(q) = IMXo(q) = DMXo(q) = infv;
93 xN = 0.;
94 xB = om->xf[p7O_N][p7O_MOVE];
95 xE = -eslINFINITY;
96 xJ = -eslINFINITY;
97 xC = -eslINFINITY;
98
99 #if eslDEBUGLEVEL > 0
100 if (ox->debugging) p7_omx_DumpFloatRow(ox, FALSE, 0, 5, 2, xE, xN, xJ, xB, xC); /* logify=FALSE, <rowi>=0, width=5, precision=2*/
101 #endif
102
103 for (i = 1; i <= L; i++)
104 {
105 rsc = om->rf[dsq[i]];
106 tsc = om->tf;
107 dcv = infv;
108 xEv = infv;
109 Dmaxv = infv;
110 xBv = vmovq_n_f32(xB);
111
112 mpv = esl_neon_rightshift_float(MMXo(Q-1), infv); /* Right shifts by 4 bytes. 4,8,12,x becomes x,4,8,12. */
113 dpv = esl_neon_rightshift_float(DMXo(Q-1), infv);
114 ipv = esl_neon_rightshift_float(IMXo(Q-1), infv);
115 for (q = 0; q < Q; q++)
116 {
117 /* Calculate new MMXo(i,q); don't store it yet, hold it in sv. */
118 sv = vaddq_f32(xBv, *tsc); tsc++;
119 sv = vmaxq_f32(sv, vaddq_f32(mpv, *tsc)); tsc++;
120 sv = vmaxq_f32(sv, vaddq_f32(ipv, *tsc)); tsc++;
121 sv = vmaxq_f32(sv, vaddq_f32(dpv, *tsc)); tsc++;
122 sv = vaddq_f32(sv, *rsc); rsc++;
123 xEv = vmaxq_f32(xEv, sv);
124
125 /* Load {MDI}(i-1,q) into mpv, dpv, ipv;
126 * {MDI}MX(q) is then the current, not the prev row
127 */
128 mpv = MMXo(q);
129 dpv = DMXo(q);
130 ipv = IMXo(q);
131
132 /* Do the delayed stores of {MD}(i,q) now that memory is usable */
133 MMXo(q) = sv;
134 DMXo(q) = dcv;
135
136 /* Calculate the next D(i,q+1) partially: M->D only;
137 * delay storage, holding it in dcv
138 */
139 dcv = vaddq_f32(sv, *tsc); tsc++;
140 Dmaxv = vmaxq_f32(dcv, Dmaxv);
141
142 /* Calculate and store I(i,q) */
143 sv = vaddq_f32(mpv, *tsc); tsc++;
144 sv = vmaxq_f32(sv, vaddq_f32(ipv, *tsc)); tsc++;
145 IMXo(q) = vaddq_f32(sv, *rsc); rsc++;
146 }
147
148 /* Now the "special" states, which start from Mk->E (->C, ->J->B) */
149 esl_neon_hmax_f32(xEv, &xE);
150 xN = xN + om->xf[p7O_N][p7O_LOOP];
151 xC = ESL_MAX(xC + om->xf[p7O_C][p7O_LOOP], xE + om->xf[p7O_E][p7O_MOVE]);
152 xJ = ESL_MAX(xJ + om->xf[p7O_J][p7O_LOOP], xE + om->xf[p7O_E][p7O_LOOP]);
153 xB = ESL_MAX(xJ + om->xf[p7O_J][p7O_MOVE], xN + om->xf[p7O_N][p7O_MOVE]);
154 /* and now xB will carry over into next i, and xC carries over after i=L */
155
156 /* Finally the "lazy F" loop (sensu [Farrar07]). We can often
157 * prove that we don't need to evaluate any D->D paths at all.
158 *
159 * The observation is that if we can show that on the next row,
160 * B->M(i+1,k) paths always dominate M->D->...->D->M(i+1,k) paths
161 * for all k, then we don't need any D->D calculations.
162 *
163 * The test condition is:
164 * max_k D(i,k) + max_k ( TDD(k-2) + TDM(k-1) - TBM(k) ) < xB(i)
165 * So:
166 * max_k (TDD(k-2) + TDM(k-1) - TBM(k)) is precalc'ed in om->dd_bound;
167 * max_k D(i,k) is why we tracked Dmaxv;
168 * xB(i) was just calculated above.
169 */
170 esl_neon_hmax_f32(Dmaxv, &Dmax);
171 if (Dmax + om->ddbound_f > xB)
172 {
173 /* Now we're obligated to do at least one complete DD path to be sure. */
174 /* dcv has carried through from end of q loop above */
175 dcv = esl_neon_rightshift_float(dcv, infv);
176 tsc = om->tf + 7*Q; /* set tsc to start of the DD's */
177 for (q = 0; q < Q; q++)
178 {
179 DMXo(q) = vmaxq_f32(dcv, DMXo(q));
180 dcv = vaddq_f32(DMXo(q), *tsc); tsc++;
181 }
182
183 /* We may have to do up to three more passes; the check
184 * is for whether crossing a segment boundary can improve
185 * our score.
186 */
187 do {
188 dcv = esl_neon_rightshift_float(dcv, infv);
189 tsc = om->tf + 7*Q; /* set tsc to start of the DD's */
190 for (q = 0; q < Q; q++)
191 {
192 if (! esl_neon_any_gt_s16(dcv, DMXo(q))) break;
193 DMXo(q) = vmaxq_f32(dcv, DMXo(q));
194 dcv = vaddq_f32(DMXo(q), *tsc); tsc++;
195 }
196 } while (q == Q);
197 }
198 else
199 { /* not calculating DD? then just store that last MD vector we calc'ed. */
200 dcv = esl_neon_rightshift_float(dcv, infv);
201 DMXo(0) = dcv;
202 }
203
204 #if eslDEBUGLEVEL > 0
205 if (ox->debugging) p7_omx_DumpFloatRow(ox, FALSE, i, 5, 2, xE, xN, xJ, xB, xC); /* logify=FALSE, <rowi>=i, width=5, precision=2*/
206 #endif
207 } /* end loop over sequence residues 1..L */
208
209 /* finally C->T */
210 *ret_sc = xC + om->xf[p7O_C][p7O_MOVE];
211 return eslOK;
212 }
213 /*------------------ end, p7_ViterbiScore() ---------------------*/
214
215
216
217 /*****************************************************************
218 * 2. Benchmark driver.
219 *****************************************************************/
220 #ifdef p7VITSCORE_BENCHMARK
221 /* -c, -x are used for debugging, testing. See msvfilter.c for
222 * an explanation. Here -c and -x are the same: both compare
223 * to p7_GViterbi() scores.
224 */
225 /*
226 ./benchmark-vitscore <hmmfile> runs benchmark
227 ./benchmark-vitscore -N100 -c <hmmfile> compare scores to generic impl
228 ./benchmark-vitscore -N100 -x <hmmfile> equate scores to exact emulation
229 */
230 #include <p7_config.h>
231
232 #include "easel.h"
233 #include "esl_alphabet.h"
234 #include "esl_getopts.h"
235 #include "esl_random.h"
236 #include "esl_randomseq.h"
237 #include "esl_stopwatch.h"
238
239 #include "hmmer.h"
240 #include "impl_neon.h"
241
242 static ESL_OPTIONS options[] = {
243 /* name type default env range toggles reqs incomp help docgroup*/
244 { "-h", eslARG_NONE, FALSE, NULL, NULL, NULL, NULL, NULL, "show brief help on version and usage", 0 },
245 { "-c", eslARG_NONE, FALSE, NULL, NULL, NULL, NULL, "-x", "compare scores to generic implementation (debug)", 0 },
246 { "-s", eslARG_INT, "42", NULL, NULL, NULL, NULL, NULL, "set random number seed to <n>", 0 },
247 { "-x", eslARG_NONE, FALSE, NULL, NULL, NULL, NULL, "-c", "equate scores to trusted implementation (debug)", 0 },
248 { "-L", eslARG_INT, "400", NULL, "n>0", NULL, NULL, NULL, "length of random target seqs", 0 },
249 { "-N", eslARG_INT, "50000", NULL, "n>0", NULL, NULL, NULL, "number of random target seqs", 0 },
250 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
251 };
252 static char usage[] = "[-options] <hmmfile>";
253 static char banner[] = "benchmark driver for NEON ViterbiScore()";
254
255 int
256 main(int argc, char **argv)
257 {
258 ESL_GETOPTS *go = p7_CreateDefaultApp(options, 1, argc, argv, banner, usage);
259 char *hmmfile = esl_opt_GetArg(go, 1);
260 ESL_STOPWATCH *w = esl_stopwatch_Create();
261 ESL_RANDOMNESS *r = esl_randomness_CreateFast(esl_opt_GetInteger(go, "-s"));
262 ESL_ALPHABET *abc = NULL;
263 P7_HMMFILE *hfp = NULL;
264 P7_HMM *hmm = NULL;
265 P7_BG *bg = NULL;
266 P7_PROFILE *gm = NULL;
267 P7_OPROFILE *om = NULL;
268 P7_OMX *ox = NULL;
269 P7_GMX *gx = NULL;
270 int L = esl_opt_GetInteger(go, "-L");
271 int N = esl_opt_GetInteger(go, "-N");
272 ESL_DSQ *dsq = malloc(sizeof(ESL_DSQ) * (L+2));
273 int i;
274 float sc1, sc2;
275 double base_time, bench_time, Mcs;
276
277 if (p7_hmmfile_Open(hmmfile, NULL, &hfp, NULL) != eslOK) p7_Fail("Failed to open HMM file %s", hmmfile);
278 if (p7_hmmfile_Read(hfp, &abc, &hmm) != eslOK) p7_Fail("Failed to read HMM");
279
280 bg = p7_bg_Create(abc);
281 p7_bg_SetLength(bg, L);
282 gm = p7_profile_Create(hmm->M, abc);
283 p7_ProfileConfig(hmm, bg, gm, L, p7_LOCAL);
284 om = p7_oprofile_Create(gm->M, abc);
285 p7_oprofile_Convert(gm, om);
286 p7_oprofile_ReconfigLength(om, L);
287 p7_oprofile_Logify(om);
288
289 ox = p7_omx_Create(gm->M, 0, 0);
290 gx = p7_gmx_Create(gm->M, L);
291
292 /* Get a baseline time: how long it takes just to generate the sequences */
293 esl_stopwatch_Start(w);
294 for (i = 0; i < N; i++)
295 esl_rsq_xfIID(r, bg->f, abc->K, L, dsq);
296 esl_stopwatch_Stop(w);
297 base_time = w->user;
298
299 /* Run the benchmark */
300 esl_stopwatch_Start(w);
301 for (i = 0; i < N; i++)
302 {
303 esl_rsq_xfIID(r, bg->f, abc->K, L, dsq);
304 p7_ViterbiScore (dsq, L, om, ox, &sc1);
305
306 if (esl_opt_GetBoolean(go, "-c") || esl_opt_GetBoolean(go, "-x"))
307 {
308 p7_GViterbi(dsq, L, gm, gx, &sc2);
309 printf("%.4f %.4f\n", sc1, sc2);
310 }
311 }
312 esl_stopwatch_Stop(w);
313 bench_time = w->user - base_time;
314 Mcs = (double) N * (double) L * (double) gm->M * 1e-6 / (double) bench_time;
315 esl_stopwatch_Display(stdout, w, "# CPU time: ");
316 printf("# M = %d\n", gm->M);
317 printf("# %.1f Mc/s\n", Mcs);
318
319 free(dsq);
320 p7_omx_Destroy(ox);
321 p7_gmx_Destroy(gx);
322 p7_oprofile_Destroy(om);
323 p7_profile_Destroy(gm);
324 p7_bg_Destroy(bg);
325 p7_hmm_Destroy(hmm);
326 p7_hmmfile_Close(hfp);
327 esl_alphabet_Destroy(abc);
328 esl_stopwatch_Destroy(w);
329 esl_randomness_Destroy(r);
330 esl_getopts_Destroy(go);
331 return 0;
332 }
333 #endif /*p7VITSCORE_BENCHMARK*/
334 /*------------------- end, benchmark driver ---------------------*/
335
336
337
338 /*****************************************************************
339 * 3. Unit tests.
340 *****************************************************************/
341 #ifdef p7VITSCORE_TESTDRIVE
342 #include "esl_random.h"
343 #include "esl_randomseq.h"
344
345 /* ViterbiScore() unit test
346 *
347 * We can compare these scores to GViterbi() almost exactly; the only
348 * differences should be negligible roundoff errors. Must convert
349 * the optimized profile to lspace, though, rather than pspace.
350 */
351 static void
352 utest_viterbi_score(ESL_RANDOMNESS *r, ESL_ALPHABET *abc, P7_BG *bg, int M, int L, int N)
353 {
354 P7_HMM *hmm = NULL;
355 P7_PROFILE *gm = NULL;
356 P7_OPROFILE *om = NULL;
357 ESL_DSQ *dsq = malloc(sizeof(ESL_DSQ) * (L+2));
358 P7_OMX *ox = p7_omx_Create(M, 0, 0);
359 P7_GMX *gx = p7_gmx_Create(M, L);
360 float sc1, sc2;
361
362 p7_oprofile_Sample(r, abc, bg, M, L, &hmm, &gm, &om);
363 p7_oprofile_Logify(om);
364 while (N--)
365 {
366 esl_rsq_xfIID(r, bg->f, abc->K, L, dsq);
367
368 p7_ViterbiScore(dsq, L, om, ox, &sc1);
369 p7_GViterbi (dsq, L, gm, gx, &sc2);
370
371 if (fabs(sc1-sc2) > 0.001) esl_fatal("viterbi score unit test failed: scores differ");
372 }
373
374 free(dsq);
375 p7_hmm_Destroy(hmm);
376 p7_omx_Destroy(ox);
377 p7_gmx_Destroy(gx);
378 p7_profile_Destroy(gm);
379 p7_oprofile_Destroy(om);
380 }
381 #endif /*p7VITSCORE_TESTDRIVE*/
382 /*-------------------- end, unit tests --------------------------*/
383
384 /*****************************************************************
385 * 4. Test driver
386 *****************************************************************/
387 #ifdef p7VITSCORE_TESTDRIVE
388
389 #include <p7_config.h>
390
391 #include "easel.h"
392 #include "esl_alphabet.h"
393 #include "esl_getopts.h"
394
395 #include "hmmer.h"
396 #include "impl_neon.h"
397
398 static ESL_OPTIONS options[] = {
399 /* name type default env range toggles reqs incomp help docgroup*/
400 { "-h", eslARG_NONE, FALSE, NULL, NULL, NULL, NULL, NULL, "show brief help on version and usage", 0 },
401 { "-s", eslARG_INT, "42", NULL, NULL, NULL, NULL, NULL, "set random number seed to <n>", 0 },
402 { "-L", eslARG_INT, "200", NULL, NULL, NULL, NULL, NULL, "size of random sequences to sample", 0 },
403 { "-M", eslARG_INT, "145", NULL, NULL, NULL, NULL, NULL, "size of random models to sample", 0 },
404 { "-N", eslARG_INT, "100", NULL, NULL, NULL, NULL, NULL, "number of random sequences to sample", 0 },
405 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
406 };
407 static char usage[] = "[-options]";
408 static char banner[] = "test driver for the NEON implementation";
409
410 int
411 main(int argc, char **argv)
412 {
413 ESL_GETOPTS *go = p7_CreateDefaultApp(options, 0, argc, argv, banner, usage);
414 ESL_RANDOMNESS *r = esl_randomness_CreateFast(esl_opt_GetInteger(go, "-s"));
415 ESL_ALPHABET *abc = NULL;
416 P7_BG *bg = NULL;
417 int M = esl_opt_GetInteger(go, "-M");
418 int L = esl_opt_GetInteger(go, "-L");
419 int N = esl_opt_GetInteger(go, "-N");
420
421 /* First round of tests for DNA alphabets. */
422 if ((abc = esl_alphabet_Create(eslDNA)) == NULL) esl_fatal("failed to create alphabet");
423 if ((bg = p7_bg_Create(abc)) == NULL) esl_fatal("failed to create null model");
424
425 utest_viterbi_score(r, abc, bg, M, L, N);
426 utest_viterbi_score(r, abc, bg, 1, L, 10);
427 utest_viterbi_score(r, abc, bg, M, 1, 10);
428
429 esl_alphabet_Destroy(abc);
430 p7_bg_Destroy(bg);
431
432 /* Second round of tests for amino alphabets. */
433 if ((abc = esl_alphabet_Create(eslAMINO)) == NULL) esl_fatal("failed to create alphabet");
434 if ((bg = p7_bg_Create(abc)) == NULL) esl_fatal("failed to create null model");
435
436 utest_viterbi_score(r, abc, bg, M, L, N);
437 utest_viterbi_score(r, abc, bg, 1, L, 10);
438 utest_viterbi_score(r, abc, bg, M, 1, 10);
439
440 esl_alphabet_Destroy(abc);
441 p7_bg_Destroy(bg);
442
443 esl_getopts_Destroy(go);
444 esl_randomness_Destroy(r);
445 return eslOK;
446 }
447 #endif /*VITSCORE_TESTDRIVE*/
448 /*--------------------- end, test driver ------------------------*/
449
450
451 /*****************************************************************
452 * 5. Example
453 *****************************************************************/
454 #ifdef p7VITSCORE_EXAMPLE
455 /* A minimal example.
456 Also useful for debugging on small HMMs and sequences.
457
458
459 ./example <hmmfile> <seqfile>
460 */
461 #include <p7_config.h>
462
463 #include "easel.h"
464 #include "esl_alphabet.h"
465 #include "esl_sq.h"
466 #include "esl_sqio.h"
467
468 #include "hmmer.h"
469 #include "impl_neon.h"
470
471 int
472 main(int argc, char **argv)
473 {
474 char *hmmfile = argv[1];
475 char *seqfile = argv[2];
476 ESL_ALPHABET *abc = NULL;
477 P7_HMMFILE *hfp = NULL;
478 P7_HMM *hmm = NULL;
479 P7_BG *bg = NULL;
480 P7_PROFILE *gm = NULL;
481 P7_OPROFILE *om = NULL;
482 P7_OMX *ox = NULL;
483 P7_GMX *gx = NULL;
484 ESL_SQ *sq = NULL;
485 ESL_SQFILE *sqfp = NULL;
486 int format = eslSQFILE_UNKNOWN;
487 float sc;
488 int status;
489
490 /* Read in one HMM */
491 if (p7_hmmfile_Open(hmmfile, NULL, &hfp, NULL) != eslOK) p7_Fail("Failed to open HMM file %s", hmmfile);
492 if (p7_hmmfile_Read(hfp, &abc, &hmm) != eslOK) p7_Fail("Failed to read HMM");
493
494 /* Read in one sequence */
495 sq = esl_sq_CreateDigital(abc);
496 status = esl_sqfile_Open(seqfile, format, NULL, &sqfp);
497 if (status == eslENOTFOUND) p7_Fail("No such file.");
498 else if (status == eslEFORMAT) p7_Fail("Format unrecognized.");
499 else if (status == eslEINVAL) p7_Fail("Can't autodetect stdin or .gz.");
500 else if (status != eslOK) p7_Fail("Open failed, code %d.", status);
501 if (esl_sqio_Read(sqfp, sq) != eslOK) p7_Fail("Failed to read sequence");
502
503 /* create default null model, then create and optimize profile */
504 bg = p7_bg_Create(abc);
505 p7_bg_SetLength(bg, sq->n);
506 gm = p7_profile_Create(hmm->M, abc);
507 p7_ProfileConfig(hmm, bg, gm, sq->n, p7_LOCAL);
508 om = p7_oprofile_Create(gm->M, abc);
509 p7_oprofile_Convert(gm, om);
510 p7_oprofile_Logify(om);
511
512 /* allocate DP matrices, both a generic and an optimized one */
513 ox = p7_omx_Create(gm->M, 0, sq->n);
514 gx = p7_gmx_Create(gm->M, sq->n);
515
516 /* Useful to place and compile in for debugging:
517 p7_oprofile_Dump(stdout, om); dumps the optimized profile
518 p7_omx_SetDumpMode(ox, TRUE); makes the fast DP algorithms dump their matrices
519 p7_gmx_Dump(stdout, gx, p7_DEFAULT); dumps a generic DP matrix
520 */
521
522 p7_ViterbiScore(sq->dsq, sq->n, om, ox, &sc); printf("viterbi score (NEON): %.2f nats\n", sc);
523 p7_GViterbi (sq->dsq, sq->n, gm, gx, &sc); printf("viterbi (generic): %.2f nats\n", sc);
524
525 /* now in a real app, you'd need to convert raw nat scores to final bit
526 * scores, by subtracting the null model score and rescaling.
527 */
528
529 /* cleanup */
530 esl_sq_Destroy(sq);
531 esl_sqfile_Close(sqfp);
532 p7_omx_Destroy(ox);
533 p7_gmx_Destroy(gx);
534 p7_oprofile_Destroy(om);
535 p7_profile_Destroy(gm);
536 p7_bg_Destroy(bg);
537 p7_hmm_Destroy(hmm);
538 p7_hmmfile_Close(hfp);
539 esl_alphabet_Destroy(abc);
540 return 0;
541 }
542 #endif /*p7VITSCORE_EXAMPLE*/
543 /*-------------------------- end, example ------------------------------*/