Abstract
Serial crystallography is a powerful technique in structure determination using many small crystals at X-ray free-electron laser or synchrotron radiation facilities. The large diffraction data volumes require high-throughput software to preprocess the raw images for subsequent analysis. ClickX is a program designated for serial crystallography data preprocessing, capable of rapid data sorting for online feedback and peak-finding refinement by parameter optimization. The graphical user interface (GUI) provides convenient access to various operations such as pattern visualization, statistics plotting and parameter tuning. A batch job module is implemented to facilitate large-data-volume processing. A two-step geometry calibration for single-panel detectors is also integrated into the GUI, where the beam center and detector tilting angles are optimized using an ellipse center shifting method first, then all six parameters, including the photon energy and detector distance, are refined together using a residual minimization method. Implemented in Python, ClickX has good portability and extensibility, so that it can be installed, configured and used on any computing platform that provides a Python interface or common data file format. ClickX has been tested in online analysis at the Pohang Accelerator Laboratory X-ray Free-Electron Laser, Korea, and the Linac Coherent Light Source, USA. It has also been applied in post-experimental data analysis. The source code is available via https://github.com/LiuLab-CSRC/ClickX under a GNU General Public License.
Introduction
In serial crystallography (SX), researchers fire high-intensity X-ray pulses at a stream of tiny crystals. This process generates millions of images, but only a small fraction—sometimes less than 10%—actually contain the diffraction patterns (called "hits") needed to reconstruct a 3D molecular structure. The sheer volume of data, often reaching terabytes per experiment, creates a massive bottleneck. Researchers require high-throughput tools that can filter data quickly, provide immediate feedback for on-the-fly experimental adjustments, and precisely calibrate detector geometry. Existing tools often lack intuitive interfaces for real-time tuning or are difficult to install and extend across different computing platforms. ClickX addresses these challenges as an open-source, Python-based software package designed to handle the massive data deluges produced by serial crystallography at X-ray free-electron lasers (XFELs) and synchrotrons.
Technical Implementation
ClickX is built entirely in Python, leveraging powerful libraries like NumPy, SciPy, and mpi4py for performance. Its architecture is divided into three interconnected modules: a main visualization interface, a geometry calibration module, and a batch job system. To match the high repetition rates of modern X-ray sources (up to 120 Hz), ClickX uses a master/worker paradigm via MPI, allowing it to scale across multiple CPU cores linearly. By choosing Python, the authors ensured that ClickX can be easily installed on almost any platform, from a local laptop to a high-performance computing cluster, without complex compilation steps.
Hit-Finding and Geometry Calibration
A key technical feature of ClickX is its dual hit-finding models. It offers two distinct algorithms for peak detection: an SNR (Signal-to-Noise Ratio) model for general use and a Poisson model that uses statistical significance to identify peaks in low-signal environments. The SNR-adaptive method allows the software to calculate thresholds based on the local background of each image, making it robust against varying noise levels during an experiment.
For single-panel detectors, ClickX integrates a novel two-step geometry calibration approach. First, it employs an "ellipse center shifting" method to find the beam center and detector tilt. Then, it refines all six geometric parameters—including photon energy and detector distance—simultaneously using residual minimization. Unlike command-line-heavy tools, ClickX emphasizes visual feedback. Users can see exactly how changing a threshold affects peak detection in real-time. This "human-in-the-loop" approach significantly reduces the time wasted on "false positives" (noise mistaken for peaks).
Experimental Validation and Performance
The authors validated ClickX using real-world experimental data from two major facilities: the Pohang Accelerator Laboratory X-ray Free-Electron Laser (PAL-XFEL) in Korea and the Linac Coherent Light Source (LCLS) in the USA. Specifically, the Coherent X-ray Imaging (CXI) instrument at LCLS was used to test the software's ability to handle high-repetition-rate data streams.
Benchmarking results demonstrated that the software's processing speed scales linearly with the number of CPU cores. On a modest six-core system, it achieved approximately 3.5 frames per second per core. The authors calculate that a system with approximately 35 cores can process raw images at 120 Hz, matching the maximum data rate of the LCLS. In tests at PAL-XFEL, ClickX demonstrated improved hit-finding results compared to Cheetah (a standard industry tool), largely due to the ease of fine-tuning parameters through the GUI.
Conclusion and Future Directions
While ClickX provides a robust solution for single-panel detector calibration, it currently requires multi-panel detectors (like the CSPAD) to have their relative panel positions well-determined beforehand. Future development is focused on supporting more complex experimental setups, such as time-resolved (pump-probe) experiments and two-color serial crystallography. Additionally, while the computation scales well, overall speed can still be limited by the input/output (I/O) speed of the storage system when dealing with massive datasets. Despite these challenges, ClickX represents a significant step forward in making serial crystallography data processing more accessible and efficient through intuitive visualization and portable implementation.
Summary updated