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
10b9e98a
"platforms/cuda/vscode:/vscode.git/clone" did not exist on "c2cb6421e113f0a0c082018940ce56c0c272f40e"
Commit
10b9e98a
authored
Dec 08, 2015
by
Rafal P. Wiewiora
Browse files
PDBFile change metal bond behavior to that of PDBxFile
parent
4d32047c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
wrappers/python/simtk/openmm/app/pdbfile.py
wrappers/python/simtk/openmm/app/pdbfile.py
+13
-2
No files found.
wrappers/python/simtk/openmm/app/pdbfile.py
View file @
10b9e98a
...
@@ -69,6 +69,10 @@ class PDBFile(object):
...
@@ -69,6 +69,10 @@ class PDBFile(object):
file : string
file : string
the name of the file to load
the name of the file to load
"""
"""
metalElements
=
[
'Al'
,
'As'
,
'Ba'
,
'Ca'
,
'Cd'
,
'Ce'
,
'Co'
,
'Cs'
,
'Cu'
,
'Dy'
,
'Fe'
,
'Gd'
,
'Hg'
,
'Ho'
,
'In'
,
'Ir'
,
'K'
,
'Li'
,
'Mg'
,
'Mn'
,
'Mo'
,
'Na'
,
'Ni'
,
'Pb'
,
'Pd'
,
'Pt'
,
'Rb'
,
'Rh'
,
'Ru'
,
'Sm'
,
'Sr'
,
'Te'
,
'Tl'
,
'V'
,
'W'
,
'Yb'
,
'Zn'
]
top
=
Topology
()
top
=
Topology
()
## The Topology read from the PDB file
## The Topology read from the PDB file
self
.
topology
=
top
self
.
topology
=
top
...
@@ -151,13 +155,20 @@ class PDBFile(object):
...
@@ -151,13 +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 are not added for elements in metalElements, unless in the same residue.
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
:
if
i
in
atomByNumber
and
j
in
atomByNumber
:
if
atomByNumber
[
i
].
element
!=
None
and
atomByNumber
[
j
].
element
!=
None
:
if
atomByNumber
[
i
].
element
.
symbol
in
metalElements
or
atomByNumber
[
j
].
element
.
symbol
in
metalElements
:
if
atomByNumber
[
i
].
residue
==
atomByNumber
[
j
].
residue
:
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
else
:
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
else
:
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
if
len
(
connectBonds
)
>
0
:
if
len
(
connectBonds
)
>
0
:
# Only add bonds that don't already exist.
# Only add bonds that don't already exist.
...
...
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