Skip to content

Commit 8d09bd9

Browse files
author
Genevieve Krause
committed
Merge branch 'develop' into main
2 parents 4525781 + 8ddd7d3 commit 8d09bd9

File tree

3 files changed

+29
-23
lines changed

3 files changed

+29
-23
lines changed

src/bathsearch.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ static ESL_OPTIONS options[] = {
105105
{ "--tformat", eslARG_STRING, NULL, NULL, NULL, NULL, NULL, NULL, "assert target <seqfile> is in format <s>: no autodetection", 5 },
106106

107107
/* Control of acceleration pipeline */
108-
{ "--max", eslARG_NONE, FALSE, NULL, NULL, NULL, NULL,"--F1,--F2,--F3","turn all heuristic filters off (less speed, more power)", 7 },
108+
{ "--max", eslARG_NONE, FALSE, NULL, NULL, NULL, NULL,"--F1,--F2,--F3,--F4","turn all heuristic filters off (less speed, more power)", 7 },
109109
{ "--F1", eslARG_REAL, "0.02", NULL, NULL, NULL, NULL,"--max", "stage 1 (MSV) threshold: promote hits w/ P <= F1", 7 },
110110
{ "--F2", eslARG_REAL, "1e-3", NULL, NULL, NULL, NULL,"--max", "stage 2 (Vit) threshold: promote hits w/ P <= F2", 7 },
111111
{ "--F3", eslARG_REAL, "1e-5", NULL, NULL, NULL, NULL,"--max", "stage 3 (Fwd) threshold: promote hits w/ P <= F3", 7 },
112+
{ "--F4", eslARG_REAL, "5e-4", NULL, NULL, NULL, NULL,"--max", "stage 4 (FS-Fwd) threshold: promote hits w/ P <= F4", 7 },
112113
{ "--nobias", eslARG_NONE, NULL, NULL, NULL, NULL, NULL,"--max", "turn off composition bias filter", 7 },
113114
{ "--nonull2", eslARG_NONE, NULL, NULL, NULL, NULL, NULL, NULL, "turn off biased composition score corrections", 7 },
114115
{ "--fsonly", eslARG_NONE, FALSE, NULL, NULL, NULL, NULL,"--nofs", "send all potential hits to the frameshift aware pipeline", 7 },
@@ -283,6 +284,7 @@ output_header(FILE *ofp, const ESL_GETOPTS *go, char *hmmfile, char *seqfile)
283284
if (esl_opt_IsUsed(go, "--F1") && fprintf(ofp, "# MSV filter P threshold: <= %g\n", esl_opt_GetReal(go, "--F1")) < 0) ESL_EXCEPTION_SYS(eslEWRITE, "write failed");
284285
if (esl_opt_IsUsed(go, "--F2") && fprintf(ofp, "# Vit filter P threshold: <= %g\n", esl_opt_GetReal(go, "--F2")) < 0) ESL_EXCEPTION_SYS(eslEWRITE, "write failed");
285286
if (esl_opt_IsUsed(go, "--F3") && fprintf(ofp, "# Fwd filter P threshold: <= %g\n", esl_opt_GetReal(go, "--F3")) < 0) ESL_EXCEPTION_SYS(eslEWRITE, "write failed");
287+
if (esl_opt_IsUsed(go, "--F4") && fprintf(ofp, "# ORF Fwd filter P threshold: <= %g\n", esl_opt_GetReal(go, "--F4")) < 0) ESL_EXCEPTION_SYS(eslEWRITE, "write failed");
286288
if (esl_opt_IsUsed(go, "--nobias") && fprintf(ofp, "# biased composition HMM filter: off\n") < 0) ESL_EXCEPTION_SYS(eslEWRITE, "write failed");
287289
if (esl_opt_IsUsed(go, "--nonull2") && fprintf(ofp, "# null2 bias corrections: off\n") < 0) ESL_EXCEPTION_SYS(eslEWRITE, "write failed");
288290
if (esl_opt_IsUsed(go, "--fsonly") && fprintf(ofp, "# Use only the frameshift aware pipeline\n") < 0) ESL_EXCEPTION_SYS(eslEWRITE, "write failed");

src/hmmer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,7 @@ typedef struct p7_pipeline_s {
13871387
double F1; /* MSV filter threshold */
13881388
double F2; /* Viterbi filter threshold */
13891389
double F3; /* uncorrected Forward filter threshold */
1390+
double F4; /* uncorrected FS Forward filter threshold */
13901391
int B1; /* window length for biased-composition modifier - MSV*/
13911392
int B2; /* window length for biased-composition modifier - Viterbi*/
13921393
int B3; /* window length for biased-composition modifier - Forward*/

src/p7_pipeline.c

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ p7_pipeline_Create(const ESL_GETOPTS *go, int M_hint, int L_hint, int long_targe
308308
* | --max | turn all heuristic filters off | FALSE |
309309
* | --F1 | Stage 1 (MSV) thresh: promote hits P <= F1 | 0.02 |
310310
* | --F2 | Stage 2 (Vit) thresh: promote hits P <= F2 | 1e-3 |
311-
* | --F3 | Stage 2 (Fwd) thresh: promote hits P <= F3 | 1e-5 |
311+
* | --F3 | Stage 3 (Fwd) thresh: promote hits P <= F3 | 1e-5 |
312+
* | --F4 | Stage 3 (FS-Fwd) thresh: promote hits P <= F4 | 5e-4 |
312313
* | --nobias | turn OFF composition bias filter HMM | FALSE |
313314
* | --nonull2 | turn OFF biased comp score correction | FALSE |
314315
* | --seed | RNG seed (0=use arbitrary seed) | 42 |
@@ -426,6 +427,7 @@ p7_pipeline_fs_Create(ESL_GETOPTS *go, int M_hint, int L_hint, enum p7_pipemodes
426427
pli->F1 = ((go && esl_opt_IsOn(go, "--F1")) ? ESL_MIN(1.0, esl_opt_GetReal(go, "--F1")) : 0.02);
427428
pli->F2 = (go ? ESL_MIN(1.0, esl_opt_GetReal(go, "--F2")) : 1e-3);
428429
pli->F3 = (go ? ESL_MIN(1.0, esl_opt_GetReal(go, "--F3")) : 1e-5);
430+
pli->F4 = (go ? ESL_MIN(1.0, esl_opt_GetReal(go, "--F4")) : 5e-4);
429431
pli->B1 = (go ? esl_opt_GetInteger(go, "--B1") : 100);
430432
pli->B2 = (go ? esl_opt_GetInteger(go, "--B2") : 240);
431433
pli->B3 = (go ? esl_opt_GetInteger(go, "--B3") : 1000);
@@ -435,7 +437,7 @@ p7_pipeline_fs_Create(ESL_GETOPTS *go, int M_hint, int L_hint, enum p7_pipemodes
435437
pli->do_max = TRUE;
436438
pli->do_biasfilter = FALSE;
437439

438-
pli->F2 = pli->F3 = 1.0;
440+
pli->F2 = pli->F3 = pli->F4 = .0;
439441
pli->F1 = 1.0; // need to set some threshold for F1 even on long targets. Should this be tighter?
440442
}
441443
if (go && esl_opt_GetBoolean(go, "--nonull2")) pli->do_null2 = FALSE;
@@ -2606,25 +2608,6 @@ p7_pli_postViterbi_BATH(P7_PIPELINE *pli, P7_OPROFILE *om, P7_PROFILE *gm, P7_FS
26062608
pli_tmp->tmpseq->end = dna_window->n + dna_window->length - 1;
26072609
pli_tmp->tmpseq->dsq = subseq;
26082610

2609-
P_fs = eslINFINITY;
2610-
P_fs_nobias = eslINFINITY;
2611-
2612-
/*If this search is using the frameshift aware pipeline
2613-
* (user did not specify --nofs) than run Frameshift
2614-
* Forward on full Window and save score and P value.*/
2615-
if(pli->fs_pipe) {
2616-
p7_bg_fs_FilterScore(bg, pli_tmp->tmpseq, wrk, gcode, pli->do_biasfilter, &filtersc_fs);
2617-
2618-
p7_gmx_fs_GrowTo(pli->gxf, gm_fs->M, 4, dna_window->length, 0);
2619-
p7_fs_ReconfigLength(gm_fs, dna_window->length);
2620-
2621-
p7_ForwardParser_Frameshift(subseq, gcode, dna_window->length, gm_fs, pli->gxf, &fwdsc_fs);
2622-
2623-
seqscore_fs = (fwdsc_fs-filtersc_fs) / eslCONST_LOG2;
2624-
P_fs = esl_exp_surv(seqscore_fs, gm_fs->evparam[p7_FTAUFS], gm_fs->evparam[p7_FLAMBDA]);
2625-
P_fs_nobias = esl_exp_surv(fwdsc_fs/eslCONST_LOG2, gm_fs->evparam[p7_FTAUFS], gm_fs->evparam[p7_FLAMBDA]);
2626-
}
2627-
26282611
tot_orf_sc = eslINFINITY;
26292612
tot_orf_P = eslINFINITY;
26302613
min_P_orf = eslINFINITY;
@@ -2694,7 +2677,27 @@ p7_pli_postViterbi_BATH(P7_PIPELINE *pli, P7_OPROFILE *om, P7_PROFILE *gm, P7_FS
26942677
tot_orf_P = esl_exp_surv(tot_orf_sc / eslCONST_LOG2, om->evparam[p7_FTAU], om->evparam[p7_FLAMBDA]);
26952678
}
26962679

2697-
/* Compare Pvalues to select either the standard or the frameshift pipeline
2680+
2681+
P_fs = eslINFINITY;
2682+
P_fs_nobias = eslINFINITY;
2683+
2684+
/*If this search is using the frameshift aware pipeline
2685+
* (user did not specify --nofs) than run Frameshift
2686+
* Forward on full Window and save score and P value.*/
2687+
if(pli->fs_pipe && (!pli->std_pipe || min_P_orf <= pli->F4)) {
2688+
p7_bg_fs_FilterScore(bg, pli_tmp->tmpseq, wrk, gcode, pli->do_biasfilter, &filtersc_fs);
2689+
2690+
p7_gmx_fs_GrowTo(pli->gxf, gm_fs->M, 4, dna_window->length, 0);
2691+
p7_fs_ReconfigLength(gm_fs, dna_window->length);
2692+
2693+
p7_ForwardParser_Frameshift(subseq, gcode, dna_window->length, gm_fs, pli->gxf, &fwdsc_fs);
2694+
2695+
seqscore_fs = (fwdsc_fs-filtersc_fs) / eslCONST_LOG2;
2696+
P_fs = esl_exp_surv(seqscore_fs, gm_fs->evparam[p7_FTAUFS], gm_fs->evparam[p7_FLAMBDA]);
2697+
P_fs_nobias = esl_exp_surv(fwdsc_fs/eslCONST_LOG2, gm_fs->evparam[p7_FTAUFS], gm_fs->evparam[p7_FLAMBDA]);
2698+
}
2699+
2700+
/* Compare Pvalues to select either the standard or the frameshift pipeline
26982701
* If the DNA window passed frameshift forward AND produced a lower P-value
26992702
* than the sumed Forward score of the orfs used to costruct that window
27002703
* then we proceed with the frameshift pipeline

0 commit comments

Comments
 (0)