Skip to content

2.5.102

Choose a tag to compare

@spond spond released this 06 Oct 12:57
· 5 commits to master since this release
701358e

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.GetIC now explicitly returns math.Infinity whenever $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.bf from $(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 <= numSites and 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.bf and GARD.bf for NEXUS CHARSET definitions and JSON breakpointData.bps output (#2010).

2. Core C++ Optimizer & Numerical Tolerance

Conjugate Gradient Descent Numerical Error Handling

  • Honoring TOLERATE_NUMERICAL_ERRORS: In src/core/likefunc.cpp, _LikelihoodFunction::ConjugateGradientDescent previously invoked HandleApplicationError unconditionally 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=1 is set, ConjugateGradientDescent now reports a console warning via ReportWarningConsole, 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.bf from 'DIFF' to 'Comparative'. Previously, the missing 'DIFF' key evaluated to 0.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 &gt; 1$.
  • Emits valid JSON with zero weights and perplexity 1.0 in the absence of positive selection, matching posterior-absent behavior (#2021, PR #2022).

5. Script & Formatting Polish

Syntax & Typo Fixes

  • Contrast-MEME Table Formatting: Fixed syntax typo ormat $\to$ Format() in the site-level report table of contrast-meme.bf (#2007, PR #2017).
  • Assertion Message: Fixed "partiton" typo in GARD.bf pre-flight diagnostic string.