Skip to content

feat(bench): expand hemolysis reference 42 to 238 peptides using DBAASP, correct small-sample inflation - #115

Merged
cschanhniem merged 2 commits into
mainfrom
loop/oamp-20260701-3
Jun 30, 2026
Merged

cschanhniem merged 2 commits into
mainfrom
loop/oamp-20260701-3

Conversation

@cschanhniem

Copy link
Copy Markdown
Collaborator

Summary

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's 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% hemolysis measurements. This PR extracts 196 new peptides with HC50 values, converts µM to µg/ml using peptide molecular weight, and merges with the existing reference.

Expanded benchmark results (n=179 binary: 54 hemolytic vs 125 selective)

Score Detection AUROC CI₉₅ Significant?
hemolysis_risk 0.5650 0.47-0.66 No (direction correct)
safety 0.5116 0.43-0.60 No
selectivity_proxy 0.5744 0.50-0.66 Borderline
ensemble 0.4201 0.33-0.51 No (wrong direction)
expert_composite 0.5459 0.46-0.63 No
serum_stability 0.5873 0.51-0.66 Yes (risk detector)

Key finding

The original 0.92 AUROC was small-sample inflation. This is exactly the kind of self-deception the project's 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 + unit conversion script
  • examples/validation/hemolysis_reference.csv: 42 → 238 peptides
  • tests/test_selectivity_benchmark.py: test renamed from test_hemolysis_risk_is_significant_detector to test_hemolysis_risk_direction_correct
  • tests/test_hemolysis_risk.py: docstring updated with correction note
  • docs/METRICS_CURRENT.md, docs/ROADMAP.md, docs/BENCHMARK_CARD.md: corrected metrics and honest interpretation
  • src/openamp_foundry/scoring/hemolysis.py, src/openamp_foundry/scoring/expert.py: docstrings/comments corrected

Verification

All 1471 tests pass (7 skipped). No regressions. Pre-push hook ran full test suite.

Constraint: DBAASP hemolysis data already in repo (data/novelty_db/); no new downloads needed
Rejected: Using raw µM thresholds | Existing benchmark uses µg/ml; converting preserves comparability
Rejected: Filtering to only µM data | Would lose 107 peptides with only µg/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

cschanhniem and others added 2 commits July 1, 2026 05:14
…SP, 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>
@cschanhniem
cschanhniem merged commit ed19561 into main Jun 30, 2026
1 check passed
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