Repository navigation
feat: replace charge proxy with Henderson-Hasselbalch net charge at pH 7.4 - #34
Merged
Merged
Conversation
…H 7.4 Add net_charge_at_ph74() using physiologically accurate pKa values (R: 12.5, K: 10.5, H: 6.5, D: 3.9, E: 4.1). His is partially protonated at pH 7.4 (~+0.11 vs +1.0 in proxy), correcting charge overestimation in 24/88 nominees containing His residues (~0.89 per His overestimation). - physchem.py: add net_charge_at_ph74(), expose net_charge_ph74 and charge_density_ph74 fields from compute_features() - activity.py: use charge_density_ph74 (falls back to charge_density for manually constructed dicts without the new field) - tests/test_net_charge_ph74.py: 24 tests covering His partial protonation, proxy comparison, neutral AA handling, and compute_features integration
cschanhniem
added a commit
that referenced
this pull request
Jun 28, 2026
…ne (#35) * feat: add Chou-Fasman helix propensity scoring (Pα) to feature pipeline Add helix_propensity_score() using Chou-Fasman (1974) Pα parameters. The mean Pα across all residues quantifies helical-forming tendency: >1.03 is helix-forming, <0.75 is helix-breaking (Pro=0.57, Gly=0.57). All 5 pilot panel seed families rely on helical amphipathicity for membrane disruption, so this feature adds discriminative signal against proline-rich or random sequence backgrounds. - physchem.py: _HELIX_PROPENSITY table + helix_propensity_score(); exposes helix_propensity key in compute_features() return dict - activity.py: helix_bonus (max +0.01) added; amphipathicity weight reduced 0.15→0.14 to maintain score ceiling below 1.0 - tests/test_helix_propensity.py: 23 tests (Pα values, helix vs proline-rich sequences, compute_features integration, activity score fallback) - tests/test_scoring_activity.py: update hardcoded weight assertion 0.075→0.07 - docs/DISCOVERY_PREDICTION.md: mark PR #34 done, add item 5 for Chou-Fasman * fix: remove unused pytest import (ruff F401)
…harge_ph74 before return
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
net_charge_at_ph74()— new function inphyschem.pyusing Henderson-Hasselbalch with peptide-context pKa values (R: 12.5, K: 10.5, H: 6.5, D: 3.9, E: 4.1). His is partially protonated at pH 7.4 (+0.114 vs +1.0 in the integer proxy).compute_features()now returns two new keys:net_charge_ph74(float) andcharge_density_ph74(float), alongside the existingnet_charge_proxyandcharge_densityfor backward compatibility.activity_likeness_score()usescharge_density_ph74by default, falling back tocharge_densityfor manually constructed feature dicts that predate this field.compute_features()integration.Impact on nominees
24/88 nominees contain His residues. The proxy overestimates charge by ~0.89 per His. With charge_density weight 0.27 in the scoring function and typical lengths 14–22 aa, the per-candidate score correction is ~0.01–0.017 points. Nominees whose ranking was inflated by proxy His-counting will drop slightly; those with accurate R/K charge sources are unaffected.
Test plan
pytest tests/test_net_charge_ph74.py— 24/24 passpytest— 896/896 pass (pre-push hook verified)net_charge_at_ph74("H")≈ 0.1117 (Henderson-Hasselbalch at pH 7.4, pKa 6.5)net_charge_at_ph74("KRIVQRIKDFLR")== 4.0 (no His, pure K+R)activity.pyfallback verified: manually constructed dicts with onlycharge_densitykey still score correctlyBreaking news probability update
No change to stated probability range (10–25%) — this fix corrects a systematic bias but does not add new discriminative signal. His-containing nominees with high scoring were likely slightly overrated; the correction tightens accuracy of the pipeline rather than boosting hit rate.