Skip to content

Commit

Permalink
Check that mmCIF ligand names are not truncated
Browse files Browse the repository at this point in the history
mmCIF is introducing 5-character ligand names.
Make sure that these are handled correctly (and are
not truncated to 3 characters, as in traditional PDB).
  • Loading branch information
benmwebb committed Sep 18, 2023
1 parent 9eee4df commit 4d9c86b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/atom/test/test_mmcif.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ def test_multiple_ligands(self):
self.assertEqual(len(residues), 4)
self.assertEqual([IMP.atom.Residue(x).get_index() for x in residues],
[279, 301, 302, 303])
# Make sure that ligand names are not restricted to 3 characters
self.assertEqual([IMP.atom.Residue(x).get_residue_type().get_string()
for x in residues],
['LYS', 'CA', '7ZTVU', '7ZTVU'])

def test_multiple_ligands_no_auth(self):
"""Check handling of multiple ligands with no author-provided info"""
Expand All @@ -166,6 +170,10 @@ def test_multiple_ligands_no_auth(self):
self.assertEqual(len(residues), 4)
self.assertEqual([IMP.atom.Residue(x).get_index() for x in residues],
[261, 1, 1, 1])
# Make sure that ligand names are not restricted to 3 characters
self.assertEqual([IMP.atom.Residue(x).get_residue_type().get_string()
for x in residues],
['LYS', 'CA', '7ZTVU', '7ZTVU'])


if __name__ == '__main__':
Expand Down

0 comments on commit 4d9c86b

Please sign in to comment.