"plugins/amoeba/vscode:/vscode.git/clone" did not exist on "9e66f0b1ec1fbc4d8dfe991dc67b6be1190d0f08"
Unverified Commit 0607d41c authored by John Chodera's avatar John Chodera Committed by GitHub
Browse files

Merge pull request #3084 from jchodera/update-docs

Update openforcefield namespace to new conda-forge namespace in User guide
parents be19e022 dabc249c
...@@ -817,10 +817,10 @@ Field Initiative small molecule force fields using the following example: ...@@ -817,10 +817,10 @@ Field Initiative small molecule force fields using the following example:
:: ::
# Create an openforcefield Molecule object for benzene from SMILES # Create an OpenFF Molecule object for benzene from SMILES
from openforcefield.topology import Molecule from openff.toolkit.topology import Molecule
molecule = Molecule.from_smiles('c1ccccc1') molecule = Molecule.from_smiles('c1ccccc1')
# Create the SMIRNOFF template generator with the most up to date Open Force Field Initiative force field # Create the SMIRNOFF template generator with the default installed force field (openff-1.0.0)
from openmmforcefields.generators import SMIRNOFFTemplateGenerator from openmmforcefields.generators import SMIRNOFFTemplateGenerator
smirnoff = SMIRNOFFTemplateGenerator(molecules=molecule) smirnoff = SMIRNOFFTemplateGenerator(molecules=molecule)
# Create an OpenMM ForceField object with AMBER ff14SB and TIP3P with compatible ions # Create an OpenMM ForceField object with AMBER ff14SB and TIP3P with compatible ions
...@@ -833,8 +833,8 @@ Alternatively, you can use the older `AMBER GAFF small molecule force field <htt ...@@ -833,8 +833,8 @@ Alternatively, you can use the older `AMBER GAFF small molecule force field <htt
:: ::
# Create an openforcefield Molecule object for benzene from SMILES # Create an OpenFF Molecule object for benzene from SMILES
from openforcefield.topology import Molecule from openff.toolkit.topology import Molecule
molecule = Molecule.from_smiles('c1ccccc1') molecule = Molecule.from_smiles('c1ccccc1')
# Create the GAFF template generator # Create the GAFF template generator
from openmmforcefields.generators import GAFFTemplateGenerator from openmmforcefields.generators import GAFFTemplateGenerator
...@@ -864,15 +864,16 @@ small molecule force field you want to use: ...@@ -864,15 +864,16 @@ small molecule force field you want to use:
:: ::
# Define the keyword arguments to feed to ForceField # Define the keyword arguments to feed to ForceField
from openmm import unit from openmm import unit, app
from openmm import app
forcefield_kwargs = { 'constraints' : app.HBonds, 'rigidWater' : True, 'removeCMMotion' : False, 'hydrogenMass' : 4*unit.amu } forcefield_kwargs = { 'constraints' : app.HBonds, 'rigidWater' : True, 'removeCMMotion' : False, 'hydrogenMass' : 4*unit.amu }
# Initialize a SystemGenerator using the Open Force Field Initiative 1.2.0 force field (openff-1.2.0) # Initialize a SystemGenerator using GAFF
from openmmforcefields.generators import SystemGenerator from openmmforcefields.generators import SystemGenerator
system_generator = SystemGenerator(forcefields=['amber/ff14SB.xml', 'amber/tip3p_standard.xml'], small_molecule_forcefield='openff-1.2.0', forcefield_kwargs=forcefield_kwargs, cache='db.json') system_generator = SystemGenerator(forcefields=['amber/ff14SB.xml', 'amber/tip3p_standard.xml'], small_molecule_forcefield='gaff-2.11', forcefield_kwargs=forcefield_kwargs, cache='db.json')
# Create an OpenMM System from an OpenMM Topology object and a list of openforcefield Molecule objects # Create an OpenMM System from an OpenMM Topology object
system = system_generator.create_system(openmm_topology)
# Alternatively, create an OpenMM System from an OpenMM Topology object and a list of OpenFF Molecule objects
molecules = Molecule.from_file('molecules.sdf', file_format='sdf') molecules = Molecule.from_file('molecules.sdf', file_format='sdf')
system = system_generator.create_system(topology, molecules=molecules) system = system_generator.create_system(openmm_topology, molecules=molecules)
The ``SystemGenerator`` will match any instances of the molecules found in ``molecules.sdf`` to those that appear in ``topology``. The ``SystemGenerator`` will match any instances of the molecules found in ``molecules.sdf`` to those that appear in ``topology``.
Note that the protonation and tautomeric states must match exactly between the ``molecules`` read and those appearing in the Topology. Note that the protonation and tautomeric states must match exactly between the ``molecules`` read and those appearing in the Topology.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment