Commit 00e0bb96 authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed bug reading PDB files with multiple locations for some atoms

parent df265df8
...@@ -121,9 +121,11 @@ class PDBFile(object): ...@@ -121,9 +121,11 @@ class PDBFile(object):
self._positions = [] self._positions = []
for model in pdb.iter_models(True): for model in pdb.iter_models(True):
coords = [] coords = []
for atom in model.iter_atoms(): for chain in model.iter_chains():
pos = atom.get_position().value_in_unit(nanometers) for residue in chain.iter_residues():
coords.append(Vec3(pos[0], pos[1], pos[2])) for atom in residue.atoms:
pos = atom.get_position().value_in_unit(nanometers)
coords.append(Vec3(pos[0], pos[1], pos[2]))
self._positions.append(coords*nanometers) self._positions.append(coords*nanometers)
## The atom positions read from the PDB file. If the file contains multiple frames, these are the positions in the first frame. ## The atom positions read from the PDB file. If the file contains multiple frames, these are the positions in the first frame.
self.positions = self._positions[0] self.positions = self._positions[0]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment