Using your own initial model

Normally, AutoModel generates an initial model by transferring coordinates from the templates. However, if you have a prepared PDB file containing an initial model, you can have AutoModel use this instead with the inifile keyword, as in the example below. (This automatically sets AutoModel.generate_method to generate.read_xyz for you, which is necessary for this to work.) This can be useful if the default initial model (.ini file) is so bad that the optimizer cannot efficiently optimize it. Of course, the primary sequence of this structure must match the target's exactly.

Note that when the initial model file is read, the range of residues to read from the PDB file is taken from the alignment file header for the sequence. Therefore, you should set that range accordingly (in the example below, the header for the 1fdx sequence alignment.ali is set to instruct MODELLER to read residues 1 through 54 from the 'A' chain).

Example: examples/automodel/model-myini.py

# Comparative using a provided initial structure file (inifile)
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']

a = AutoModel(env,
              alnfile  = 'alignment.ali',     # alignment filename
              knowns   = '5fd1',              # codes of the templates
              sequence = '1fdx',              # code of the target
              inifile  = 'my-initial.pdb')    # use 'my' initial structure
a.starting_model= 1                 # index of the first model
a.ending_model  = 1                 # index of the last model
                                    # (determines how many models to calculate)
a.make()                            # do comparative modeling