Skip to content

feat: add charge×amphipathicity cross-term to activity scoring (#39) - #39

Merged
cschanhniem merged 1 commit into
mainfrom
feat/charge-amphipathicity-crossterm
Jun 28, 2026
Merged

cschanhniem merged 1 commit into
mainfrom
feat/charge-amphipathicity-crossterm

Conversation

@cschanhniem

Copy link
Copy Markdown
Collaborator

Summary

  • Adds cross_bonus = clamp01(charge_density × mu_h / 0.15) × 0.02 to activity_likeness_score()
  • Biophysical basis: electrostatic attraction (charge) + hydrophobic insertion (amphipathicity) are synergistic for the carpet/pore-forming AMP mechanism
  • Maximum bonus is +0.02, activating at typical-AMP charge density (0.30) and amphipathicity (0.50)
  • Adds 5 new tests in TestChargeAmphipathicityCrossTerm
  • Updates test_mu_h_0_4_half_bonus to account for cross-term contribution (0.075 → 0.079)

Biophysical rationale

AMPs kill bacteria through two synergistic forces:

  1. Electrostatic attraction (cationic charge → negatively-charged bacterial outer membrane)
  2. Amphipathic insertion (hydrophobic moment → bilayer membrane disruption)

Research shows that AMPs need BOTH for efficient membrane disruption (Zasloff 2002, Hancock & Sahl 2006). A peptide with high charge but no amphipathicity merely adsorbs; a peptide with amphipathicity but no charge doesn't preferentially target bacterial membranes. The cross-term captures this non-linear interaction.

Effect on scoring

Seed family cd estimate mu_h estimate cross_bonus
SEED-003 ~0.45 ~0.65 +0.020 (saturated)
SEED-001 ~0.27 ~0.60 +0.018
SEED-005 ~0.21 ~0.55 +0.015
SEED-006 (new) ~0.21 ~0.55 +0.015
SEED-004 ~0.08 ~0.75 +0.008 (low charge)

SEED-004 variants (temporin-like, low charge) get the smallest boost, which is scientifically correct — their membrane activity relies on hydrophobicity alone.

Tests

5 new tests:

  • test_zero_charge_gives_no_cross_bonus — zero charge → zero cross contribution
  • test_zero_amphipathicity_gives_no_cross_bonus — zero mu_h → zero cross contribution
  • test_full_cross_bonus_at_saturation — cd=0.30, mu_h=0.50 → exact +0.02
  • test_half_cross_bonus — cd=0.15, mu_h=0.50 → exact +0.01
  • test_dual_property_amps_score_higher_than_single_property

All 877 tests pass.

Test plan

  • pytest tests/test_scoring_activity.py — 36/36 passed (5 new)
  • pytest (full suite) — 877/877 passed
  • Manual verification: SEED-003 gets max cross-bonus; SEED-004 gets minimal cross-bonus

🤖 Generated with Claude Code

cschanhniem added a commit that referenced this pull request Jun 28, 2026
Combined helix propensity (PR #35) with cross-term (PR #39):
- activity.py: amphipathicity weight 0.14, adds helix_bonus + cross_bonus
- test_scoring_activity.py: update expected diffs to reflect 0.14 weight
  (test_mu_h_0_4_half_bonus: 0.074, cross term comments updated)
Add cross_bonus = clamp01(charge_density × mu_h / 0.15) × 0.02 to
activity_likeness_score(). Biophysical rationale: electrostatic
membrane attraction (charge) and hydrophobic bilayer insertion
(amphipathicity/mu_h) are synergistic — AMPs that are simultaneously
highly charged AND highly amphipathic outperform single-property
peptides by more than additive prediction implies.

Cross-term normalizer 0.15 = typical_cd (0.30) × typical_mu_h (0.50).
At saturation (cd≥0.30, mu_h≥0.50), bonus = 0.02.

Effect on existing nominees:
- SEED-003 variants (cd~0.45, mu_h~0.65): +0.020 (saturated)
- SEED-005 variants (cd~0.21, mu_h~0.55): +0.015
- SEED-006 Mastoparan-X variants (cd~0.21, mu_h~0.55): +0.015
- SEED-004 variants (cd~0.08, mu_h~0.75): +0.008 (low charge)
- SEED-001 variants (cd~0.27, mu_h~0.60): +0.018

Updated test_mu_h_0_4_half_bonus assertion (0.075 → 0.079 to account
for cross-term contribution). Added TestChargeAmphipathicityCrossTerm
class with 5 new tests.
@cschanhniem
cschanhniem force-pushed the feat/charge-amphipathicity-crossterm branch from ae4de49 to 458ec17 Compare June 28, 2026 05:13
@cschanhniem
cschanhniem merged commit 05d7b84 into main Jun 28, 2026
3 checks passed
@cschanhniem
cschanhniem deleted the feat/charge-amphipathicity-crossterm branch June 28, 2026 05:13
cschanhniem added a commit that referenced this pull request Jun 28, 2026
…D-amino plan, cross-term scoring (#43) (#43)

* docs: fix stale amphipathicity weight in test_scoring_activity.py docstring (0.15 → 0.14, add helix_bonus)

* docs: update discovery probability to ~22-42% incorporating PRs #39-42 (SEED-007/008, Wave 2 guidance, cross-term scoring)

* fix: correct bombolitin species (B. pennsylvanicus), fix MIC citation attribution, clarify per-candidate vs combined probability methodology
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