Where:
- imol_ref is an integer number
- ref_selection is a string
- imol_moving is an integer number
- moving_selection is a string
- n_res is an integer number
- dist_crit is a number
an slightly-modified implementation of the "lsq_improve" algorithm of Kleywegt and Jones (1997).
Note that if a residue selection is specified in the residue selection(s), then the first residue of the given range must exist in the molecule (if not, then mmdb will not select any atoms from that molecule).
Kleywegt and Jones set n_res to 4 and dist_crit to 6.0.