Repository navigation
Add execution harness and adapters (stubs) - Milestone 4 - #24
Merged
Merged
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
hyperpolymath
added a commit
that referenced
this pull request
Oct 18, 2026
Implement #37. analysis.differential.dispersion chooses where nb_glm's per-taxon dispersion theta comes from. The default glm_nb keeps MASS:: glm.nb's maximum-likelihood theta per taxon, so #24's results are unchanged. The alternative glmGamPoi fits one glmGamPoi::glm_gp over all taxa passing min_prevalence, reads its overdispersion_shrinkage_list$dispersion_trend, and refits each taxon through MASS::negative.binomial(theta = 1/trend), so the inference is still a Wald test of the group coefficient at fixed scale 1. The trend is plugged in as fixed: its estimation uncertainty is not propagated, and this is not glmGamPoi's quasi-likelihood test. A glm_gp fit error or a trend of the wrong length fails every taxon; a zero or invalid trend marks only its own taxon as a boundary or failed fit, with NB Wald statistics withheld at the Poisson boundary. Missing glmGamPoi raises GlmGamPoiUnavailable (HTTP 503 on the analysis route), never a silent fallback to maximum-likelihood theta. glmGamPoi is refused for clr_welch. Config saves publish one validated YAML document: the method/dispersion pair is checked across the affected study/group/run cascade before a single atomic write, PATCH bodies apply all-or-nothing, and DELETEs re-validate the value they reveal. The frontend offers the dispersion enum in method settings, and the tests compare both dispersion paths against direct MASS and glmGamPoi calls in R, failing (not skipping) in CI when glmGamPoi is missing. Closes #37. Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
hyperpolymath
added a commit
that referenced
this pull request
Oct 18, 2026
Implement #37. analysis.differential.dispersion chooses the fits and the test for nb_glm. The default glm_nb keeps MASS::glm.nb with its maximum-likelihood theta per taxon and a Wald test of the group coefficient, so #24's results are unchanged. The alternative glmGamPoi fits one glmGamPoi::glm_gp over the taxa passing min_prevalence with overdispersion shrinkage and reports glmGamPoi::test_de's quasi-likelihood F-test of the group contrast -- its own published inference -- with the returned log2 fold changes and their standard errors converted to the natural-log scale so every method reports one effect scale. The reported dispersion is the inverse of the shrunken quasi-likelihood dispersion the test used. A glm_gp or test_de error fails every taxon; a zero shrunken dispersion marks only its own taxon as a Poisson boundary and withholds inference there, and an unusable dispersion fails only its own taxon. Missing glmGamPoi raises GlmGamPoiUnavailable (HTTP 503 on the analysis route), never a silent fallback to another estimator or test. glmGamPoi is refused for clr_welch; the pair rule lives in DifferentialConfig and is reported at analysis time, while the config routes keep their ordinary per-key validation with the dispersion spellings registered alongside the other enums. The frontend offers the dispersion enum in method settings, and the tests compare the glmGamPoi path against direct glm_gp + test_de calls in R -- p-values, F statistics and log fold changes -- failing (not skipping) in CI when glmGamPoi is missing. Closes #37. Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
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.



Milestone 4 — Execution harness
Implements src/analysis/Execution.jl with abstract AnalysisAdapter, RAdapter, JuliaAdapter, ExecutionDiagnostics, ExecutionManifest, ExecutionResult, self_diagnostics, safe_self_healing, prepare_analysis_table (declared transform, offset, zero_policy, epistemic filtering, Advanced validation, hard-stop DANGER banner), run_analysis stub (full manifest hash chain).
Tests: test/unit/test_execution.jl covers CLR pseudocount=1 epsilon=1e-6 drop vs impute, adapter mismatch, DANGER banners.
Board: https://github.com/users/hyperpolymath/projects/45