[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [modeller_usage] renumbering residues



Perfect, this works!

Thanks!
Jan

On 09/04/2014 08:24 PM, Modeller Caretaker wrote:
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

--
Jan Kosinski, PhD
Structural and Computational Biology Unit
European Molecular Biology Laboratory (EMBL)
Meyerhofstrasse 1
69117 Heidelberg
Germany