Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACE ignored when calling addMissingHydrogens #319

Closed
ross-pure opened this issue Dec 3, 2024 · 4 comments · Fixed by #320
Closed

ACE ignored when calling addMissingHydrogens #319

ross-pure opened this issue Dec 3, 2024 · 4 comments · Fixed by #320

Comments

@ross-pure
Copy link

I was using this tool to add an ACE cap to my protein and then add missing hydrogens. I noticed that hydrogens were added to all residues except for the ACE. Looking at the code I believe I can see why this happens: when getting the variants for ACE, in the call to _describeVariant, there is the following logic

if residue.name not in app.PDBFile._standardResidues and self._getTemplate(residue.name) is not None:
    # The user has registered a template for this residue.  Use the hydrogens from it.
    ...

This branch is taken because ACE is not in _standardResidues. But the template is just the default one loaded from the templates directory, which doesn't have any hydrogens. As a result, the value returned from _describeVariant is an empty list, instead of None. Consequently, since the Modeller has the following branch:

if isinstance(variant, list):
    spec = Modeller._ResidueData(residue.name)
    infinity = float('Inf')
    spec.hydrogens = [Modeller._Hydrogen(name, parent, infinity, None, None) for name, parent in variant]

no hydrogens will be added.

My questions are:

  • Is this expected behaviour?
  • What is a reasonable work around to have the hydrogens actually get added to the ACE (and NME) residue(s)?
@peastman
Copy link
Member

peastman commented Dec 3, 2024

You're completely right. We only want it to use user-supplied templates there, not ones from the templates directory. That's what residue.name not in app.PDBFile._standardResidues is supposed to accomplish. But really we should record a list of the built in templates and check that instead of _standardResidues.

@peastman
Copy link
Member

peastman commented Dec 3, 2024

The fix is in #320, if you want to test it out.

@ross-pure
Copy link
Author

Just tested #320 on the system that I was having the issue with and now it seems to be fixed - Hs are added to the ACE. Thanks!

@peastman
Copy link
Member

peastman commented Dec 3, 2024

Thanks!

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 a pull request may close this issue.

2 participants