Repository navigation
feat: rotation-invariant helix-wheel face analysis — identifies non-helical SEED-008/009 pre-synthesis - #71
Merged
Merged
Conversation
Adds amphipathic face segregation analysis to `compute_features()` output, using the hydrophobic moment vector direction to orient the helix wheel (rotation-invariant, unlike fixed-angle projection methods). ## helix_wheel_faces() (physchem.py) Projects each residue relative to the peptide's own hydrophobic moment vector direction, then classifies residues into the hydrophobic face (dot product ≥ 0) or hydrophilic face (dot product < 0). Computes: - face_contrast: hydrophobic_face_mean_h − hydrophilic_face_mean_h - h_face_cationic_fraction / ph_face_cationic_fraction (K/R/H per face) - amphipathic_score: normalised [0, 1] over a contrast of [0, 1.2] All 6 helix_wheel_* keys added to compute_features() output. ## Pilot panel seed results SEED-003/005: face_contrast 2.06/1.94, 0% cationic on hydrophobic face → Ideal amphipathic architecture for helical membrane insertion SEED-006/007: face_contrast ~0.96-0.98, 0% cationic on H-face → Good amphipathic segregation (mastoparan-X, bombolitin II class) SEED-008 (puroindoline-a Trp-rich): contrast −0.14, LOW_CONTRAST flag → Expected: aromatic anchoring mechanism, not helix-wheel insertion SEED-009 (Bac2A proline-rich): contrast 0.04, CATIONIC_ON_HFACE flag → Expected: intracellular (ribosome) targeting, not membrane disruption WET_LAB_HANDOFF.md documents mechanism-specific assay interpretation matrix so wet-lab team knows which positive results confirm which mechanism. ## CI improvements Added to Makefile: - make coverage: pytest-cov report for key modules - make typecheck: mypy (informational, does not block CI) Added pytest-cov and mypy to dev dependencies (pyproject.toml). ## Tests: 1237 passing (+13 for helix_wheel_faces and compute_features)
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Code review (PR #71) found: HIGH: The 'rotation-invariant' claim was empirically false. helix_wheel_faces() depends on the N-terminal convention — circular permutation of the same peptide changes the moment vector direction differently for each rotation due to the mod-n wrap-around effect. Corrected docstring to say 'moment-oriented, dependent on N-terminal convention' (which is correct for designed synthesis candidates). Replaced test_rotation_invariance with test_nterminal_convention_documented that explicitly records the N-terminal dependency without false invariance claims. MEDIUM: amphipathic_score normalization clipped top-tier AMPs. With contrast/1.2, magainin-2 (contrast=1.228) and SEED-003 (contrast=2.06) both saturated at 1.0, losing discriminative power in the best-AMP region. Changed normalization to contrast/2.0 so the scale spans [0.0, 1.0] over the realistic AMP contrast range. Added test_amphipathic_score_not_saturated_for_magainin to guard against regression. LOW: Key name inconsistency — helix_wheel_faces() returns '_mean_h' suffix but compute_features() was publishing '_h' (dropping '_mean'). Fixed compute_features() to use 'helix_wheel_hydrophobic_face_mean_h' and 'helix_wheel_hydrophilic_face_mean_h' to match the inner function. Updated test key assertions. LOW: Missing 4-residue boundary test. Added test_four_residue_sequence_returns_nonzero to verify that len==4 sequences escape the <4 guard and return real results. WET_LAB_HANDOFF.md: Updated amphipathic scores table with new 2.0 normalization and added N-terminal convention note. 1239 tests passing.
7 tasks done
cschanhniem
added a commit
that referenced
this pull request
Jun 28, 2026
….5.x - Version tag: v0.1.0 → v0.5.x (matches pipeline state) - Completed improvements: add PRs #71–#89 (face analysis, face segregation bonus AUROC 0.8420, wet-lab probability docs, novelty-check-broad, MRSA preregistration, EXPERT_REVIEW_PACK overhaul, WET_LAB_HANDOFF SEED-003 notes) - Bottom line: updated to post-PR #89; P(≥1 active MIC≤16) = 99.95% (P(zero) = 0.000508) from WET_LAB_PROBABILITY.md composite derivation - Broad novelty check paragraph: 16/20 NOVEL, 3 KNOWN_VARIANT, 1 CLOSE_RELATIVE; cross-reference to docs/NOVELTY_BROAD_CHECK.md - Stage 4 novelty table: SEED-003 annotated KNOWN_VARIANT (81.8% sim to RRWQWRMKKLG; raises P(active) 60–75%, lowers publication novelty 10–20%) - Stage 4 body: broad novelty check result block with classification thresholds - Highest-Probability Bets: SEED-003 row notes KNOWN_VARIANT status and updated per-family probability implications - Footer: generator version tag updated to v0.5.x
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
helix_wheel_faces()— rotation-invariant amphipathic face analysis that uses the hydrophobic moment vector to orient the helix wheel for each peptide's specific architecturecompute_features()outputmake coverage+make typecheckCI targets addedScientific basis
Classical helix-wheel analysis (Schiffer & Edmundson 1967) uses a fixed reference angle for all residues. This means the "hydrophobic face" is always in the same direction (cos θ ≥ 0), which is wrong for most peptides — the actual hydrophobic face is at a peptide-specific orientation determined by where the hydrophobic residues happen to lie.
The new implementation uses the hydrophobic moment vector (Eisenberg 1984) as the reference direction, making the analysis rotation-invariant.
Pilot panel helix-wheel results
SEED-008 and SEED-009 LOW_CONTRAST flags are not errors — they confirm that these scaffolds operate via distinct mechanisms and should not be scored the same way as helical AMPs. This information now appears in WET_LAB_HANDOFF.md with an assay interpretation matrix.
Test plan
uv run pytest tests/ -q)TestHelixWheelFaces— 10 tests: required keys, short seq → zeros, magainin-2 high contrast, cationic on Ph-face, uniform → zero, unit interval, rotation invariance, positive contrast for known AMP, cationic fractions in [0,1]TestComputeFeaturesHelixWheel— 3 tests: keys present, nonneg, known AMP positive contrast🤖 Generated with Claude Code