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
c962c2dd
Commit
c962c2dd
authored
Jun 18, 2012
by
Peter Eastman
Browse files
Modeller.delete() will delete a chain or residue if all the residues/atoms it contains are deleted
parent
15a68e22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
wrappers/python/simtk/openmm/app/modeller.py
wrappers/python/simtk/openmm/app/modeller.py
+8
-2
No files found.
wrappers/python/simtk/openmm/app/modeller.py
View file @
c962c2dd
...
@@ -143,12 +143,18 @@ class Modeller(object):
...
@@ -143,12 +143,18 @@ class Modeller(object):
deleteSet
=
set
(
toDelete
)
deleteSet
=
set
(
toDelete
)
for
chain
in
self
.
topology
.
chains
():
for
chain
in
self
.
topology
.
chains
():
if
chain
not
in
deleteSet
:
if
chain
not
in
deleteSet
:
newChain
=
newTopology
.
addChain
()
ne
edNe
wChain
=
True
;
for
residue
in
chain
.
residues
():
for
residue
in
chain
.
residues
():
if
residue
not
in
deleteSet
:
if
residue
not
in
deleteSet
:
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
)
ne
edNe
wResidue
=
True
for
atom
in
residue
.
atoms
():
for
atom
in
residue
.
atoms
():
if
atom
not
in
deleteSet
:
if
atom
not
in
deleteSet
:
if
needNewChain
:
newChain
=
newTopology
.
addChain
()
needNewChain
=
False
;
if
needNewResidue
:
newResidue
=
newTopology
.
addResidue
(
residue
.
name
,
newChain
)
needNewResidue
=
False
;
newAtom
=
newTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
)
newAtom
=
newTopology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
)
newAtoms
[
atom
]
=
newAtom
newAtoms
[
atom
]
=
newAtom
newPositions
.
append
(
deepcopy
(
self
.
positions
[
atom
.
index
]))
newPositions
.
append
(
deepcopy
(
self
.
positions
[
atom
.
index
]))
...
...
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