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
1a5029cf
Commit
1a5029cf
authored
Oct 23, 2014
by
peastman
Browse files
Further improvements to handling of weird PDB files created by VMD
parent
0e36f341
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
wrappers/python/simtk/openmm/app/internal/pdbstructure.py
wrappers/python/simtk/openmm/app/internal/pdbstructure.py
+15
-2
No files found.
wrappers/python/simtk/openmm/app/internal/pdbstructure.py
View file @
1a5029cf
...
...
@@ -741,8 +741,21 @@ class Atom(object):
self
.
residue_number
=
int
(
pdb_line
[
22
:
26
],
16
)
pdbstructure
.
_residue_numbers_are_hex
=
True
except
:
# Just give it the next number in sequence.
# When VMD runs out of hex values it starts filling the residue ID field with ****.
# Look at the most recent atoms to figure out whether this is a new residue or not.
if
pdbstructure
.
_current_model
is
None
or
pdbstructure
.
_current_model
.
_current_chain
is
None
or
pdbstructure
.
_current_model
.
_current_chain
.
_current_residue
is
None
:
# This is the first residue in the model.
self
.
residue_number
=
pdbstructure
.
_next_residue_number
else
:
currentRes
=
pdbstructure
.
_current_model
.
_current_chain
.
_current_residue
if
currentRes
.
name_with_spaces
!=
self
.
residue_name_with_spaces
:
# The residue name has changed.
self
.
residue_number
=
pdbstructure
.
_next_residue_number
elif
self
.
name_with_spaces
in
currentRes
.
atoms_by_name
:
# There is already an atom with this name.
self
.
residue_number
=
pdbstructure
.
_next_residue_number
else
:
self
.
residue_number
=
currentRes
.
number
self
.
insertion_code
=
pdb_line
[
26
]
# coordinates, occupancy, and temperature factor belong in Atom.Location object
x
=
float
(
pdb_line
[
30
:
38
])
...
...
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