Repository navigation
2.5.102
HyPhy Version Update: 2.5.102
⚠️ Superseded by 2.5.103: this tag was cut before its version-string bump, so 2.5.102 binaries self-report as 2.5.101 (#2030). Use 2.5.103 instead — functionally identical, correct version string.
This release introduces critical stability enhancements, algorithmic singularity guards, and consistency fixes across model selection (GARD), phenotype-associated selection testing (BUSTED-PH), clade support analysis, and distributed cluster optimization.
1. GARD & Model Selection Robustness
Small-Sample $\text{AIC}_c$ Penalty Singularity Guard
-
Negative Penalty Prevention: In
libv3/convenience/math.bf, small-sample AIC ($\text{AIC}_c$ ) previously allowed the penalty denominator$(N - k - 1)$ to become non-positive when parameter count exceeded sample length ($k \ge N - 1$ ). For over-parameterized models fitted to short or low-divergence alignments, this resulted in massive negative penalties (e.g.,$\Delta \text{AIC}_c \approx -33,500$ ), erroneously declaring spurious breakpoints. -
Infinite Penalty Enforcement:
math.GetICnow explicitly returnsmath.Infinitywhenever$N \le k + 1$ , strictly penalizing over-parameterized models and avoiding false-positive breakpoint inference (#2025, PR #2027).
Pre-flight Parameter Accounting & Rate-Variation Degrees of Freedom
-
Branch Count Correction: Corrected unrooted tree branch parameter accounting in
GARD.bffrom$(2S - 5)$ to$(2S - 3)$ per partition. - Rate Variation Accounting: Included degrees of freedom for site-to-site rate variation (General Discrete Distribution and Gamma rate classes) in the pre-flight check. Datasets too short to support a 2-partition model now halt immediately with an informative assertion message rather than proceeding into optimization singularities (#2025, PR #2027).
Multi-Breakpoint GA Feasibility Guard
- Dynamic Bound Enforcement: In
GARD.bf, added explicit feasibility guards(B + 2) * minPartitionSize <= numSitesand verified single-breakpoint improvement before launching the multi-breakpoint genetic algorithm. This prevents infinite model generation loops on short or boundary-constrained alignments (#2025, PR #2027).
Coordinate Calculation & Boundary Export
- NEXUS & JSON Coordinate Fixes: Fixed 1-based coordinate translation and partition boundary indexing in
alignments.bfandGARD.bffor NEXUSCHARSETdefinitions and JSONbreakpointData.bpsoutput (#2010).
2. Core C++ Optimizer & Numerical Tolerance
Conjugate Gradient Descent Numerical Error Handling
-
Honoring
TOLERATE_NUMERICAL_ERRORS: Insrc/core/likefunc.cpp,_LikelihoodFunction::ConjugateGradientDescentpreviously invokedHandleApplicationErrorunconditionally when the post-optimization score worsened beyond machine epsilon. On large alignments with hundreds of parameters, sub-$10^{-12}$ floating-point roundoff noise caused MPI worker ranks to abort, resulting in cluster job cancellation (SIGKILL). -
Graceful Parameter Restoration: When
TOLERATE_NUMERICAL_ERRORS=1is set,ConjugateGradientDescentnow reports a console warning viaReportWarningConsole, restores the initial parameters on the likelihood function, and preserves the prior likelihood score rather than terminating the process (#2026, PR #2027).
3. BUSTED-PH Label-Order Invariance & IUT Correction
Label-Order Symmetry & Size-Directed Slaving
-
Symmetric Initialization: Resolved label-order asymmetry where swapping foreground and background branch labels produced divergent likelihood estimates in
BUSTED-PH.bf. Master parameter initializations now use tree-length-weighted averages of unconstrained estimates, clamped away from boundary constraints. - Size-Directed Slaving: Designates the larger/better-conditioned tree partition as the master model and slaves the smaller partition to it during shared parameter optimization (#2020, PR #2023).
-
Constraint Hygiene: Unconditionally clears lingering
$\omega$ constraints on both foreground and background models before Phase 3 (shared distribution optimization).
Intersection-Union Test (IUT) Dictionary Key Bug
-
Key Lookup Restoration: Corrected dictionary key lookup in
BUSTED-PH.bffrom'DIFF'to'Comparative'. Previously, the missing'DIFF'key evaluated to0.0, erroneously collapsing the composite test$p_c = \max(p_{\text{FG}}, p_{\text{Comparative}})$ to$p_{\text{FG}}$ alone (#2018, PR #2019). - Output Wording: Fixed summary wording from "between background and background" to "between foreground and background".
4. Clade-Support Output Validation
Valid JSON Output Under Degenerate Selection
-
Zero-Division & Entropy Guards: In
clade_support.bf, guarded clade-weight normalization against zero division ($0/0 \to \text{NaN}$ ) and skipped zero-weight clades in the entropy sum ($\log(0) \times 0 \to \text{NaN}$ ) when no rate class has$\omega > 1$ . - Emits valid JSON with zero weights and perplexity
1.0in the absence of positive selection, matching posterior-absent behavior (#2021, PR #2022).