Closed jaketanderson closed 1 year ago
Does the order here matter?
forcefield.registerTemplateGenerator(gaff.generator)
gaff.generate_residue_template(molecule)
Does the order here matter?
forcefield.registerTemplateGenerator(gaff.generator) gaff.generate_residue_template(molecule)
Unfortunately swapping these two lines does not fix the issue. The README example for GAFF actually does not use the first line at all, but I added it to see if it works as a fix. It does not seem to.
You probably don't need the PDB file for system generation at all; you can create the (OpenMM)` topology just with OpenFF objects, and then later on set the positions on the context.
This code runs without error, I figure it can be extended to run a simulation. I forget if the system needs residue information or the topology, in which case that might still need to be set.
In [3]: from openmm.app import ForceField
...: from openff.toolkit import Molecule, Topology
...:
...: molecule = Molecule.from_smiles("C[N+](C)(C)[O-]")
...: water = Molecule.from_smiles("O")
...:
...: from openmmforcefields.generators import GAFFTemplateGenerator
...:
...: gaff = GAFFTemplateGenerator(molecules=molecule)
...:
...: forcefield = ForceField(
...: "amber/tip3pfb_standard.xml", "amber/tip3pfb_HFE_multivalent.xml"
...: )
...: forcefield.registerTemplateGenerator(gaff.generator)
...: gaff.generate_residue_template(molecule)
...:
...: topology = Topology.from_molecules([water, water, molecule]) # add more waters as you wish
...: sys = forcefield.createSystem(topology.to_openmm())
Thanks very much @mattwthompson! I've got it up and running with your suggestion of making the topology in OpenFF and combining it with the PDB's positions.
Hi, I'm trying to use
openmmforcefields
to simulate a mixture of (GAFF-parameterized) TMAO and tip3p waters. I've tried following the steps on the README but I cannot get rid of "ValueError: No template found for residue 11 (TMA)" errors. I've tried keeping the TMAO residue as UNL (the default using openbabel), I've tried creating the openff molecule from an SDF file, and I've ensured that the CONECT information is in all my PDB files before using Packmol to create the mixture PDB. I'm at a loss here and would really appreciate some guidance!Simulation:
Preparation:
packmol.input
water.pdb
TMAO.pdb
mixture.pdb