"platforms/cuda/vscode:/vscode.git/clone" did not exist on "5387707dc04f0688eca52300ed616aeef9d503f5"
Commit d3150755 authored by Robert McGibbon's avatar Robert McGibbon
Browse files

Fix forcefield.py

parent 6cf90704
...@@ -104,8 +104,10 @@ class ForceField(object): ...@@ -104,8 +104,10 @@ 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 ----------
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 be an absolute file path, a path relative to the current working
directory, a path relative to this module's data subdirectory directory, a path relative to this module's data subdirectory
(for built in force fields), or an open file-like object with a (for built in force fields), or an open file-like object with a
...@@ -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
The Topology for which to create a System
nonbondedMethod : object=NoCutoff
The method to use for nonbonded interactions. Allowed values are
NoCutoff, CutoffNonPeriodic, CutoffPeriodic, Ewald, or PME. NoCutoff, CutoffNonPeriodic, CutoffPeriodic, Ewald, or PME.
- nonbondedCutoff (distance=1*nanometer) The cutoff distance to use for nonbonded interactions nonbondedCutoff : distance=1*nanometer
- constraints (object=None) Specifies which bonds and angles should be implemented with constraints. The cutoff distance to use for nonbonded interactions
constraints : object=None
Specifies which bonds and angles should be implemented with constraints.
Allowed values are None, HBonds, AllBonds, or HAngles. Allowed values are None, HBonds, AllBonds, or HAngles.
- rigidWater (boolean=True) If true, water molecules will be fully rigid regardless of the value passed for the constraints argument rigidWater : boolean=True
- removeCMMotion (boolean=True) If true, a CMMotionRemover will be added to the System If true, water molecules will be fully rigid regardless of the value
- hydrogenMass (mass=None) The mass to use for hydrogen atoms bound to heavy atoms. Any mass added to a hydrogen is passed for the constraints argument
subtracted from the heavy atom to keep their total mass the same. removeCMMotion : boolean=True
- args Arbitrary additional keyword arguments may also be specified. This allows extra parameters to be specified that are specific to 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. particular force fields.
Returns: the newly created System
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