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
e4e94dbc
Commit
e4e94dbc
authored
May 14, 2018
by
peastman
Browse files
Modeller handles insertion codes
parent
46ee62d9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
wrappers/python/simtk/openmm/app/modeller.py
wrappers/python/simtk/openmm/app/modeller.py
+10
-10
No files found.
wrappers/python/simtk/openmm/app/modeller.py
View file @
e4e94dbc
...
@@ -109,7 +109,7 @@ class Modeller(object):
...
@@ -109,7 +109,7 @@ class Modeller(object):
for
chain
in
self
.
topology
.
chains
():
for
chain
in
self
.
topology
.
chains
():
newChain
=
newTopology
.
addChain
(
chain
.
id
)
newChain
=
newTopology
.
addChain
(
chain
.
id
)
for
residue
in
chain
.
residues
():
for
residue
in
chain
.
residues
():
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
)
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
,
residue
.
insertionCode
)
for
atom
in
residue
.
atoms
():
for
atom
in
residue
.
atoms
():
newAtom
=
newTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
,
atom
.
id
)
newAtom
=
newTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
,
atom
.
id
)
newAtoms
[
atom
]
=
newAtom
newAtoms
[
atom
]
=
newAtom
...
@@ -123,7 +123,7 @@ class Modeller(object):
...
@@ -123,7 +123,7 @@ class Modeller(object):
for
chain
in
addTopology
.
chains
():
for
chain
in
addTopology
.
chains
():
newChain
=
newTopology
.
addChain
(
chain
.
id
)
newChain
=
newTopology
.
addChain
(
chain
.
id
)
for
residue
in
chain
.
residues
():
for
residue
in
chain
.
residues
():
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
)
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
,
residue
.
insertionCode
)
for
atom
in
residue
.
atoms
():
for
atom
in
residue
.
atoms
():
newAtom
=
newTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
,
atom
.
id
)
newAtom
=
newTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
,
atom
.
id
)
newAtoms
[
atom
]
=
newAtom
newAtoms
[
atom
]
=
newAtom
...
@@ -168,7 +168,7 @@ class Modeller(object):
...
@@ -168,7 +168,7 @@ class Modeller(object):
newChain
=
newTopology
.
addChain
(
chain
.
id
)
newChain
=
newTopology
.
addChain
(
chain
.
id
)
needNewChain
=
False
;
needNewChain
=
False
;
if
needNewResidue
:
if
needNewResidue
:
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
)
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
,
residue
.
insertionCode
)
needNewResidue
=
False
;
needNewResidue
=
False
;
newAtom
=
newTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
,
atom
.
id
)
newAtom
=
newTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
,
atom
.
id
)
newAtoms
[
atom
]
=
newAtom
newAtoms
[
atom
]
=
newAtom
...
@@ -210,7 +210,7 @@ class Modeller(object):
...
@@ -210,7 +210,7 @@ class Modeller(object):
for
chain
in
self
.
topology
.
chains
():
for
chain
in
self
.
topology
.
chains
():
newChain
=
newTopology
.
addChain
(
chain
.
id
)
newChain
=
newTopology
.
addChain
(
chain
.
id
)
for
residue
in
chain
.
residues
():
for
residue
in
chain
.
residues
():
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
)
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
,
residue
.
insertionCode
)
if
residue
.
name
==
"HOH"
:
if
residue
.
name
==
"HOH"
:
# Copy the oxygen and hydrogens
# Copy the oxygen and hydrogens
oatom
=
[
atom
for
atom
in
residue
.
atoms
()
if
atom
.
element
==
elem
.
oxygen
]
oatom
=
[
atom
for
atom
in
residue
.
atoms
()
if
atom
.
element
==
elem
.
oxygen
]
...
@@ -395,7 +395,7 @@ class Modeller(object):
...
@@ -395,7 +395,7 @@ class Modeller(object):
for
chain
in
self
.
topology
.
chains
():
for
chain
in
self
.
topology
.
chains
():
newChain
=
newTopology
.
addChain
(
chain
.
id
)
newChain
=
newTopology
.
addChain
(
chain
.
id
)
for
residue
in
chain
.
residues
():
for
residue
in
chain
.
residues
():
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
)
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
,
residue
.
insertionCode
)
for
atom
in
residue
.
atoms
():
for
atom
in
residue
.
atoms
():
newAtom
=
newTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
,
atom
.
id
)
newAtom
=
newTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
,
atom
.
id
)
newAtoms
[
atom
]
=
newAtom
newAtoms
[
atom
]
=
newAtom
...
@@ -691,7 +691,7 @@ class Modeller(object):
...
@@ -691,7 +691,7 @@ class Modeller(object):
for
chain
in
self
.
topology
.
chains
():
for
chain
in
self
.
topology
.
chains
():
newChain
=
newTopology
.
addChain
(
chain
.
id
)
newChain
=
newTopology
.
addChain
(
chain
.
id
)
for
residue
in
chain
.
residues
():
for
residue
in
chain
.
residues
():
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
)
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
,
residue
.
insertionCode
)
isNTerminal
=
(
residue
==
chain
.
_residues
[
0
])
isNTerminal
=
(
residue
==
chain
.
_residues
[
0
])
isCTerminal
=
(
residue
==
chain
.
_residues
[
-
1
])
isCTerminal
=
(
residue
==
chain
.
_residues
[
-
1
])
if
residue
.
name
in
Modeller
.
_residueHydrogens
:
if
residue
.
name
in
Modeller
.
_residueHydrogens
:
...
@@ -977,7 +977,7 @@ class Modeller(object):
...
@@ -977,7 +977,7 @@ class Modeller(object):
for
chain
in
self
.
topology
.
chains
():
for
chain
in
self
.
topology
.
chains
():
newChain
=
newTopology
.
addChain
(
chain
.
id
)
newChain
=
newTopology
.
addChain
(
chain
.
id
)
for
residue
in
chain
.
residues
():
for
residue
in
chain
.
residues
():
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
)
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
,
residue
.
id
,
residue
.
insertionCode
)
# Look for a matching template.
# Look for a matching template.
...
@@ -999,7 +999,7 @@ class Modeller(object):
...
@@ -999,7 +999,7 @@ class Modeller(object):
# extra points.
# extra points.
template
=
None
template
=
None
residueNoEP
=
Residue
(
residue
.
name
,
residue
.
index
,
residue
.
chain
,
residue
.
id
)
residueNoEP
=
Residue
(
residue
.
name
,
residue
.
index
,
residue
.
chain
,
residue
.
id
,
residue
.
insertionCode
)
residueNoEP
.
_atoms
=
[
atom
for
atom
in
residue
.
atoms
()
if
atom
.
element
is
not
None
]
residueNoEP
.
_atoms
=
[
atom
for
atom
in
residue
.
atoms
()
if
atom
.
element
is
not
None
]
if
signature
in
forcefield
.
_templateSignatures
:
if
signature
in
forcefield
.
_templateSignatures
:
for
t
in
forcefield
.
_templateSignatures
[
signature
]:
for
t
in
forcefield
.
_templateSignatures
[
signature
]:
...
@@ -1310,7 +1310,7 @@ class Modeller(object):
...
@@ -1310,7 +1310,7 @@ class Modeller(object):
# Remove the same number of residues from each leaf.
# Remove the same number of residues from each leaf.
skipFromLeaf
[
lipidLeaf
[
residue
]]
-=
1
skipFromLeaf
[
lipidLeaf
[
residue
]]
-=
1
else
:
else
:
newResidue
=
membraneTopology
.
addResidue
(
residue
.
name
,
lipidChain
,
residue
.
id
)
newResidue
=
membraneTopology
.
addResidue
(
residue
.
name
,
lipidChain
,
residue
.
id
,
residue
.
insertionCode
)
for
atom
in
residue
.
atoms
():
for
atom
in
residue
.
atoms
():
newAtom
=
membraneTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
,
atom
.
id
)
newAtom
=
membraneTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
,
atom
.
id
)
newAtoms
[
atom
]
=
newAtom
newAtoms
[
atom
]
=
newAtom
...
@@ -1322,7 +1322,7 @@ class Modeller(object):
...
@@ -1322,7 +1322,7 @@ class Modeller(object):
solventChain
=
membraneTopology
.
addChain
()
solventChain
=
membraneTopology
.
addChain
()
for
(
residue
,
pos
)
in
addedWater
:
for
(
residue
,
pos
)
in
addedWater
:
newResidue
=
membraneTopology
.
addResidue
(
residue
.
name
,
solventChain
,
residue
.
id
)
newResidue
=
membraneTopology
.
addResidue
(
residue
.
name
,
solventChain
,
residue
.
id
,
residue
.
insertionCode
)
for
atom
in
residue
.
atoms
():
for
atom
in
residue
.
atoms
():
newAtom
=
membraneTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
,
atom
.
id
)
newAtom
=
membraneTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
,
atom
.
id
)
newAtoms
[
atom
]
=
newAtom
newAtoms
[
atom
]
=
newAtom
...
...
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