Abstract
Serial Crystallography (SX) involves the processing of thousands of diffraction patterns coming from crystals in random orientations. To compile a complete dataset, these patterns must be indexed (i.e., determine orientation), integrated, and merged. We introduce the TORO (TOrch-powered Robust Optimization) Indexer, a robust and adaptable indexing algorithm developed using the PyTorch framework. TORO Indexer is capable of operating on GPUs, CPUs, and other hardware accelerators supported by PyTorch, ensuring compatibility with a wide variety of computational setups. In our tests, TORO outpaces existing solutions indexing thousands of frames per second when running on GPUs, positioning it as an attractive candidate to produce real-time indexing and user feedback. Our algorithm streamlines some of the ideas introduced by previous indexers like DIALS real grid search and XGandalf, and refines them using faster and principled robust optimization techniques which result in a concise codebase consisting of less than 500 lines. Based on our evaluations across four proteins, TORO consistently matches and, in certain instances, outperforms established algorithms such as XGandalf and MOSFLM, occasionally amplifying the quality of the consolidated data while achieving indexing rates that are orders of magnitude higher. The inherent modularity of TORO, and the versatility of Pytorch code bases, facilitate its deployment into a wide array of architectures, software platforms and bespoke applications, highlighting its prospective significance in SX.