Least-squares-fit overlays


2/5: Extract atom coordinates from the CIF(s)

The first step is to take one or more CIFs, extract the atom names and crystal coordinates, convert to Cartesian coordinates, and write a '.xyz' file for each CIF. This is done with the program over-rip.py, available here. It finds CIFs in the working directory and does the following:

This is intentionally fairly rudimentary. It helps to have the atoms in your structures numbered and ordered in a sensible and similar way, which is of course best practice in any case. There is currently no facility to apply point-group symmetry to 'grow' a structure that happens to lie on a special position, but I might work on that at some point. Either way, it is possible to generate .xyz files for such structures by other means (e.g. the free version of Mercury).

To follow along or to see the results of over-rip.py, the files for metconazole are available here:

Here's an example of what the .xyz format looks like:

22 
metconazole A 
Cl1A     11.975713     6.839304     6.630064 
O1A       7.326818     0.526737    10.347148 
N1A       8.008864     1.925504    12.813311 
. 
. lines omitted
. 
C16A     11.490834     5.322523     8.825329 
C17A     10.737900     4.418826     9.558406 

The first line gives the number of atoms in the molecule (or fragment). This line is important and required. The second identifies the molecule in some way. For our purposes, we'll use it in the legend of the overlay figure. Next come the atom lines, with atom type, number, maybe a letter suffix (not required, but does no harm) and then Cartesian coordinates.

As should be obvious from the above, we need a separate .xyz file for each copy of the molecule. Thus, for structures with Z ' > 1, we need to manually split the .xyz file written by over-rip.py. It's a little extra work, but easily done with a text editor. For the moment, I'm not inclined to modify the program, though I might automate this later.

The two files 'metconazole-A.xyz' and 'metconazole-B.xyz' are needed for the next stage: finding the best translation and rotation to superimpose the structures.





Return to the main Tutorials page or to the main X-Ray Lab page