Repository navigation
feat: dedicated hemolysis risk scorer (detection AUROC=0.9218) - #114
Merged
Merged
Conversation
…82-0.99) Addresses the safety scorer's confirmed hemolysis blind spot (detection AUROC=0.3844, documented in v0.5.9) with a standalone 4-component risk score derived from empirically-validated signals: - Synthesis difficulty (1 - synthesis_feasibility) — AUROC=0.8027 - Aromatic fraction (F/W/Y density) — AUROC=0.8299 - Cationic-on-hydrophobic-face fraction — AUROC=0.7585 - Cysteine fraction (beta-sheet defensin class) — AUROC=0.7500 Combined detection AUROC=0.9218 (CI: 0.82-0.99) — first statistically significant hemolysis detector in the pipeline. Key design decisions: - Safety scorer UNCHANGED — standard AUROC remains 0.7832 - Hemolysis risk is complementary, not replacement - Integrated into expert composite as hemolysis_safety (weight 0.10) - Expert composite hemolysis detection: 0.5119 → 0.6429 - hemolysis_safety is anti-signal on AMP-vs-decoy (AUROC=0.3285) — expected, confirms it measures within-AMP property 15 new tests in test_hemolysis_risk.py; 3 new selectivity tests; 1471 total tests (7 skipped).
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.
Summary
Addresses the safety scorer's confirmed hemolysis blind spot (detection AUROC=0.3844, documented in v0.5.9) with a standalone 4-component risk score.
Changes
New module:
scoring/hemolysis.pyA dedicated hemolysis risk scorer combining four empirically-validated components from the selectivity benchmark:
Combined detection AUROC=0.9218 (CI: 0.82-0.99) -- first statistically significant hemolysis detector.
Integration
Key metrics
Test plan