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
cf80933e
Commit
cf80933e
authored
Nov 06, 2013
by
peastman
Browse files
Improved the geometry of hydroxyls when adding hydrogens
parent
563914a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
wrappers/python/simtk/openmm/app/modeller.py
wrappers/python/simtk/openmm/app/modeller.py
+13
-0
No files found.
wrappers/python/simtk/openmm/app/modeller.py
View file @
cf80933e
...
@@ -776,22 +776,35 @@ class Modeller(object):
...
@@ -776,22 +776,35 @@ class Modeller(object):
system
.
addForce
(
nonbonded
)
system
.
addForce
(
nonbonded
)
system
.
addForce
(
bonds
)
system
.
addForce
(
bonds
)
system
.
addForce
(
angles
)
system
.
addForce
(
angles
)
bondedTo
=
[]
for
atom
in
newTopology
.
atoms
():
for
atom
in
newTopology
.
atoms
():
nonbonded
.
addParticle
([])
nonbonded
.
addParticle
([])
if
atom
.
element
!=
elem
.
hydrogen
:
if
atom
.
element
!=
elem
.
hydrogen
:
system
.
addParticle
(
0.0
)
system
.
addParticle
(
0.0
)
else
:
else
:
system
.
addParticle
(
1.0
)
system
.
addParticle
(
1.0
)
bondedTo
.
append
([])
for
atom1
,
atom2
in
newTopology
.
bonds
():
for
atom1
,
atom2
in
newTopology
.
bonds
():
if
atom1
.
element
==
elem
.
hydrogen
or
atom2
.
element
==
elem
.
hydrogen
:
if
atom1
.
element
==
elem
.
hydrogen
or
atom2
.
element
==
elem
.
hydrogen
:
bonds
.
addBond
(
atom1
.
index
,
atom2
.
index
,
0.1
,
100000.0
)
bonds
.
addBond
(
atom1
.
index
,
atom2
.
index
,
0.1
,
100000.0
)
bondedTo
[
atom1
.
index
].
append
(
atom2
)
bondedTo
[
atom2
.
index
].
append
(
atom1
)
for
residue
in
newTopology
.
residues
():
for
residue
in
newTopology
.
residues
():
if
residue
.
name
==
'HOH'
:
if
residue
.
name
==
'HOH'
:
# Add an angle term to make the water geometry correct.
atoms
=
list
(
residue
.
atoms
())
atoms
=
list
(
residue
.
atoms
())
oindex
=
[
i
for
i
in
range
(
len
(
atoms
))
if
atoms
[
i
].
element
==
elem
.
oxygen
]
oindex
=
[
i
for
i
in
range
(
len
(
atoms
))
if
atoms
[
i
].
element
==
elem
.
oxygen
]
if
len
(
atoms
)
==
3
and
len
(
oindex
)
==
1
:
if
len
(
atoms
)
==
3
and
len
(
oindex
)
==
1
:
hindex
=
list
(
set
([
0
,
1
,
2
])
-
set
(
oindex
))
hindex
=
list
(
set
([
0
,
1
,
2
])
-
set
(
oindex
))
angles
.
addAngle
(
atoms
[
hindex
[
0
]].
index
,
atoms
[
oindex
[
0
]].
index
,
atoms
[
hindex
[
1
]].
index
,
1.824
,
836.8
)
angles
.
addAngle
(
atoms
[
hindex
[
0
]].
index
,
atoms
[
oindex
[
0
]].
index
,
atoms
[
hindex
[
1
]].
index
,
1.824
,
836.8
)
else
:
# Add angle terms for any hydroxyls.
for
atom
in
residue
.
atoms
():
index
=
atom
.
index
if
atom
.
element
==
elem
.
oxygen
and
len
(
bondedTo
[
index
])
==
2
and
elem
.
hydrogen
in
(
a
.
element
for
a
in
bondedTo
[
index
]):
angles
.
addAngle
(
bondedTo
[
index
][
0
].
index
,
index
,
bondedTo
[
index
][
1
].
index
,
1.894
,
460.24
)
if
platform
is
None
:
if
platform
is
None
:
context
=
Context
(
system
,
VerletIntegrator
(
0.0
))
context
=
Context
(
system
,
VerletIntegrator
(
0.0
))
...
...
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