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'.
Like it says, there's a difference between the structureX entry in your
alignment file and the sequence in the PDB file. We can't tell what the
problem is without seeing your real alignment file and PDB.
Usual things to check are:
1. If you have an ending residue number and chain ID in your alignment
file (structureX line), make sure to update it to match that of the
ligand, not the last amino acid.
2. When you turn on env.io.hetatm, Modeller reads *all* HETATM records,
not just magically the ligands you're interested in. So you need to list
them all in your alignment.
3. Modeller reads the PDB file sequentially. So if your ligands are not
immediately after the amino acid chain, you'll either need to include
the intervening residues in your sequence or modify your PDB file so
that they are.