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
Show 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):
...
@@ -36,3 +36,6 @@ class CmapError(CharmmError):
class
BondError
(
CharmmError
):
class
BondError
(
CharmmError
):
""" Prevent an atom from bonding to itself """
""" 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,
...
@@ -12,8 +12,8 @@ from simtk.openmm.app.charmm.topologyobjects import (AtomType, BondType,
AngleType
,
DihedralType
,
ImproperType
,
CmapType
,
AngleType
,
DihedralType
,
ImproperType
,
CmapType
,
UreyBradleyType
,
NoUreyBradley
)
UreyBradleyType
,
NoUreyBradley
)
from
simtk.openmm.app.charmm.exceptions
import
CharmmFileError
from
simtk.openmm.app.charmm.exceptions
import
CharmmFileError
from
simtk.openmm.element
import
Element
,
get_by_symbol
from
simtk.openmm.
app.
element
import
Element
,
get_by_symbol
from
simtk.unit
s
import
dalton
from
simtk.unit
import
dalton
s
import
warnings
import
warnings
class
ParameterSet
(
object
):
class
ParameterSet
(
object
):
...
@@ -512,7 +512,7 @@ def element_by_mass(mass):
...
@@ -512,7 +512,7 @@ def element_by_mass(mass):
for
key
in
Element
.
_elements_by_atomic_number
:
for
key
in
Element
.
_elements_by_atomic_number
:
element
=
Element
.
_elements_by_atomic_number
[
key
]
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
:
if
massdiff
<
diff
:
best_guess
=
element
best_guess
=
element
diff
=
massdiff
diff
=
massdiff
...
...
wrappers/python/simtk/openmm/app/charmm/psf.py
View file @
489551d6
...
@@ -9,14 +9,8 @@ Date: April 9, 2014
...
@@ -9,14 +9,8 @@ Date: April 9, 2014
from
__future__
import
division
from
__future__
import
division
from
functools
import
wraps
from
functools
import
wraps
from
simtk.openmm.app.charmm._charmmfile
import
CharmmFile
from
math
import
pi
,
cos
,
sin
,
sqrt
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
os
import
os
import
warnings
import
simtk.openmm
as
mm
import
simtk.openmm
as
mm
from
simtk.openmm.vec3
import
Vec3
from
simtk.openmm.vec3
import
Vec3
import
simtk.unit
as
u
import
simtk.unit
as
u
...
@@ -24,6 +18,14 @@ from simtk.openmm.app import (forcefield as ff, Topology, element)
...
@@ -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.amberprmtopfile
import
HCT
,
OBC1
,
OBC2
,
GBn
,
GBn2
from
simtk.openmm.app.internal.customgbforces
import
(
GBSAHCTForce
,
from
simtk.openmm.app.internal.customgbforces
import
(
GBSAHCTForce
,
GBSAOBC1Force
,
GBSAOBC2Force
,
GBSAGBnForce
,
GBSAGBn2Force
)
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
TINY
=
1e-8
WATNAMES
=
(
'WAT'
,
'HOH'
,
'TIP3'
,
'TIP4'
,
'TIP5'
,
'SPCE'
,
'SPC'
)
WATNAMES
=
(
'WAT'
,
'HOH'
,
'TIP3'
,
'TIP4'
,
'TIP5'
,
'SPCE'
,
'SPC'
)
...
@@ -778,8 +780,8 @@ class ProteinStructure(object):
...
@@ -778,8 +780,8 @@ class ProteinStructure(object):
if
atom
.
residue
.
idx
!=
last_residue
:
if
atom
.
residue
.
idx
!=
last_residue
:
last_residue
=
atom
.
residue
.
idx
last_residue
=
atom
.
residue
.
idx
residue
=
topology
.
addResidue
(
atom
.
residue
.
resname
,
chain
)
residue
=
topology
.
addResidue
(
atom
.
residue
.
resname
,
chain
)
element_name
=
element_by_mass
(
atom
.
mass
)
atomic_num
=
atom
.
type
.
atomic_number
elem
=
element
.
get_by_symbol
(
element_name
)
elem
=
element
.
Element
.
getByAtomicNumber
(
atomic_num
)
topology
.
addAtom
(
atom
.
name
,
elem
,
residue
)
topology
.
addAtom
(
atom
.
name
,
elem
,
residue
)
# Add all of the bonds
# Add all of the bonds
...
@@ -1338,8 +1340,9 @@ class ProteinStructure(object):
...
@@ -1338,8 +1340,9 @@ class ProteinStructure(object):
try
:
try
:
return
self
.
_system
return
self
.
_system
except
AttributeError
:
except
AttributeError
:
raise
APIError
(
'You must initialize the system with createSystem '
raise
AttributeError
(
'You must initialize the system with '
'before accessing the cached object.'
)
'createSystem before accessing the cached '
'object.'
)
@
property
@
property
def
positions
(
self
):
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