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
baab6f40
Commit
baab6f40
authored
Dec 12, 2017
by
peastman
Browse files
Avoid truncating PDB file if the IDs are too long
parent
e1971877
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
wrappers/python/simtk/openmm/app/pdbfile.py
wrappers/python/simtk/openmm/app/pdbfile.py
+4
-3
No files found.
wrappers/python/simtk/openmm/app/pdbfile.py
View file @
baab6f40
...
...
@@ -319,7 +319,8 @@ class PDBFile(object):
If True, keep the residue and chain IDs specified in the Topology
rather than generating new ones. Warning: It is up to the caller to
make sure these are valid IDs that satisfy the requirements of the
PDB format. Otherwise, the output file will be invalid.
PDB format. No guarantees are made about what will happen if they
are not, and the output file could be invalid.
extraParticleIdentifier : string=' '
String to write in the element column of the ATOM records for atoms whose element is None (extra particles)
"""
...
...
@@ -339,7 +340,7 @@ class PDBFile(object):
if
modelIndex
is
not
None
:
print
(
"MODEL %4d"
%
modelIndex
,
file
=
file
)
for
(
chainIndex
,
chain
)
in
enumerate
(
topology
.
chains
()):
if
keepIds
:
if
keepIds
and
len
(
chain
.
id
)
==
1
:
chainName
=
chain
.
id
else
:
chainName
=
chr
(
ord
(
'A'
)
+
chainIndex
%
26
)
...
...
@@ -349,7 +350,7 @@ class PDBFile(object):
resName
=
res
.
name
[:
3
]
else
:
resName
=
res
.
name
if
keepIds
:
if
keepIds
and
len
(
res
.
id
)
<
5
:
resId
=
res
.
id
else
:
resId
=
"%4d"
%
((
resIndex
+
1
)
%
10000
)
...
...
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