"ssh:/git@developer.sourcefind.cn:2222/tsoc/openmm.git" did not exist on "035d5188a9e398b220fe5902030c2fcf8d896a44"
Commit d3150755 authored by Robert McGibbon's avatar Robert McGibbon
Browse files

Fix forcefield.py

parent 6cf90704
...@@ -104,12 +104,14 @@ class ForceField(object): ...@@ -104,12 +104,14 @@ class ForceField(object):
def __init__(self, *files): def __init__(self, *files):
"""Load one or more XML files and create a ForceField object based on them. """Load one or more XML files and create a ForceField object based on them.
Parameters: Parameters
- files (list) A list of XML files defining the force field. Each entry may ----------
be an absolute file path, a path relative to the current working files : list
directory, a path relative to this module's data subdirectory A list of XML files defining the force field. Each entry may
(for built in force fields), or an open file-like object with a be an absolute file path, a path relative to the current working
read() method from which the forcefield XML data can be loaded. directory, a path relative to this module's data subdirectory
(for built in force fields), or an open file-like object with a
read() method from which the forcefield XML data can be loaded.
""" """
self._atomTypes = {} self._atomTypes = {}
self._templates = {} self._templates = {}
...@@ -408,20 +410,36 @@ class ForceField(object): ...@@ -408,20 +410,36 @@ class ForceField(object):
constraints=None, rigidWater=True, removeCMMotion=True, hydrogenMass=None, **args): constraints=None, rigidWater=True, removeCMMotion=True, hydrogenMass=None, **args):
"""Construct an OpenMM System representing a Topology with this force field. """Construct an OpenMM System representing a Topology with this force field.
Parameters: Parameters
- topology (Topology) The Topology for which to create a System ----------
- nonbondedMethod (object=NoCutoff) The method to use for nonbonded interactions. Allowed values are topology : Topology
NoCutoff, CutoffNonPeriodic, CutoffPeriodic, Ewald, or PME. The Topology for which to create a System
- nonbondedCutoff (distance=1*nanometer) The cutoff distance to use for nonbonded interactions nonbondedMethod : object=NoCutoff
- constraints (object=None) Specifies which bonds and angles should be implemented with constraints. The method to use for nonbonded interactions. Allowed values are
Allowed values are None, HBonds, AllBonds, or HAngles. NoCutoff, CutoffNonPeriodic, CutoffPeriodic, Ewald, or PME.
- rigidWater (boolean=True) If true, water molecules will be fully rigid regardless of the value passed for the constraints argument nonbondedCutoff : distance=1*nanometer
- removeCMMotion (boolean=True) If true, a CMMotionRemover will be added to the System The cutoff distance to use for nonbonded interactions
- hydrogenMass (mass=None) The mass to use for hydrogen atoms bound to heavy atoms. Any mass added to a hydrogen is constraints : object=None
subtracted from the heavy atom to keep their total mass the same. Specifies which bonds and angles should be implemented with constraints.
- args Arbitrary additional keyword arguments may also be specified. This allows extra parameters to be specified that are specific to Allowed values are None, HBonds, AllBonds, or HAngles.
particular force fields. rigidWater : boolean=True
Returns: the newly created System If true, water molecules will be fully rigid regardless of the value
passed for the constraints argument
removeCMMotion : boolean=True
If true, a CMMotionRemover will be added to the System
hydrogenMass : mass=None
The mass to use for hydrogen atoms bound to heavy atoms. Any mass
added to a hydrogen is subtracted from the heavy atom to keep
their total mass the same.
args
Arbitrary additional keyword arguments may also be specified.
This allows extra parameters to be specified that are specific to
particular force fields.
Returns
-------
system
the newly created System
""" """
data = ForceField._SystemData() data = ForceField._SystemData()
data.atoms = list(topology.atoms()) data.atoms = list(topology.atoms())
...@@ -649,11 +667,18 @@ def _createResidueSignature(elements): ...@@ -649,11 +667,18 @@ def _createResidueSignature(elements):
def _matchResidue(res, template, bondedToAtom): def _matchResidue(res, template, bondedToAtom):
"""Determine whether a residue matches a template and return a list of corresponding atoms. """Determine whether a residue matches a template and return a list of corresponding atoms.
Parameters: Parameters
- res (Residue) The residue to check ----------
- template (_TemplateData) The template to compare it to res : Residue
- bondedToAtom (list) Enumerates which other atoms each atom is bonded to The residue to check
Returns: a list specifying which atom of the template each atom of the residue corresponds to, template : _TemplateData
The template to compare it to
bondedToAtom : list
Enumerates which other atoms each atom is bonded to
Returns
-------
a list specifying which atom of the template each atom of the residue corresponds to,
or None if it does not match the template or None if it does not match the template
""" """
atoms = list(res.atoms()) atoms = list(res.atoms())
......
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