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
17725b68
Commit
17725b68
authored
Dec 04, 2018
by
peastman
Browse files
Improved logic for matching multi-residue patches
parent
e8eb3fba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+23
-6
No files found.
wrappers/python/simtk/openmm/app/forcefield.py
View file @
17725b68
...
@@ -1522,12 +1522,29 @@ def _applyMultiResiduePatch(data, clusters, patch, candidateTemplates, selectedT
...
@@ -1522,12 +1522,29 @@ def _applyMultiResiduePatch(data, clusters, patch, candidateTemplates, selectedT
else
:
else
:
residueMatches
.
append
(
matches
)
residueMatches
.
append
(
matches
)
if
residueMatches
is
not
None
:
if
residueMatches
is
not
None
:
# We successfully matched the template to the residues. Record the parameters.
# Each residue individually matches. Now make sure they're bonded in the correct way.
for
i
in
range
(
patch
.
numResidues
):
bondsMatch
=
True
data
.
recordMatchedAtomParameters
(
residues
[
i
],
patchedTemplates
[
i
],
residueMatches
[
i
])
for
a1
,
a2
in
patch
.
addedBonds
:
newlyMatchedClusters
.
append
(
cluster
)
res1
=
a1
.
residue
break
res2
=
a2
.
residue
if
res1
!=
res2
:
# The patch adds a bond between residues. Make sure that bond exists.
atoms1
=
patchedTemplates
[
res1
].
atoms
atoms2
=
patchedTemplates
[
res2
].
atoms
index1
=
next
(
i
for
i
in
range
(
len
(
atoms1
))
if
atoms1
[
residueMatches
[
res1
][
i
]].
name
==
a1
.
name
)
index2
=
next
(
i
for
i
in
range
(
len
(
atoms2
))
if
atoms2
[
residueMatches
[
res2
][
i
]].
name
==
a2
.
name
)
atom1
=
list
(
residues
[
res1
].
atoms
())[
index1
]
atom2
=
list
(
residues
[
res2
].
atoms
())[
index2
]
bondsMatch
&=
atom2
.
index
in
bondedToAtom
[
atom1
.
index
]
if
bondsMatch
:
# We successfully matched the template to the residues. Record the parameters.
for
i
in
range
(
patch
.
numResidues
):
data
.
recordMatchedAtomParameters
(
residues
[
i
],
patchedTemplates
[
i
],
residueMatches
[
i
])
newlyMatchedClusters
.
append
(
cluster
)
break
# Record which clusters were successfully matched.
# Record which clusters were successfully matched.
...
...
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