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
9025de4d
Commit
9025de4d
authored
Feb 24, 2020
by
peastman
Browse files
PDBxFile marks heterogens with HETATM
parent
36b6caa6
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/pdbxfile.py
wrappers/python/simtk/openmm/app/pdbxfile.py
+8
-2
No files found.
wrappers/python/simtk/openmm/app/pdbxfile.py
View file @
9025de4d
...
...
@@ -400,6 +400,8 @@ class PDBxFile(object):
raise
ValueError
(
'Particle position is NaN'
)
if
any
(
math
.
isinf
(
norm
(
pos
))
for
pos
in
positions
):
raise
ValueError
(
'Particle position is infinite'
)
nonHeterogens
=
PDBFile
.
_standardResidues
[:]
nonHeterogens
.
remove
(
'HOH'
)
atomIndex
=
1
posIndex
=
0
for
(
chainIndex
,
chain
)
in
enumerate
(
topology
.
chains
()):
...
...
@@ -415,14 +417,18 @@ class PDBxFile(object):
else
:
resId
=
resIndex
+
1
resIC
=
'.'
if
res
.
name
in
nonHeterogens
:
recordName
=
"ATOM"
else
:
recordName
=
"HETATM"
for
atom
in
res
.
atoms
():
coords
=
positions
[
posIndex
]
if
atom
.
element
is
not
None
:
symbol
=
atom
.
element
.
symbol
else
:
symbol
=
'?'
line
=
"
ATOM
%5d %-3s %-4s . %-4s %s ? %5s %s %10.4f %10.4f %10.4f 0.0 0.0 ? ? ? ? ? . %5s %4s %s %4s %5d"
print
(
line
%
(
atomIndex
,
symbol
,
atom
.
name
,
res
.
name
,
chainName
,
resId
,
resIC
,
coords
[
0
],
coords
[
1
],
coords
[
2
],
line
=
"
%s
%5d %-3s %-4s . %-4s %s ? %5s %s %10.4f %10.4f %10.4f 0.0 0.0 ? ? ? ? ? . %5s %4s %s %4s %5d"
print
(
line
%
(
recordName
,
atomIndex
,
symbol
,
atom
.
name
,
res
.
name
,
chainName
,
resId
,
resIC
,
coords
[
0
],
coords
[
1
],
coords
[
2
],
resId
,
res
.
name
,
chainName
,
atom
.
name
,
modelIndex
),
file
=
file
)
posIndex
+=
1
atomIndex
+=
1
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