Skip to content

Commit

Permalink
sort particles when writing pdb
Browse files Browse the repository at this point in the history
  • Loading branch information
mefortunato committed Apr 17, 2017
1 parent e6aec90 commit 05d95a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pysimm/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -2775,7 +2775,7 @@ def write_pdb(self, outfile='data.pdb', type_names=True):
out.write('{:<10}pdb written using pySIMM system module\n'
.format('HEADER'))
for m in self.molecules:
for p in m.particles:
for p in sorted(m.particles, key=lambda x: x.tag):
if p.type:
out.write('{:<6}{:>5} {:>4} RES {:4} '
'{: 8.3f}{: 8.3f}{: 8.3f}{:>22}{:>2}\n'
Expand Down

0 comments on commit 05d95a1

Please sign in to comment.