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
aff6ab55
"vscode:/vscode.git/clone" did not exist on "564fe013e5d6421abc55ed31b3a6e09e092f82d9"
Commit
aff6ab55
authored
Dec 09, 2015
by
Rafal P. Wiewiora
Browse files
add removeBondsToMetals argument
parent
ce042c89
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
wrappers/python/simtk/openmm/app/pdbfile.py
wrappers/python/simtk/openmm/app/pdbfile.py
+7
-2
No files found.
wrappers/python/simtk/openmm/app/pdbfile.py
View file @
aff6ab55
...
@@ -59,7 +59,7 @@ class PDBFile(object):
...
@@ -59,7 +59,7 @@ class PDBFile(object):
_residueNameReplacements
=
{}
_residueNameReplacements
=
{}
_atomNameReplacements
=
{}
_atomNameReplacements
=
{}
def
__init__
(
self
,
file
):
def
__init__
(
self
,
file
,
removeBondsToMetals
=
False
):
"""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,6 +68,9 @@ class PDBFile(object):
...
@@ -68,6 +68,9 @@ 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'
,
...
@@ -161,7 +164,9 @@ class PDBFile(object):
...
@@ -161,7 +164,9 @@ class PDBFile(object):
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
and
not
removeBondsToMetals
:
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
in
metalElements
or
atomByNumber
[
j
].
element
.
symbol
in
metalElements
:
if
atomByNumber
[
i
].
residue
==
atomByNumber
[
j
].
residue
:
if
atomByNumber
[
i
].
residue
==
atomByNumber
[
j
].
residue
:
...
...
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