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
2ca749a1
Unverified
Commit
2ca749a1
authored
Dec 03, 2019
by
peastman
Committed by
GitHub
Dec 03, 2019
Browse files
Merge pull request #2490 from mcs95/ignore_external_bonds
Signature modification to Modeller.addExtraParticles()
parents
75c1fcb6
17dbc362
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
wrappers/python/simtk/openmm/app/modeller.py
wrappers/python/simtk/openmm/app/modeller.py
+7
-3
No files found.
wrappers/python/simtk/openmm/app/modeller.py
View file @
2ca749a1
...
@@ -1004,7 +1004,7 @@ class Modeller(object):
...
@@ -1004,7 +1004,7 @@ class Modeller(object):
del
context
del
context
return
actualVariants
return
actualVariants
def
addExtraParticles
(
self
,
forcefield
):
def
addExtraParticles
(
self
,
forcefield
,
ignoreExternalBonds
=
False
):
"""Add missing extra particles to the model that are required by a force
"""Add missing extra particles to the model that are required by a force
field.
field.
...
@@ -1023,6 +1023,10 @@ class Modeller(object):
...
@@ -1023,6 +1023,10 @@ class Modeller(object):
----------
----------
forcefield : ForceField
forcefield : ForceField
the ForceField defining what extra particles should be present
the ForceField defining what extra particles should be present
ignoreExternalBonds : boolean=False
If true, ignore external bonds when matching residues to templates.
This is useful when the Topology represents one piece of a larger
molecule, so chains are not terminated properly.
"""
"""
# Create copies of all residue templates that have had all extra points removed.
# Create copies of all residue templates that have had all extra points removed.
...
@@ -1090,7 +1094,7 @@ class Modeller(object):
...
@@ -1090,7 +1094,7 @@ class Modeller(object):
signature
=
_createResidueSignature
([
atom
.
element
for
atom
in
residue
.
atoms
()])
signature
=
_createResidueSignature
([
atom
.
element
for
atom
in
residue
.
atoms
()])
if
signature
in
forcefield
.
_templateSignatures
:
if
signature
in
forcefield
.
_templateSignatures
:
for
t
in
forcefield
.
_templateSignatures
[
signature
]:
for
t
in
forcefield
.
_templateSignatures
[
signature
]:
if
compiled
.
matchResidueToTemplate
(
residue
,
t
,
bondedToAtom
,
False
)
is
not
None
:
if
compiled
.
matchResidueToTemplate
(
residue
,
t
,
bondedToAtom
,
ignoreExternalBonds
)
is
not
None
:
matchFound
=
True
matchFound
=
True
if
matchFound
:
if
matchFound
:
# Just copy the residue over.
# Just copy the residue over.
...
@@ -1109,7 +1113,7 @@ class Modeller(object):
...
@@ -1109,7 +1113,7 @@ class Modeller(object):
if
signature
in
forcefield
.
_templateSignatures
:
if
signature
in
forcefield
.
_templateSignatures
:
for
t
in
forcefield
.
_templateSignatures
[
signature
]:
for
t
in
forcefield
.
_templateSignatures
[
signature
]:
if
t
in
templatesNoEP
:
if
t
in
templatesNoEP
:
matches
=
compiled
.
matchResidueToTemplate
(
residueNoEP
,
templatesNoEP
[
t
],
bondedToAtomNoEP
,
False
)
matches
=
compiled
.
matchResidueToTemplate
(
residueNoEP
,
templatesNoEP
[
t
],
bondedToAtomNoEP
,
ignoreExternalBonds
)
if
matches
is
not
None
:
if
matches
is
not
None
:
template
=
t
;
template
=
t
;
# Record the corresponding atoms.
# Record the corresponding atoms.
...
...
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