class MyModel(automodel):
num_map = None
def fix_numbering(self):
for old_resi, new_resi in zip(self.residues, self.num_map):
old_resi.num = str(new_resi)
def user_after_single_model(self):
self.fix_numbering()
...
and it would be fine, but I get the residue numbers in wrong columns of
the PDB:
Modeller residue numbers are actually 5-character strings (they include
the 1-character PDB insertion code at the end). When you assign to .num
there's some logic to pad the numbers so they look right when they get
written out to PDB, but there's a small bug in Modeller here
specifically for 4-digit residue numbers. I've just fixed this, so it'll
be in the next Modeller release. For now you can work around it by
explicitly padding yourself (with a blank insertion code), e.g. by replacing