fix(ops): Correct N-Terminal Proline Hydrogen Geometry#41
Merged
TKanX merged 4 commits intoMar 28, 2026
Merged
Conversation
… accurate hybridization
3 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes N-terminal Proline hydrogen reconstruction so PRO (secondary amine) no longer receives an invalid third N–H and uses ring-aware geometry for placed hydrogens.
Changes:
- Added a PRO-specific branch in
construct_n_term_hydrogensto place onlyH2(neutral) orH2+H3(protonated), neverH1. - Updated N-terminal hydrogen placement for PRO to use CA–N–CD bisector/perpendicular directions rather than the generic sp³ frame.
- Added targeted tests covering PRO N-terminus protonation behavior and geometric sanity checks (bond lengths/angles).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… terminal logic in hydrogen addition phase
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:
Fixed a bug where N-terminal Proline residues were incorrectly assigned three hydrogens (H1, H2, H3) with a standard primary amine sp³ geometry. Proline has a secondary amine due to its pyrrolidine ring, so its N-terminus should only receive two hydrogens (H2, H3) when protonated, and one (H2) when deprotonated. The geometry calculation has been updated to correctly place these hydrogens based on the angle bisector of the CA-N-CD bonds, respecting the ring structure.
Changes:
Updated
construct_n_term_hydrogensinops/hydro.rs:StandardResidue::PRO.Added Validation Tests:
n_terminal_pro_residuehelper for generating test cases.pro_n_terminal_defaults_to_protonated_without_ph,pro_n_terminal_remains_protonated_below_pka,pro_n_terminal_deprotonates_above_pka).pro_n_terminal_h_has_tetrahedral_bond_lengths,pro_n_terminal_h_has_tetrahedral_bond_angles) to ensure the newly placed hydrogens satisfy the expected 1.01 Å bond length and ~109.5° tetrahedral angles relative to the CA and CD atoms.