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
368f4dff
Commit
368f4dff
authored
Dec 10, 2015
by
Rafal P. Wiewiora
Browse files
revert changes to only not add bonds between metals and standard residues
parent
d44805d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
wrappers/python/simtk/openmm/app/pdbfile.py
wrappers/python/simtk/openmm/app/pdbfile.py
+8
-12
No files found.
wrappers/python/simtk/openmm/app/pdbfile.py
View file @
368f4dff
...
@@ -59,7 +59,7 @@ class PDBFile(object):
...
@@ -59,7 +59,7 @@ class PDBFile(object):
_residueNameReplacements
=
{}
_residueNameReplacements
=
{}
_atomNameReplacements
=
{}
_atomNameReplacements
=
{}
def
__init__
(
self
,
file
,
removeBondsToMetals
=
False
):
def
__init__
(
self
,
file
):
"""Load a PDB file.
"""Load a PDB file.
The atom positions and Topology can be retrieved by calling getPositions() and getTopology().
The atom positions and Topology can be retrieved by calling getPositions() and getTopology().
...
@@ -68,9 +68,6 @@ class PDBFile(object):
...
@@ -68,9 +68,6 @@ class PDBFile(object):
----------
----------
file : string
file : string
the name of the file to load
the name of the file to load
removeBondsToMetals : bool
if True, those inter-residue CONECT bonds that indicate coordination to metals
(cf. metalc connectivity in mmCIF/PDBx) are not added to the topology
"""
"""
metalElements
=
[
'Al'
,
'As'
,
'Ba'
,
'Ca'
,
'Cd'
,
'Ce'
,
'Co'
,
'Cs'
,
'Cu'
,
'Dy'
,
'Fe'
,
'Gd'
,
'Hg'
,
'Ho'
,
'In'
,
'Ir'
,
'K'
,
'Li'
,
'Mg'
,
metalElements
=
[
'Al'
,
'As'
,
'Ba'
,
'Ca'
,
'Cd'
,
'Ce'
,
'Co'
,
'Cs'
,
'Cu'
,
'Dy'
,
'Fe'
,
'Gd'
,
'Hg'
,
'Ho'
,
'In'
,
'Ir'
,
'K'
,
'Li'
,
'Mg'
,
...
@@ -158,21 +155,20 @@ class PDBFile(object):
...
@@ -158,21 +155,20 @@ class PDBFile(object):
self
.
topology
.
createDisulfideBonds
(
self
.
positions
)
self
.
topology
.
createDisulfideBonds
(
self
.
positions
)
self
.
_numpyPositions
=
None
self
.
_numpyPositions
=
None
# Add bonds based on CONECT records.
# Add bonds based on CONECT records.
Bonds between metals of element specified in metalElements and standard residues are not added.
connectBonds
=
[]
connectBonds
=
[]
for
connect
in
pdb
.
models
[
-
1
].
connects
:
for
connect
in
pdb
.
models
[
-
1
].
connects
:
i
=
connect
[
0
]
i
=
connect
[
0
]
for
j
in
connect
[
1
:]:
for
j
in
connect
[
1
:]:
if
i
in
atomByNumber
and
j
in
atomByNumber
and
not
removeBondsToMetals
:
if
i
in
atomByNumber
and
j
in
atomByNumber
:
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
elif
i
in
atomByNumber
and
j
in
atomByNumber
and
removeBondsToMetals
:
if
atomByNumber
[
i
].
element
is
not
None
and
atomByNumber
[
j
].
element
is
not
None
:
if
atomByNumber
[
i
].
element
is
not
None
and
atomByNumber
[
j
].
element
is
not
None
:
if
atomByNumber
[
i
].
element
.
symbol
in
metalElements
or
atomByNumber
[
j
].
element
.
symbol
in
metalElements
:
if
atomByNumber
[
i
].
element
.
symbol
not
in
metalElements
and
atomByNumber
[
j
].
element
.
symbol
not
in
metalElements
:
if
atomByNumber
[
i
].
residue
==
atomByNumber
[
j
].
residue
:
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
elif
atomByNumber
[
i
].
element
.
symbol
in
metalElements
and
atomByNumber
[
j
].
residue
.
name
not
in
top
.
_standardBonds
:
else
:
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
elif
atomByNumber
[
j
].
element
.
symbol
in
metalElements
and
atomByNumber
[
i
].
residue
.
name
not
in
top
.
_standardBonds
:
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
else
:
else
:
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
if
len
(
connectBonds
)
>
0
:
if
len
(
connectBonds
)
>
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