Add lazy bathalign, and --nofs to skip frameshift calibration - #15
Open
kevinmoran1988 wants to merge 1 commit into
Open
kevinmoran1988 wants to merge 1 commit into
kevinmoran1988 wants to merge 1 commit into
Conversation
BATH dropped HMMER's hmmalign driver but kept the whole tracealign engine (tracealign.c, p7_tracealign_*) compiled into libhmmer.a. bathalign is a 288-line driver over that existing engine -- no new alignment code. Alphabet-generic, as the engine is; BATH3/f is a superset of HMMER3/f, so it reads both .bhmm and .hmm. Amino output is byte-identical to HMMER 3.4 hmmalign across --mapali, --outformat, --trim, and Stockholm and afa output, for models from bathbuild and hmmbuild alike. Note that bathbuild itself is amino-only, so non-amino models must come from hmmbuild. c2ba68e made frameshift tau calculation unconditional and dropped --fs, but left the gating in place: evalues.c still guards FS3/FS5 on cfg_b->fs and p7_hmmfile.c still guards the header lines on hmm->fs. --nofs re-exposes that switch against the new default. Alignment never reads the frameshift stats, so for a model built to be aligned against, the calibration is pure waste -- and it is more than half of bathbuild's runtime. Where the model exists only for alignment, building it dominates the cost of aligning. 400 dipteraODB12 alignments, serial, 3 runs each, in seconds: full 43.83 / 43.32 / 43.38 nofs 15.26 / 15.50 / 15.57 A --nofs model is byte-identical to a full one apart from the omitted FS3/FS5 STATS and FRAMESHIFT PROB lines, and gives identical bathsearch results when --fs/--fsonly are not used. When they are, bathsearch fails cleanly on the unset stats rather than mis-scoring.
kevinmoran1988
force-pushed
the
bathalign
branch
from
September 5, 2026 17:07
3a7deac to
32e4df4
Compare
Author
|
As a further note, the MSV/Viterbi/Forward fits in p7_Calibrate() are dead weight for the same align-only case, and cost about as much again: over 400 dipteraODB12 alignments, --nofs is 15.4s and skipping the standard fits drops bathbuild runtime to 10.4s (1.5x) with bathalign producing identical alignments over the 400 tested dipteraODB12 genes. I did NOT implement this here because it is a separate and riskier change. -- p7_Calibrate() has to leave evparam unset and p7H_STATS clear, and nothing currently checks p7H_STATS, so bathsearch would score against p7_EVPARAM_UNSET instead of failing. Edit: The force push was just changing the commit description to match the edited conversation in the initial post. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BATH dropped HMMER's hmmalign driver but kept the whole tracealign engine (tracealign.c, p7_tracealign_*) compiled into libhmmer.a. bathalign is a 288-line driver over that existing engine -- no new alignment code. Alphabet-generic, as the engine is; BATH3/f is a superset of HMMER3/f, so it reads both .bhmm and .hmm. Amino output is byte-identical to HMMER 3.4 hmmalign across --mapali, --outformat, --trim, and Stockholm and afa output, for models from bathbuild and hmmbuild alike. Note that bathbuild itself is amino-only, so non-amino models must come from hmmbuild.
c2ba68e made frameshift tau calculation unconditional and dropped --fs, but left the gating in place: evalues.c still guards FS3/FS5 on cfg_b->fs and p7_hmmfile.c still guards the header lines on hmm->fs. --nofs re-exposes that switch against the new default.
Alignment never reads the frameshift stats, so for a model built to be aligned against, the calibration is pure waste -- and it is more than half of bathbuild's runtime. Where the model exists only for alignment, building it dominates the cost of aligning.
400 dipteraODB12 alignments, serial, 3 runs each, in seconds:
full 43.83 / 43.32 / 43.38
nofs 15.26 / 15.50 / 15.57
A --nofs model is byte-identical to a full one apart from the omitted FS3/FS5 STATS and FRAMESHIFT PROB lines, and gives identical bathsearch results when --fs/--fsonly are not used. When they are, bathsearch fails cleanly on the unset stats rather than mis-scoring.