Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
d3150755
"ssh:/git@developer.sourcefind.cn:2222/tsoc/openmm.git" did not exist on "035d5188a9e398b220fe5902030c2fcf8d896a44"
Commit
d3150755
authored
Nov 03, 2015
by
Robert McGibbon
Browse files
Fix forcefield.py
parent
6cf90704
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
25 deletions
+50
-25
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+50
-25
No files found.
wrappers/python/simtk/openmm/app/forcefield.py
View file @
d3150755
...
@@ -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
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment