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

Weird coordinates and unable to add Hydrogens upon adding tyrosines #304

Open
sukritsingh opened this issue Aug 20, 2024 · 5 comments
Open

Comments

@sukritsingh
Copy link

I've noticed the following weird behaviors with pdbfixer upon mutating to a Tyrosine. The first one is on the latest stable release, the other is on the latest dev build:

First issue:
If I take an input PDB file and then run the following commands on a stable installation:

from pdbfixer import PDBFixer
from openmm.app import PDBFile
fixer = PDBFixer(filename='test-ser-noPhos.pdb')
fixer.applyMutations(["SER-173-TYR"], "A")
fixer.findMissingResidues()
fixer.findMissingAtoms()
fixer.addMissingAtoms()
fixer.addMissingHydrogens(7.0)
PDBFile.writeFile(fixer.topology, fixer.positions, open('test-tyr-output.pdb', 'w'))

The commands run, but the coordinates for TYR173 look absolutely wrong. The extra bonds are probably just artifacts from pymol but it's putting the coordinates of the ring much closer together than normal. Screenshot below of "output tyrosine":
image

Second issue: Weirdly, upon running the above code block from issue 1 with the latest dev version (Basically, since non-standard residue mutations were added), the above command block fails at fixer.addMissingHydrogens(7.0), giving the following stack trace:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[6], line 1
----> 1 fixer.addMissingHydrogens(7.0)

File ~/miniconda3/envs/dev-pdbfixer/lib/python3.9/site-packages/pdbfixer-1.9.0-py3.9.egg/pdbfixer/pdbfixer.py:1233, in PDBFixer.addMissingHydrogens(self, pH, forcefield)
   1210 def addMissingHydrogens(self, pH=7.0, forcefield=None):
   1211     """Add missing hydrogen atoms to the structure.
   1212 
   1213     Parameters
   (...)
   1231     >>> fixer.addMissingHydrogens(pH=8.0)
   1232     """
-> 1233     extraDefinitions = self._downloadNonstandardDefinitions()
   1234     variants = [self._describeVariant(res, extraDefinitions) for res in self.topology.residues()]
   1235     modeller = app.Modeller(self.topology, self.positions)

File ~/miniconda3/envs/dev-pdbfixer/lib/python3.9/site-packages/pdbfixer-1.9.0-py3.9.egg/pdbfixer/pdbfixer.py:1244, in PDBFixer._downloadNonstandardDefinitions(self)
   1240 def _downloadNonstandardDefinitions(self):
   1241     """If the file contains any nonstandard residues, download their definitions and build
   1242     the information needed to add hydrogens to them.
   1243     """
-> 1244     app.Modeller._loadStandardHydrogenDefinitions()
   1245     resnames = set(residue.name for residue in self.topology.residues())
   1246     definitions = {}

AttributeError: type object 'Modeller' has no attribute '_loadStandardHydrogenDefinitions'

I also appear to be getting this issue as well on Tryptophans. Any insight as to what might be going on?

@peastman
Copy link
Member

The latest dev code for PDBFixer requires the latest dev build for OpenMM. It requires a function that was added since the last release.

@sukritsingh
Copy link
Author

Oh! Let me try getting both dev builds – sounds like that will resolve both of these issues!

@peastman
Copy link
Member

It might or might not fix the distorted ring. But if you just do a local energy minimization on the output structure, does that fix it?

@sukritsingh
Copy link
Author

sukritsingh commented Aug 20, 2024

But if you just do a local energy minimization on the output structure, does that fix it?

I imagine it would, but will need to test it. That said, I can envision use cases where one might want to avoid (relatively expensive) minimization process, even if it was just in vacuo. Is there a way to just do minimization on just the ring?

@peastman
Copy link
Member

You should assume anything coming out of PDBFixer needs energy minimization before it's ready to use.

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

No branches or pull requests

2 participants