# Homology modeling by the automodel class
from modeller import *              # Load standard Modeller classes
from modeller.automodel import *    # Load the automodel class

log.verbose()    # request verbose output

class MyModel(automodel):
  def special_patches(self, aln):
        # Rename both chains and renumber the residues in each
        self.rename_segments(segment_ids=['A','B'],renumber_residues=[113,1])

env = environ()  # create a new MODELLER environment to build this model in

# directories for input atom files
env.io.atom_files_directory = ['.', '../atom_files']
env.io.hetatm = True

a = MyModel(env,
               alnfile  = 'alignment_complex.ali',     # alignment filename
               knowns   = '7qbm',              # codes of the templates
               sequence = 'query_complex')              # code of the target
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 the actual homology modeling
