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

No template find for residue... #4519

Open
GustavoG9 opened this issue Apr 22, 2024 · 1 comment
Open

No template find for residue... #4519

GustavoG9 opened this issue Apr 22, 2024 · 1 comment

Comments

@GustavoG9
Copy link

Hi, I have been trying to parametrize a small molecule using OpenMM. I have tried looking in the FQA section, but I still haven't been able to find a solution to my problem. Every time I try to run, I fall into the following error:

Did not recognize residue MOL; did you forget to call .add_molecules() to add it? Traceback (most recent call last): File "/oscar/home/ggramire/Polyelectrolyte/nonpolarizableff/polye_gaff2_amber/OPC/dimer_IE/openff-2.1.0/test.py", line 19, in <module> system = forcefield.createSystem(pdbfile.topology) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/users/ggramire/anaconda/openmm/lib/python3.11/site-packages/openmm/app/forcefield.py", line 1218, in createSystem templateForResidue = self._matchAllResiduesToTemplates(data, topology, residueTemplates, ignoreExternalBonds) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/users/ggramire/anaconda/openmm/lib/python3.11/site-packages/openmm/app/forcefield.py", line 1433, in _matchAllResiduesToTemplates raise ValueError('No template found for residue %d (%s). %s For more information, see https://github.com/openmm/openmm/wiki/Frequently-Asked-Questions#template' % (res.index+1, res.name, _findMatchErrors(self, res))) ValueError: No template found for residue 1 (MOL). This might mean your input topology is missing some atoms or bonds, or possibly that you are using the wrong force field. For more information, see https://github.com/openmm/openmm/wiki/Frequently-Asked-Questions#template

I attached the pdb file at the end. This is the script used, any help would be highly appreciated. Thank you in advance.

``

Create an OpenFF Molecule object for benzene from SMILES

from openff.toolkit.topology import Molecule
molecule = Molecule.from_smiles('CC(=O)OCCN+(C)CC1=CC=CC=C1')
###Create the SMIRNOFF template generator with the default installed force field (openff-1.0.0)
from openmmforcefields.generators import SMIRNOFFTemplateGenerator
smirnoff = SMIRNOFFTemplateGenerator(molecules=molecule)
smirnoff.add_molecules(molecule)

Create an OpenMM ForceField object with AMBER ff14SB and TIP3P with compatible ions

from openmm.app import ForceField

forcefield = ForceField('amber14/protein.ff14SB.xml')
forcefield = ForceField('amoeba2018.xml')

Register the SMIRNOFF template generator

forcefield.registerTemplateGenerator(smirnoff.generator)

from openmm.app import PDBFile
pdbfile = PDBFile('monomer.pdb')
system = forcefield.createSystem(pdbfile.topology)

print("Parametrization successful")
``
monomer.txt

@peastman
Copy link
Member

You first load the Amber14 force field, but then throw it out and overwrite it with AMOEBA 2018:

forcefield = ForceField('amber14/protein.ff14SB.xml')
forcefield = ForceField('amoeba2018.xml')

The OpenFF force field isn't compatible with AMOEBA.

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