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
89635b86
Commit
89635b86
authored
Dec 16, 2015
by
Rafal P. Wiewiora
Browse files
fix writeFile for extraParticleIdentifier=None
parent
c8cbc3d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
wrappers/python/simtk/openmm/app/pdbfile.py
wrappers/python/simtk/openmm/app/pdbfile.py
+8
-6
No files found.
wrappers/python/simtk/openmm/app/pdbfile.py
View file @
89635b86
...
...
@@ -134,7 +134,7 @@ class PDBFile(object):
try
:
element
=
elem
.
get_by_symbol
(
atomName
[
0
])
except
KeyError
:
pass
pass
newAtom
=
top
.
addAtom
(
atomName
,
element
,
r
,
str
(
atom
.
serial_number
))
atomByNumber
[
atom
.
serial_number
]
=
newAtom
self
.
_positions
=
[]
...
...
@@ -329,17 +329,19 @@ class PDBFile(object):
else
:
resId
=
"%4d"
%
((
resIndex
+
1
)
%
10000
)
for
atom
in
res
.
atoms
():
if
len
(
atom
.
name
)
<
4
and
atom
.
name
[:
1
].
isalpha
()
and
((
atom
.
element
is
None
and
extraParticleIdentifier
is
not
None
)
or
len
(
atom
.
element
.
symbol
)
<
2
):
if
atom
.
element
is
not
None
:
symbol
=
atom
.
element
.
symbol
elif
atom
.
element
is
None
and
extraParticleIdentifier
is
not
None
:
symbol
=
extraParticleIdentifier
else
:
symbol
=
' '
if
len
(
atom
.
name
)
<
4
and
atom
.
name
[:
1
].
isalpha
()
and
len
(
symbol
)
<
2
:
atomName
=
' '
+
atom
.
name
elif
len
(
atom
.
name
)
>
4
:
atomName
=
atom
.
name
[:
4
]
else
:
atomName
=
atom
.
name
coords
=
positions
[
posIndex
]
if
atom
.
element
is
not
None
:
symbol
=
atom
.
element
.
symbol
else
:
symbol
=
extraParticleIdentifier
line
=
"ATOM %5d %-4s %3s %s%4s %s%s%s 1.00 0.00 %2s "
%
(
atomIndex
%
100000
,
atomName
,
resName
,
chainName
,
resId
,
_format_83
(
coords
[
0
]),
_format_83
(
coords
[
1
]),
_format_83
(
coords
[
2
]),
symbol
)
...
...
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