Introduction
primeXP [python retro-interactive model editor (inspired by) XP ] is an interactive crystal structure editor with some intentional resemblance to the program that inspired it, George Sheldrick's XP. It includes many of the same four-letter commands as XP, though some have slightly altered and/or expanded functionality. There are also a few new commands that serve as enhancements or extensions. In this capacity, primeXP bridges the gap between the crystallographic refinement engine and publication-quality diagrams. It reads and writes SHELXL *.res and *.ins files, plus a few other useful formats. It is not intended as a competitor to programs such as ShelXle or Olex2, but there is some overlap. It is much more closely related to XP. For example, similar to XP, primeXP does not spawn the SHELXL refinement program, and probably never will. It does, however, provide a wide array of structure drawing and analysis tools that seek to match or surpass other small-molecule molecular graphics programs.
primeXP is built using Python, PyQt6, and PyOpenGL, using NumPy and SciPy for geometric and topological mathematics, and is highly customisable. Visualisation is handled by OpenGL 4.1, enabling real-time rendering of features such as displacement ellipsoids, a variety of atom and bond styles, label collision avoidance (a never-ending work in progress - a true can-of-worms), etc.

The primeXP graphical interface showing a structure with thermal ellipsoids, and the terminal emulator. The axis direction gnomon in the upper left has a 3-state toggle (off/on/on+labels).
primeXP Features
The program uses a hybrid interface, combining interactive 3D graphics with a bash-like terminal emulator, which should be familiar to experienced crystallographers. Key features include:
- Advanced rendering: Customisable representations including wireframe, stick, ball-and-stick, and true anisotropic displacement ellipsoids, with or without cutout octants.
- Symmetry generation: Real-time application of space-group operators and cell translations to expand the asymmetric unit and examine packing motifs.
- Rigid-body analysis: Translation-Libration-Screw (TLS) dashboard for analyzing rigid molecular fragments.
- Geometric analysis: Tools for calculating mean planes, torsion angles, and interactive distance/angle measurements.
- Hydrogen modelling: Automated hydrogen atom addition for various hybridization states (e.g., sp2, sp3) using standard riding model geometries. This is more sophisticated than HADD in XP, but much less so than the HFIX facilities in SHELXL.
- Export: Generation of high-resolution diagrams, orthogonal coordinate files, newly edited *.ins file etc. suitable for publication or further analysis.
A few primeXP pictures
A typical ellipsoid plot in 'TELP' mode from primeXP. The program currently has 22 different 'ATYP' atom types for ellipsoids and spheres, with or without various kinds of shading/octant views. More are on the 'to do' list, including implementations of Bürgi's PEANUT plots. Unlike XP, TELP in primeXP is fully 3D-interactive.
The same molecular plot, but with 3D-shaded ellipsoids and spheres, and a blue-gradient background. Colours may be specified using 6-digit hexcodes (~16 million colours), 3-digit hexcodes (~4 thousand colours), or 148 named 'web' colours. The label colours may be set individually (via colour name or hexcode), but default to black or white depending on the overall luminosity of the scene.
Model editing via PICK is similar to its counterpart in the original XP, but in primeXP, PICK is fully 3D interactive, and the PICK sequence can be interrupted via mouse clicks on any visible Q-peak or atom.
Although it was not written with proteins in mind, primeXP is capable of rendering protein structures, such as the above 1.1 Å resolution structure of BPTI.
The RING/X command automatically places a dummy 'X' atom at the centroid of each ring (default 3-8 membered rings), as in the above C70 buckyball/buckybowl complex. In contrast to CENT/X in XP, that's 46 dummy atoms placed without having to specify any ring atom names (CENT/X is also available, of course).
Disorder visualization in primeXP is flexible and can be shown in a number of ways. One such view is given above, in which major occupancy groups are drawn with 3D shading and minor disorder moieties are shown as open ellipsoids.
There are also many ways to construct packing plots in primeXP. The above shows a perspective view down the c-axis of a di-periodic perovskite-like structure (same structure as the disorder plot (vide supra), but with minor disorder removed). Orthogonal projections are also available at the click of an on-screen button.
Real-time translation-libration-screw (TLS) visualisation. The translation (T) and libration (rotary oscillation, L) tensors can be represented by 3x3 symmetric positive-definite matrices, and so may be visualized as ellipsoids, similar to atomic displacement ellipsoids. The screw (S) tensor on the other hand represents the coupling of translation and rotation. This requires an asymmetric 3x3 matrix, which can't be drawn as an ellipsoid. In primeXP, the S-tensor is visualized as an elongated round-ended bicone. The long axis of the bicone corresponds to the direction of screw propagation, and is wider in the middle where atomic movement is greatest.
Availability and Implementation
The modular architecture of primeXP separates graphical routines, command parsing, and core crystallographic maths. It was developed on macOS, and runs with a few minor modifications to some screen-resolution settings on Linux (thanks Paul!). It should also run on Windows, but that has not yet been tried because I don't use Windows unless I have to, which in retirement, I don't. Although primeXP will probably always be a work in progress, and new features are still being added, the program is close to being ready for release. Once a few remaining known bugs etc. have been fixed, I'll make it freely available.