Skip to content

Commit

Permalink
Fix bug in PDB parser with test
Browse files Browse the repository at this point in the history
  • Loading branch information
swails committed Feb 22, 2017
1 parent c742a9b commit f94573c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion parmed/formats/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def parse(filename, skip_bonds=False):
inscode, segid)
else:
try:
orig_atom = struct.atoms[atomno-1]
last_atom = orig_atom = struct.atoms[atomno-1]
except IndexError:
raise PDBError('Extra atom in MODEL %d' % modelno)
if (orig_atom.residue.name != resname.strip()
Expand Down
5 changes: 5 additions & 0 deletions test/test_parmed_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,11 @@ def test_pdb_write_format(self):
pdbfile.write_pdb(f, write_anisou=True)
self.assertTrue(diff_files(get_saved_fn('SCM_A_formatted.pdb'), f))

def test_pdb_multimodel_parsing_bug_820(self):
""" Test model failing in parsing due to bug #820 in GitHub """
# Just make sure it does not raise an exception
self.assertEqual(len(download_PDB('1aaf').atoms), 893)

def test_pdb_write_symmetry_data(self):
""" Tests writing PDB file with symmetry data """
def assert_remark_290(parm, remark_290_lines):
Expand Down

0 comments on commit f94573c

Please sign in to comment.