feat: add recombination parameter estimator#464
Open
ivan-aksamentov wants to merge 3 commits into
Open
Conversation
Python mirror of the Rust estimator for freezing reviewed HMM parameters into datasets. Computes gamma, muW, muR from the reference tree using the same algorithm as the run-time estimator: substitutions and insertions counted, deletions excluded, muR from inter-clade leaf distances.
Parity tests transcribe the Rust unit-test fixtures as the oracle. CLI smoke tests verify the --pathogen write-back and stdout modes.
ivan-aksamentov
temporarily deployed
to
refs/pull/464/merge
July 8, 2026 15:50 — with
GitHub Actions
Inactive
23 tasks
Mirror the Rust estimator change: count a branch mutation only when both its reference and query bases are present (non-gap), so neither insertions ("-10A", gap reference) nor deletions ("A15-", gap query) contribute to muW/muR. The decoder scores substitutions only, so calibrating against indels would inflate both rates on externally produced trees (augur/TreeTime) that carry insertion tokens.
ivan-aksamentov
had a problem deploying
to
refs/heads/feat/recombination-detection
July 11, 2026 09:40 — with
GitHub Actions
Error
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.
nextclade: #1774A dataset can freeze reviewed HMM parameter values as explicit
pathogen.jsonoverrides, so that the model a reviewer signed off on is not silently shifted by a later tree update. This PR adds the Python helper that computes them.The script mirrors the Rust run-time estimator: it computes$\gamma$ , $\mu_w$ , $\mu_r$ from the reference tree using the same definitions (substitutions and insertions counted, deletions excluded, $\mu_r$ from inter-clade leaf distances). With
--pathogen, the estimates are written into the file'srecombinationobject in place; without it, they are printed to stdout for inspection. Parity is guarded by tests that transcribe the Rust unit-test fixtures as the oracle.Work items
scripts/recombination_paramswith tree-based estimation matching the Rust algorithm