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
87538363
Commit
87538363
authored
May 28, 2014
by
Jason Swails
Browse files
Add units back to getBoxBetaAndDimensions...
parent
7f06a313
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
wrappers/python/simtk/openmm/app/amberprmtopfile.py
wrappers/python/simtk/openmm/app/amberprmtopfile.py
+1
-2
wrappers/python/simtk/openmm/app/internal/amber_file_parser.py
...ers/python/simtk/openmm/app/internal/amber_file_parser.py
+10
-4
No files found.
wrappers/python/simtk/openmm/app/amberprmtopfile.py
View file @
87538363
...
@@ -141,8 +141,7 @@ class AmberPrmtopFile(object):
...
@@ -141,8 +141,7 @@ class AmberPrmtopFile(object):
# Set the periodic box size.
# Set the periodic box size.
if
prmtop
.
getIfBox
():
if
prmtop
.
getIfBox
():
conv
=
(
1.0
*
unit
.
angstrom
).
value_in_unit
(
unit
.
nanometer
)
top
.
setUnitCellDimensions
(
tuple
(
x
.
value_in_unit
(
unit
.
nanometer
)
for
x
in
prmtop
.
getBoxBetaAndDimensions
()[
1
:
4
])
*
unit
.
nanometer
)
top
.
setUnitCellDimensions
(
tuple
(
x
*
conv
for
x
in
prmtop
.
getBoxBetaAndDimensions
()[
1
:
4
])
*
unit
.
nanometer
)
def
createSystem
(
self
,
nonbondedMethod
=
ff
.
NoCutoff
,
nonbondedCutoff
=
1.0
*
unit
.
nanometer
,
def
createSystem
(
self
,
nonbondedMethod
=
ff
.
NoCutoff
,
nonbondedCutoff
=
1.0
*
unit
.
nanometer
,
constraints
=
None
,
rigidWater
=
True
,
implicitSolvent
=
None
,
constraints
=
None
,
rigidWater
=
True
,
implicitSolvent
=
None
,
...
...
wrappers/python/simtk/openmm/app/internal/amber_file_parser.py
View file @
87538363
...
@@ -550,7 +550,10 @@ class PrmtopLoader(object):
...
@@ -550,7 +550,10 @@ class PrmtopLoader(object):
x
=
float
(
self
.
_raw_data
[
"BOX_DIMENSIONS"
][
1
])
x
=
float
(
self
.
_raw_data
[
"BOX_DIMENSIONS"
][
1
])
y
=
float
(
self
.
_raw_data
[
"BOX_DIMENSIONS"
][
2
])
y
=
float
(
self
.
_raw_data
[
"BOX_DIMENSIONS"
][
2
])
z
=
float
(
self
.
_raw_data
[
"BOX_DIMENSIONS"
][
3
])
z
=
float
(
self
.
_raw_data
[
"BOX_DIMENSIONS"
][
3
])
return
(
beta
,
x
,
y
,
z
)
return
(
units
.
Quantity
(
beta
,
units
.
degree
),
units
.
Quantity
(
x
,
units
.
angstrom
),
units
.
Quantity
(
y
,
units
.
angstrom
),
units
.
Quantity
(
z
,
units
.
angstrom
))
@
property
@
property
def
has_scee_scnb
(
self
):
def
has_scee_scnb
(
self
):
...
@@ -738,6 +741,10 @@ def readAmberSystem(prmtop_filename=None, prmtop_loader=None, shake=None, gbmode
...
@@ -738,6 +741,10 @@ def readAmberSystem(prmtop_filename=None, prmtop_loader=None, shake=None, gbmode
# System is periodic.
# System is periodic.
# Set periodic box vectors for periodic system
# Set periodic box vectors for periodic system
(
boxBeta
,
boxX
,
boxY
,
boxZ
)
=
prmtop
.
getBoxBetaAndDimensions
()
(
boxBeta
,
boxX
,
boxY
,
boxZ
)
=
prmtop
.
getBoxBetaAndDimensions
()
boxBeta
=
boxBeta
.
value_in_unit
(
units
.
degrees
)
boxX
=
boxX
.
value_in_unit
(
units
.
angstroms
)
boxY
=
boxY
.
value_in_unit
(
units
.
angstroms
)
boxZ
=
boxZ
.
value_in_unit
(
units
.
angstroms
)
tmp
=
[[
0.0
,
0.0
,
0.0
],[
0.0
,
0.0
,
0.0
],[
0.0
,
0.0
,
0.0
]]
tmp
=
[[
0.0
,
0.0
,
0.0
],[
0.0
,
0.0
,
0.0
],[
0.0
,
0.0
,
0.0
]]
_box_vectors_from_lengths_angles
([
boxX
,
boxY
,
boxZ
],
_box_vectors_from_lengths_angles
([
boxX
,
boxY
,
boxZ
],
[
boxBeta
,
boxBeta
,
boxBeta
],
[
boxBeta
,
boxBeta
,
boxBeta
],
...
@@ -1264,14 +1271,13 @@ def readAmberCoordinates(filename, asNumpy=False):
...
@@ -1264,14 +1271,13 @@ def readAmberCoordinates(filename, asNumpy=False):
>>> directory = os.path.join(os.getenv('YANK_INSTALL_DIR'), 'test', 'systems', 'alanine-dipeptide-gbsa')
>>> directory = os.path.join(os.getenv('YANK_INSTALL_DIR'), 'test', 'systems', 'alanine-dipeptide-gbsa')
>>> crd_filename = os.path.join(directory, 'alanine-dipeptide.inpcrd')
>>> crd_filename = os.path.join(directory, 'alanine-dipeptide.inpcrd')
>>> coordinates = readAmberCoordinates(crd_filename)
>>> coordinates
, velocities, box_vectors
= readAmberCoordinates(crd_filename)
Read coordinates in solvent.
Read coordinates in solvent.
>>> directory = os.path.join(os.getenv('YANK_INSTALL_DIR'), 'test', 'systems', 'alanine-dipeptide-explicit')
>>> directory = os.path.join(os.getenv('YANK_INSTALL_DIR'), 'test', 'systems', 'alanine-dipeptide-explicit')
>>> crd_filename = os.path.join(directory, 'alanine-dipeptide.inpcrd')
>>> crd_filename = os.path.join(directory, 'alanine-dipeptide.inpcrd')
>>> [coordinates, box_vectors] = readAmberCoordinates(crd_filename)
>>> coordinates, velocities, box_vectors = readAmberCoordinates(crd_filename)
"""
"""
try
:
try
:
...
...
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