[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [modeller_usage] renumbering residues
- To: Jan Kosinski <kosinski AT embl.de>, modeller_usage@listsrv.ucsf.edu
- Subject: Re: [modeller_usage] renumbering residues
- From: Modeller Caretaker <modeller-care@ucsf.edu>
- Date: Thu, 04 Sep 2014 11:24:46 -0700
On 9/4/14, 9:33 AM, Jan Kosinski wrote:
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
old_resi.num = str(new_resi)
with
old_resi.num = "%4d " % new_resi
Ben Webb, Modeller Caretaker
--
modeller-care@ucsf.edu http://www.salilab.org/modeller/
Modeller mail list: http://salilab.org/mailman/listinfo/modeller_usage