Repository navigation
feat(bench): within-AMP selectivity benchmark — hemolytic vs selective AMP discrimination - #113
Merged
Merged
Conversation
…e AMP discrimination Add run_selectivity_benchmark() to benchmark/retrospective.py: tests whether pipeline scorers can distinguish hemolytic AMPs (HC50 < 25 µg/mL) from selective AMPs (HC50 >= 100 µg/mL). This is the within-AMP ranking task that the expert ablation benchmark (v0.5.8) identified as the correct test for the safety, selectivity, and synthesis components. New files: - examples/validation/hemolysis_reference.csv: 42 known AMPs with literature HC50 values (14 HEMOLYTIC, 21 SELECTIVE, 7 BORDER) - tests/test_selectivity_benchmark.py: 18 tests (real data + edge cases) Changes: - src/openamp_foundry/benchmark/retrospective.py: run_selectivity_benchmark() with per-score hemolysis detection AUROC, blind spot listing, border zone - src/openamp_foundry/cli/commands/benchmark.py: _run_selectivity_bench() - src/openamp_foundry/cli/main.py: bench selectivity subparser - Makefile: bench-selectivity target - docs/METRICS_CURRENT.md: full results section + change log entry - docs/ROADMAP.md: v0.5.9 section + expert ablation cross-reference update - docs/ARCHITECTURE.md: benchmark package description updated - docs/BENCHMARKING.md: within-AMP selectivity added to required benchmarks - docs/EXPERT_REVIEW_PACK.md: melittin blind spot updated with quantitative result - docs/REVIEWER_SUMMARY.md: blind spot row updated with detection AUROC - CHANGELOG.md: v0.5.9 entry Key findings (n_bootstrap=2000): 1. Safety scorer FAILS hemolysis detection (AUROC=0.3844, CI lo=0.26) — all 14 hemolytic AMPs score safety >= 0.8; melittin blind spot confirmed 2. Selectivity proxy FAILS (AUROC=0.4133, CI lo=0.28) — charge/GRAVY heuristic insufficient 3. Synthesis is only significant risk detector (AUROC=0.8027, CI lo=0.63) — incidental correlation via cysteine/repeat content 4. Expert composite better than ensemble (0.5119 vs 0.3486) but not significant 5. Activity scorer is anti-selective (AUROC=0.34) — ranks hemolytic AMPs higher 1453 tests pass (18 new).
…n test_selectivity)
cschanhniem
added a commit
that referenced
this pull request
Jun 30, 2026
…SP, correct small-sample inflation (#115) * feat(bench): expand hemolysis reference 42 to 238 peptides using DBAASP, correct small-sample inflation in hemolysis risk scorer The within-AMP selectivity benchmark (PR #113/#114) ran on only 42 peptides (14 hemolytic vs 21 selective, n=35 binary). The dedicated hemolysis risk scorer detection AUROC=0.9218 (CI 0.82-0.99) was based on this tiny set. DBAASP v3 hemolytic activity data (already in data/novelty_db/) contains 887 unique peptides with human erythrocyte 50 percent hemolysis measurements. This PR extracts 196 new peptides with HC50 values, converts uM to ug/ml using peptide molecular weight, and merges with the existing reference. Expanded benchmark (n=179 binary: 54 hemolytic vs 125 selective): hemolysis_risk detection AUROC: 0.9218 to 0.5650 (CI 0.47-0.66) NOT significant safety detection AUROC: 0.3844 to 0.5116 (CI 0.43-0.60) still not significant selectivity_proxy detection AUROC: 0.5744 (CI 0.50-0.66) borderline serum_stability: 0.5873 (CI 0.51-0.66) significant risk detector The original 0.92 AUROC was small-sample inflation. This is exactly the kind of self-deception the project adversarial benchmark philosophy is designed to catch. No scorer should be described as a statistically significant hemolysis detector based on the expanded set. Changes: - scripts/expand_hemolysis_benchmark.py: extraction and unit conversion - examples/validation/hemolysis_reference.csv: 42 to 238 peptides - tests: test renamed from significant detector to direction correct - docs: METRICS_CURRENT.md, ROADMAP.md, BENCHMARK_CARD.md updated - src: hemolysis.py and expert.py docstrings corrected All 1471 tests pass. No regressions. Constraint: DBAASP hemolysis data already in repo (data/novelty_db/); no new downloads needed Rejected: Using raw uM thresholds | Existing benchmark uses ug/ml; converting preserves comparability Rejected: Filtering to only uM data | Would lose 107 peptides with only ug/ml measurements Directive: Do not describe hemolysis_risk as statistically significant without re-validating on expanded set Confidence: high Scope-risk: narrow Tested: 1471 tests pass, 7 skipped; benchmark run on expanded set; all doc references updated Co-authored-by: OmX <noreply@omx.ai> * fix: Python 3.11 f-string compatibility in test_selectivity_benchmark --------- Co-authored-by: OmX <noreply@omx.ai>
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.
Add within-AMP selectivity benchmark testing whether scorers can distinguish hemolytic AMPs (HC50 < 25) from selective AMPs (HC50 >= 100). This is the recommended next step from the v0.5.8 expert ablation.
Key findings: safety scorer FAILS hemolysis detection (AUROC=0.3844); synthesis is only significant detector (AUROC=0.8027); expert composite better than ensemble but not significant (0.5119 vs 0.3486).
1453 tests pass (18 new).