Skip to content

feat: dedicated hemolysis risk scorer (detection AUROC=0.9218) - #114

Merged
cschanhniem merged 1 commit into
mainfrom
oamp-loop-2026-07-01
Jun 30, 2026
Merged

cschanhniem merged 1 commit into
mainfrom
oamp-loop-2026-07-01

Conversation

@cschanhniem

Copy link
Copy Markdown
Collaborator

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.py

A dedicated hemolysis risk scorer combining four empirically-validated components from the selectivity benchmark:

Component Individual AUROC Weight
Synthesis difficulty 0.8027 0.30
Aromatic fraction 0.8299 0.30
Cationic-on-hydrophobic-face 0.7585 0.20
Cysteine fraction 0.7500 0.20

Combined detection AUROC=0.9218 (CI: 0.82-0.99) -- first statistically significant hemolysis detector.

Integration

  • Selectivity benchmark: hemolysis_risk added as risk-direction score
  • Expert composite: hemolysis_safety component (weight 0.10)
  • Safety scorer UNCHANGED -- standard AUROC remains 0.7832

Key metrics

Metric Before After
Hemolysis detection AUROC 0.3844 (safety) 0.9218 (hemolysis_risk)
Expert composite detection 0.5119 0.6429
Standard AUROC 0.7832 0.7832 (unchanged)
Total tests 1453 1471

Test plan

  • 15 new tests in test_hemolysis_risk.py
  • 3 new tests in test_selectivity_benchmark.py
  • Updated test_expert_ablation.py
  • All 1471 tests pass (7 skipped)

…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
cschanhniem merged commit f863407 into main Jun 30, 2026
1 check passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant