Skip to content

Hotfix/pdb2amber neutralization - #121

Open
David-Araripe wants to merge 6 commits into
mainfrom
hotfix/pdb2amber-neutralization
Open

Hotfix/pdb2amber neutralization#121
David-Araripe wants to merge 6 commits into
mainfrom
hotfix/pdb2amber-neutralization

Conversation

@David-Araripe

Copy link
Copy Markdown
Collaborator

Summary

This PR hardens protein preparation in two areas:

  1. It normalizes amino-acid atom names and protonation-state geometry to the AMBER14sb conventions expected by pdb2amber/qprep.
  2. It makes out-of-sphere neutralization follow Q's force-field-specific charge-group rules while retaining the 3 Å outer SCAAS-layer default used by the benchmark preparation protocol.

Motivation

Input structures from different preparation tools can use different atom-numbering conventions, particularly for protonated carboxylates, neutral arginine/lysine, methyl hydrogens, and terminal oxygens. Some of these differences previously produced duplicate or incorrectly bonded atom identities after renaming.

Boundary neutralization also needs to use the same inclusion/exclusion reference as Q. A residue centroid or a single hard-coded atom does not reproduce Q consistently across force fields because AMBER and OPLS have different charge-group declarations (see FF/*.lib).

The need for these changes was flagged by @goodstudyqaq who SHAKE failures on the GPU kernel. The culprit was incorrect atom naming in the benchmarking repository, where a hydrogen that should belong to OE2 was incorrectly attached to OE1. This wasn't picked up in fortran as SHAKE allowed very high coordinate correction there.

image

Changes

PDB-to-AMBER atom normalization

  • Normalize GLH/ASH acidic hydrogen and oxygen identities from geometry without moving coordinates.
  • Normalize neutral ARN terminal nitrogen/hydrogen identities from their bonding geometry.
  • Correct numbered methyl-hydrogen mappings for ALA, VAL, and MET.
  • Normalize neutral LYN hydrogens to AMBER14sb HZ2/HZ3 names.
  • Handle protonated terminal-oxygen aliases and produce the expected charged C terminus.
  • Validate explicit backbone amide H–N distances.
  • Reject unresolved duplicate atom names rather than allowing residue nesting to split them silently.

Force-field-aware boundary neutralization

  • Preserve the default 3 Å neutralization layer: groups at or beyond sphere radius - 3 Å are neutralized.
  • Read charge groups from the selected Q .lib file and switch_atoms from its .prm options.
  • Match Q's boundary reference:
    • AMBER (switch_atoms off): geometric center of the formal charge group.
    • OPLS (switch_atoms on): first atom of the explicit formal charge group.
  • Derive atoms removed during charged-to-neutral conversion from the selected force-field templates.
  • Handle nonstandard OPLS terminal residue names through template charge and atom-set matching.
  • Detect boundary-crossing salt bridges using charged heavy-atom distances and neutralize the included partner together with the excluded residue.
  • Report the force field, boundary policy, modifications, salt bridges, terminal conversions, and full template-based charges in the returned statistics.
  • Fail explicitly for CHARMM until equivalent force-field-sensitive neutralization is implemented.

Force-field parsing

  • Extend parse_lib() to retain [charge_groups] and residue names containing punctuation, such as NAR+.
  • Add parse_prm_options() for reading options such as switch_atoms.

Testing

PYTHONPATH="$PWD/src" python -m pytest -q \
  test/qligfep/test_pdb_to_amber.py \
  test/qligfep/test_qprep_cli.py \
  test/qligfep/test_io.py

…ake the default out-of-sphere neutralization protocol aligned with the one used in the benchmark experiments.

The settings changed in the neutralization protocol is namely `--neutralize_boundary_offset` which is now set to 0, similar to what we had done in https://github.com/qusers/qligfepv2-BenchmarkExperiments
…xperiments while maintaining better inclusion / exclusion definition (as in fortran's `qprep`)

- restore the `default neutralize_boundary_offset` parameter in qprep_prot to use 3.0 as default (chage in the previous commit)
- improve the neutralization detection: previous commit used residue centroids to define included/excluded, but it now also checks for explicit charge group definitions
…esidues and potential duplication in case both 1HB, HB1 atoms are declared (would create two HB1; the definition in the forcefield)
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