I have a problem in which I am modelling a protein as a homodimer for which I am using a homodimeric template with ligands bound.
When I model without ligand, it runs fine. But when I want to include heteroatoms, it says 'Number of residues between alignment and pdb file are different'.

This is my script file.

# 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
env = environ()  # create a new MODELLER environment to build this model in

env.io.hetatm = True

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

a = automodel(env,
              alnfile  = 'mockali.ali',     # alignment filename
              knowns   = '1COD',              # codes of the templates
              sequence = 'targetfile',              # code of the target
              assess_methods=(assess.DOPE, assess.GA341))
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

This is my alignment file.



Dr. Jayashree Ramana