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
489551d6
Commit
489551d6
authored
Apr 09, 2014
by
Jason Swails
Browse files
Fix remaining bugs with CHARMM integration.
parent
f5df12e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
14 deletions
+20
-14
wrappers/python/simtk/openmm/app/charmm/exceptions.py
wrappers/python/simtk/openmm/app/charmm/exceptions.py
+3
-0
wrappers/python/simtk/openmm/app/charmm/parameters.py
wrappers/python/simtk/openmm/app/charmm/parameters.py
+3
-3
wrappers/python/simtk/openmm/app/charmm/psf.py
wrappers/python/simtk/openmm/app/charmm/psf.py
+14
-11
No files found.
wrappers/python/simtk/openmm/app/charmm/exceptions.py
View file @
489551d6
...
...
@@ -36,3 +36,6 @@ class CmapError(CharmmError):
class
BondError
(
CharmmError
):
""" Prevent an atom from bonding to itself """
class
MoleculeError
(
CharmmError
):
""" For (impossibly) messed up connectivity """
wrappers/python/simtk/openmm/app/charmm/parameters.py
View file @
489551d6
...
...
@@ -12,8 +12,8 @@ from simtk.openmm.app.charmm.topologyobjects import (AtomType, BondType,
AngleType
,
DihedralType
,
ImproperType
,
CmapType
,
UreyBradleyType
,
NoUreyBradley
)
from
simtk.openmm.app.charmm.exceptions
import
CharmmFileError
from
simtk.openmm.element
import
Element
,
get_by_symbol
from
simtk.unit
s
import
dalton
from
simtk.openmm.
app.
element
import
Element
,
get_by_symbol
from
simtk.unit
import
dalton
s
import
warnings
class
ParameterSet
(
object
):
...
...
@@ -512,7 +512,7 @@ def element_by_mass(mass):
for
key
in
Element
.
_elements_by_atomic_number
:
element
=
Element
.
_elements_by_atomic_number
[
key
]
massdiff
=
abs
(
element
.
mass
.
value_in_unit
(
u
.
daltons
)
-
mass
)
massdiff
=
abs
(
element
.
mass
.
value_in_unit
(
daltons
)
-
mass
)
if
massdiff
<
diff
:
best_guess
=
element
diff
=
massdiff
...
...
wrappers/python/simtk/openmm/app/charmm/psf.py
View file @
489551d6
...
...
@@ -9,14 +9,8 @@ Date: April 9, 2014
from
__future__
import
division
from
functools
import
wraps
from
simtk.openmm.app.charmm._charmmfile
import
CharmmFile
from
simtk.openmm.app.charmm.topologyobjects
import
(
ResidueList
,
AtomList
,
TrackedList
,
Bond
,
Angle
,
Dihedral
,
Improper
,
AcceptorDonor
,
Group
,
Cmap
,
UreyBradley
,
NoUreyBradley
)
from
simtk.openmm.app.charmm.exceptions
import
(
CharmmPSFError
,
MoleculeError
,
CharmmPSFWarning
,
MissingParameter
)
from
math
import
pi
,
cos
,
sin
,
sqrt
import
os
import
warnings
import
simtk.openmm
as
mm
from
simtk.openmm.vec3
import
Vec3
import
simtk.unit
as
u
...
...
@@ -24,6 +18,14 @@ from simtk.openmm.app import (forcefield as ff, Topology, element)
from
simtk.openmm.app.amberprmtopfile
import
HCT
,
OBC1
,
OBC2
,
GBn
,
GBn2
from
simtk.openmm.app.internal.customgbforces
import
(
GBSAHCTForce
,
GBSAOBC1Force
,
GBSAOBC2Force
,
GBSAGBnForce
,
GBSAGBn2Force
)
# CHARMM imports
from
simtk.openmm.app.charmm._charmmfile
import
CharmmFile
from
simtk.openmm.app.charmm.topologyobjects
import
(
ResidueList
,
AtomList
,
TrackedList
,
Bond
,
Angle
,
Dihedral
,
Improper
,
AcceptorDonor
,
Group
,
Cmap
,
UreyBradley
,
NoUreyBradley
)
from
simtk.openmm.app.charmm.exceptions
import
(
CharmmPSFError
,
MoleculeError
,
CharmmPSFWarning
,
MissingParameter
)
import
warnings
TINY
=
1e-8
WATNAMES
=
(
'WAT'
,
'HOH'
,
'TIP3'
,
'TIP4'
,
'TIP5'
,
'SPCE'
,
'SPC'
)
...
...
@@ -778,8 +780,8 @@ class ProteinStructure(object):
if
atom
.
residue
.
idx
!=
last_residue
:
last_residue
=
atom
.
residue
.
idx
residue
=
topology
.
addResidue
(
atom
.
residue
.
resname
,
chain
)
element_name
=
element_by_mass
(
atom
.
mass
)
elem
=
element
.
get_by_symbol
(
element_name
)
atomic_num
=
atom
.
type
.
atomic_number
elem
=
element
.
Element
.
getByAtomicNumber
(
atomic_num
)
topology
.
addAtom
(
atom
.
name
,
elem
,
residue
)
# Add all of the bonds
...
...
@@ -1338,8 +1340,9 @@ class ProteinStructure(object):
try
:
return
self
.
_system
except
AttributeError
:
raise
APIError
(
'You must initialize the system with createSystem '
'before accessing the cached object.'
)
raise
AttributeError
(
'You must initialize the system with '
'createSystem before accessing the cached '
'object.'
)
@
property
def
positions
(
self
):
...
...
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