Gate gene DE methods in pairwise; centralise DE-method vocabulary#5
Open
annaquaglieri16 wants to merge 1 commit into
Open
Gate gene DE methods in pairwise; centralise DE-method vocabulary#5annaquaglieri16 wants to merge 1 commit into
annaquaglieri16 wants to merge 1 commit into
Conversation
run_pairwise_comparison accepted any de_method without validating it against entity_type, so an invalid combo (e.g. edgeR for protein) was only caught downstream by the server. run_anova already gated; pairwise did not. - Add de_method gating to run_pairwise_comparison (engine allowed per entity_type + edgeR/DESeq2 companion-param validation). The bulk tool routes through this function, so it inherits the gate. - Centralise the edgeR/DESeq2 allowed-value vocabularies and numeric ranges in _methods.py (_EDGER_NORM_METHODS, _DESEQ2_LFC_SHRINKAGE, _DESEQ2_ALPHA_RANGE, _APEGLM_SEED_RANGE), mirroring process_r.py. anova.py now reads them instead of inline literals. - Each tool keeps its own gating block (no shared validator) so the two can diverge or be updated independently; only the vocabulary is shared. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
What
de_methodgating torun_pairwise_comparison(it had none;run_anovaalready gated). Invalid engine/entity combos — e.g.edgeR/DESeq2for protein/peptide/metabolite/ptm — now fail fast in the MCP with a clear message instead of being rejected downstream by the server._methods.py(single source mirroringMDFlexiComparisons/.../process_r.py).anova.pynow reads them instead of inline literals.Why
pairwise.pyaccepted anyde_methodwithout validating againstentity_type. The allowed values were also hardcoded inline inanova.py, so adding a pairwise gate naively would have created a third copy — centralising removes that drift risk.Design note (intentional)
The two tools keep separate gating blocks and signature defaults on purpose, so
anovaandpairwisecan validate differently or be updated in different orders. Only the vocabulary (the allowed values) is shared, in_methods.py.Keeping in sync
The DE-method vocabulary now lives only in
_methods.py— keep it aligned withprocess_r.py(de_method_gene,edger_norm_method,deseq2_lfc_shrinkageLiterals +deseq2_alpha/apeglm_seedranges). A drift-check script is a possible follow-up.Testing
_methods.pyimports cleanly with the expected values.anova.py/pairwise.pyimport from_methodsexists (no typos).pip install -e ".[mcp]"would allow a runtime check.🤖 Generated with Claude Code