IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
add-missing-residues.py
1# This is a MODELLER script to fill in missing residues for
2# the 3KFO structure. It generates 5 candidate models; fit
3# each one against the SAXS profile using FoXS and pick the
4# one with the best fit.
5
6# Comparative modeling by the automodel class
7from modeller import Environ, log # Load standard Modeller classes
8from modeller.automodel import AutoModel # Load the AutoModel class
9
10log.verbose() # request verbose output
11env = Environ() # create a new MODELLER environment to build this model in
12
13# script_dir is the directory this script is in
14import sys
15import os
16script_dir = os.path.dirname(sys.argv[0])
17
18# directories for input atom files
19env.io.atom_files_directory = [script_dir, '../atom_files']
20
21# Renumber output model to get correct residue numbers and chain IDs
22# (Modeller default is to not assign a chain ID, and start residue numbers at 1)
23class MyModel(AutoModel):
24 def special_patches(self, aln):
25 self.rename_segments(segment_ids='A', renumber_residues=944)
26
27a = MyModel(env,
28 alnfile = os.path.join(script_dir,
29 'alignment.ali'), # alignment filename
30 knowns = '3KFO', # codes of the templates
31 sequence = '3KFO-fill') # code of the target
32a.starting_model= 1 # index of the first model
33a.ending_model = 5 # index of the last model
34 # (determines how many models to calculate)
35a.make() # do the actual comparative modeling