Least-squares-fit overlays


1/7: Introduction

A drawback of retirement is lack of easy access to the full version of Mercury from the CCDC. One particular feature absent in the free version is creation of least-squares-fit superpositions of related structures, so I decided to develop my own. The process of making structure overlays in Mercury is (for me) overly fiddly, so I went about it in a different way. It requires some diligence in preparation, but fits in better with my workflow. The procedure, programs, and scripts are described herein. An example for a simple two-structure alignment follows. Please be aware that this is a work in progress. Recent changes include toggling of atoms and subtly brightened bond colours (by gamma correction), toggling CPK colours on/off for the atoms (just the atoms), and a further tweak to the CPK colours to help with deuteranomaly (i.e. red/green colour deficiency). Most recently, I added a way to fine tune the bond-drawing criteria so that long dative bonds can be drawn. I'll update these pages to demonstrate this soon.

metconazole-overlay

As a teaser, click on the picture for a preview of where we are heading ...

This particular structure is of the agricultural fungicide metconazole, which has two similar conformers in its asymmetric unit. We'll use it as an example covering how to prepare input files for the superposition and for creating high-quality, high-resolution figures. Incidentally, the overlay plot in the metconazole paper was drawn with Mercury, so you can easily compare with the above figure.

We'll be using Python, JavaScript, plus a bunch of plug-in modules for each etc. Hopefully all the requirements are explained in enough detail that it's painless to implement. The programs/scripts were written on a Mac flaptop, but should be easy to make run on Linux. I don't use Windows, but it ought to work with minor changes. One of the great things about Python and JavaScript is that somebody, somewhere has almost certainly written code that does all the seemingly difficult stuff. Moreover, AI can be phenomenally good at de-bugging, suggesting, and even implementing new features. I found DeepSeek to be especially useful in this regard. The graphical stuff is done in a browser, so should be cross-platform no matter what.




1: Introduction
2: Extract atom coordinates from the CIF(s)
3: Optimal superposition via quaternions
4: 3D interactive graphics
5: Three tin complexes and their pro-ligand
6: Nine tin complexes
7: Seventeen arsenic complexes

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