LSQRMS program. V. Alexandrov, Yale (2000). The LSQ fitting routine (when the program is called with "lsq" keyword) works as follows. Assuming that the set of equivalence pairs for two structures (we call them "moving" and "reference" structures, respectively) is determined, e.g. found from the corresponding sequence alignment, the structural alignment is done in two steps. The first is to find the translation vector (TV) that takes the center-of-mass (CM) of one structure to the other (easy: find CM coordinates for each structure and subtract the CM vector of the "moving" structure from the CM vector of the "fixed" one). The second step is to compute the matrix transformation (Rotation Matrix) that minimizes RMSD between the two structures after applying TV transformation to the moving structure from the previous step. Note that CM for both structures is calculated based only on those C-alphas that are present in the set of equivalence pairs. After the CM (center-of-mass) of the "moving" structure is first moved to that of the "reference" structure (with help of the Translation Vector from the previous step) the rotation matrix (RM) is computed using a wide-known method suggested by Kabsch (1977). The method is based on finding the solution for the parameters of the 3D rotation matrix minimizing the RMSD of the CM-transformed structures (actually, their equivalence pairs only). After applying RM to the "moving" structure (preceded by TV translation), the RMSD is calculated between the coordinates for all the equivalence pairs. If the program is not called with "lsq" argument, it repeats the above-mentioned process (skipping the sequence alignment stage at each iteration) finding new equivalence pairs and minimizing RMSD in each iteration until it converges to some minimum value or until the program reaches the maximum number of iterations (currently 100). If supplied with keyword "structal", the program outputs the resulting structures (original "target" and rotated "query" structures + the corresponding equivalence pairs) in the original Structal format (Levitt, 1994). Otherwise, the program outputs only the new (rotated and translated) coordinates of the query. Refs. 1) Kabsch (Kabsch, W (1976) Acta Cryst. A32, 922-923) 2) Levitt, M., STRUCTAL. A structural alignment program, Stanford U, (1994).