Once the model.pdb file is created, I would like to make a refinement
without moving the protein (it should be fixed), and readjusting the R
groups of the short peptide *with no movement of the backbone*. I don't
want to modify the positions of the backbone at all.
Currently I'm using the following code (short version). This one creates
a model with no movement of the protein, but the short peptide is
displaced several angstroms.
That isn't surprising, because you are selecting all atoms in residues
618:D through 630:D (which is presumably your short peptide):