Skip to content

Commit

Permalink
Don't reference out-of-range residues
Browse files Browse the repository at this point in the history
Previously we were careless about whether
residue numbers were actually in range, but
now python-ihm checks for that.
  • Loading branch information
benmwebb committed Sep 6, 2024
1 parent 158951a commit ace4588
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/mmcif/pyext/src/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class _StartingModel(ihm.startmodel.StartingModel):
def __init__(self, asym_unit, struc_prov):
self.filename = struc_prov[0].get_filename()
super().__init__(
asym_unit=asym_unit(0, 0), # will update in _add_residue()
asym_unit=asym_unit(1, 1), # will update in _add_residue()
# will fill in later with _set_sources_datasets()
dataset=None,
asym_id=struc_prov[0].get_chain_id(),
Expand Down
2 changes: 1 addition & 1 deletion modules/mmcif/test/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def test_coordinate_handler_get_structure_particles_nonseq(self):
def test_coordinate_handler_add_chain(self):
"""Test CoordinateHandler.add_chain()"""
s = ihm.System()
ent = ihm.Entity('ACGT')
ent = ihm.Entity('ACGTACGT')
# Check that IMP residue numbering (11-18) maps to IHM (1-8)
asym = ihm.AsymUnit(ent, auth_seq_id_map=10)
m = IMP.Model()
Expand Down
4 changes: 2 additions & 2 deletions modules/mmcif/test/test_restraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ def test_all_restraints_cross_link(self):
"""Test _AllRestraints with cross-link restraint"""
conv = IMP.mmcif.Writer()
m = IMP.Model()
h = make_model(m, chains=[("Rpb1", "AMT", "X"),
("Rpb2", "ACC", "Z")])
h = make_model(m, chains=[("Rpb1", "A" * 50, "X"),
("Rpb2", "C" * 50, "Z")])
conv.add_model([h], [])

xl_csv = self.get_input_file_name('test.xlms.csv')
Expand Down

0 comments on commit ace4588

Please sign in to comment.