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
8c8dbed1
Commit
8c8dbed1
authored
Mar 04, 2019
by
João Rodrigues
Browse files
Fix squaring of units. Ensure addSolvent passes the right data structure to addIons
parent
b9936fb9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
wrappers/python/simtk/openmm/app/modeller.py
wrappers/python/simtk/openmm/app/modeller.py
+13
-3
No files found.
wrappers/python/simtk/openmm/app/modeller.py
View file @
8c8dbed1
...
...
@@ -357,7 +357,7 @@ class Modeller(object):
n_trials
=
10
if
n_trials
==
0
:
raise
ValueError
(
'Could not add more than {} ions to the system'
.
format
(
a
ddedIons
))
raise
ValueError
(
'Could not add more than {} ions to the system'
.
format
(
numA
ddedIons
))
# Replace waters/ions in the topology
modeller
.
delete
(
toReplace
)
...
...
@@ -366,7 +366,7 @@ class Modeller(object):
element
=
(
positiveElement
if
i
<
numPositive
else
negativeElement
)
newResidue
=
modeller
.
topology
.
addResidue
(
element
.
symbol
.
upper
(),
ionChain
)
modeller
.
topology
.
addAtom
(
element
.
symbol
,
element
,
newResidue
)
modeller
.
positions
.
append
(
replaceableMols
[
water
]
*
nanometer
)
modeller
.
positions
.
append
(
replaceableMols
[
water
])
# Update topology/positions
self
.
topology
=
modeller
.
topology
...
...
@@ -622,8 +622,18 @@ class Modeller(object):
self
.
topology
=
newTopology
self
.
positions
=
newPositions
# Convert water list to dictionary (residue:position)
waterPos
=
{}
_oxygen
=
elem
.
oxygen
for
chain
in
newTopology
.
chains
():
for
residue
in
chain
.
residues
():
if
residue
.
name
==
'HOH'
:
for
atom
in
residue
.
atoms
():
if
atom
.
element
==
_oxygen
:
waterPos
[
residue
]
=
newPositions
[
atom
.
index
]
# Add ions to neutralize the system.
self
.
_addIons
(
forcefield
,
addedW
aters
,
positiveIon
=
positiveIon
,
negativeIon
=
negativeIon
,
ionicStrength
=
ionicStrength
,
neutralize
=
neutralize
)
self
.
_addIons
(
forcefield
,
w
ater
Po
s
,
positiveIon
=
positiveIon
,
negativeIon
=
negativeIon
,
ionicStrength
=
ionicStrength
,
neutralize
=
neutralize
)
class
_ResidueData
:
"""Inner class used to encapsulate data about the hydrogens for a residue."""
...
...
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