I could nicely fill missing residues 519-522 and 683-684 by using the normal protocol at /wiki/Missing residue. However, as I would like the existing residues not being modified, I used a script:
from modeller import * from modeller.automodel import * # Load the automodel class
log.verbose() env = environ()
# directories for input atom files env.io.atom_files_directory = ['.', '../atom_files']
class MyModel(automodel): def select_atoms(self): return selection(self.residue_range('518', '521'), self.residue_range('681', '683'))
a = MyModel(env, alnfile = 'alignment.ali', knowns = myPDB, sequence = 'myPDB_fill') a.starting_model= 1 a.ending_model = 1
a.make()
based on the last part of the wiki. Consistently, the error is:
................................. File "fill_resid_no-move.py", line 20, in ? a.make() File "/usr/lib/modeller9.10/modlib/modeller/automodel/automodel.py", line 106, in make atmsel = self._check_select_atoms() File "/usr/lib/modeller9.10/modlib/modeller/automodel/automodel.py", line 490, in _check_select_atoms atmsel = self.select_atoms() File "fill_resid_no-move.py", line 12, in select_atoms return selection(self.residue_range('518', '521'), File "/usr/lib/modeller9.10/modlib/modeller/coordinates.py", line 304, in residue_range start = self.residues[start]._num File "/usr/lib/modeller9.10/modlib/modeller/coordinates.py", line 234, in __getitem__ (self.offset, self.length, self.suffix)) File "/usr/lib/modeller9.10/modlib/modeller/util/modutil.py", line 23, in handle_seq_indx int_indx = lookup_func(*args) File "/usr/lib/modeller9.10/modlib/modeller/coordinates.py", line 298, in _indxres raise KeyError("No such residue: %s" % indx) KeyError: 'No such residue: 518'
I tried different selections as '518', '521' always getting error in finding the first residue in this '...' list.
alignment.ali is constructed, as in the wiki, of first the structure, then the sequence. At any event, the alignment.ali is the same that works well with the script that allows all atoms to move. I serched the web; hope this is no duplication.
Thanks for advice
francesco pietra