Skip to content

Improve ACE/NME cap geometry with NeRF-based placement#346

Open
aqemia-richard-gildea wants to merge 1 commit intoopenmm:masterfrom
Aqemia:feat/nerf-cap-geometry
Open

Improve ACE/NME cap geometry with NeRF-based placement#346
aqemia-richard-gildea wants to merge 1 commit intoopenmm:masterfrom
Aqemia:feat/nerf-cap-geometry

Conversation

@aqemia-richard-gildea
Copy link

Problem

_addMissingResiduesToChain uses Kabsch SVD overlay to place all missing residues, including terminal caps (ACE/NME). This produces distorted geometry for caps:

  • ACE has only 2 matching backbone atoms (C, O) — rotation around the C-O axis is underdetermined
  • NME matches 2 atoms by name (N, C) but the match is semantically wrong: NME's sp3 methyl "C" aligns to the adjacent residue's sp2 backbone "C", which are at different positions relative to N
  • Neither cap has CA, so the trans-peptide rotation step (line 794) is skipped
  • Result: bond angles and omega dihedrals can be significantly off, depending on the structure

Solution

Use the NeRF algorithm (Natural Extension Reference Frame, Parsons et al. 2005) to place cap atoms from internal coordinates (bond length, bond angle, dihedral) relative to three backbone reference atoms (N, CA, C) of the adjacent residue. This is fully determined regardless of the number of template atoms and produces ideal geometry in one shot.

Changes

pdbfixer/pdbfixer.py:

  • Add _placeAtomNeRF(): general NeRF atom placement from 3 reference points + internal coordinates
  • Add _buildAceCap() / _buildNmeCap(): build cap positions using bond parameters from Engh & Huber (1991), Acta Cryst. A47, 392-400 (tabulated values)
  • Modify _addMissingResiduesToChain: route ACE/NME to NeRF placement when adjacent residue has full backbone (N, CA, C); fall back to existing Kabsch overlay otherwise

pdbfixer/tests/test_nerf_caps.py (new):

  • Unit tests for NeRF placement (bond length, angle, collinear guard)
  • Bond length and omega dihedral tests for ACE/NME caps, parametrized over identity and rotated reference frames
  • End-to-end integration test verified against AMBER14 force field

Test results

All 34 tests pass (12 new + 22 existing).

The Kabsch SVD overlay produces distorted geometry for terminal caps.
ACE has only 2 matching backbone atoms (C, O), leaving rotation around
the C-O axis underdetermined. NME matches 2 atoms by name (N, C) but
the match is semantically wrong: NME's sp3 methyl "C" aligns to the
adjacent residue's sp2 backbone "C", which are at different positions
relative to N. Neither cap has CA, so the trans-peptide rotation step
is also skipped.

Replace with NeRF algorithm (Parsons et al. 2005) which places atoms
from internal coordinates relative to three backbone reference atoms,
producing ideal geometry in one shot.

Co-authored-by: Richard Gildea <rgildea@gmail.com>
@peastman
Copy link
Member

peastman commented Mar 5, 2026

Thanks! Do you have a test case where the current behavior leads to wrong results? The initial atom placement is only expected to be very approximate. It relies on energy minimization with a soft core force field to clean up problems. Do you have a case where it isn't working?

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.

2 participants