Skip to main content

Diffraction Map Processing Pipeline (REyes v3.6.0)

License DOI

Quick Start

# Install the package
pip install .

# Run automated pipeline
reyes-monitor --microscope Arctica-CETA

# Run automated pipeline with movie processing (requires a pyautoprocess preset)
reyes-monitor --microscope Arctica-CETA --autoprocess --microscope-config Arctica-CETA-mrc-SM

Overview

pyREyes is a Python package to support REyes (Reciprocal Eyes), an end-to-end autonomous electron diffraction data collection and processing pipeline. REyes generates diffraction heatmaps, identifies key targets, and manages navigator files for SerialEM.

📚 Full Documentation

📝 Changelog - what is new in 3.6.0 and how to upgrade from 3.4.x

Key Features

  • Grid squares detection and atlas management
  • Manual or automated grid square selection
  • Eucentricity correction
  • Diffraction pattern quality classification using DQI (Diffraction Quality Index)
  • Frame loading for different detectors: stacks are summed, large frames are cleaned of bad lines and binned to 2048x2048, and small frames use dedicated detection parameters
  • Diffraction map blocks recorded across midnight are processed as one block
  • Navigation file generation with spatial awareness
  • Comprehensive visualization suite
  • Automated data processing with state machine monitoring
  • Optional movie processing and structure solution integration
  • Restart-safe movie processing and timeouts for hung processing steps
  • Keeps going when SerialEM sets a grid square or crystal aside or aborts a grid, and records the session outcome in session_status.json
  • SerialEM script packages for Ceta and DE Apollo cameras (docs/scripts)

Diffraction Quality Analysis

REyes uses advanced quality metrics to assess diffraction patterns:

LQP (Lattice Quality Peaks): A number of peaks in an FFT of the thresholded and binarized diffraction snapshot that correspond to lattice quality.

DQI (Diffraction Quality Index): A quality metric calculated as the ratio of LQP to total diffraction peaks (DQI = LQP / Diffraction Peaks). DQI values above 3.0 indicate higher crystalline quality with better-ordered lattice structures. This index is used to automatically classify and prioritize crystal targets for data collection.

Pipeline Components

Core Modules

  1. Grid Squares Searcher
  2. Navigator Eucentricity Corrector
  3. Diffraction Map Processor
  4. Navigation File Generator
  5. Final Targets Processor
  6. Collection Executor

Pipeline Orchestration:

  • Processing Monitor - Automatically runs all steps above and pauses for user input on optional manual steps

Directory Structure

working_directory/
├── dif_maps/               # Diffraction maps and visualizations
│   └── diff_blocks_maps/   # Block-specific maps
├── grid_squares/           # Grid square & eucentricity outputs
├── movies/                 # Continuous rotation diffraction movies
├── REyes_logs/             # Processing logs
└── targets/                # Navigation files and diffraction snapshots

Reference

The REyes methodology and its applications to small molecules, materials, and protein crystallography are described in detail in:

Eremin, D.B.; Jha, K.K.; Delgadillo, D.A.; Zhang, H.; Foxman, S.H.; Johnson, S.N.; Vlahakis, N.W.; Cascio, D.; Lavallo, V.; Rodríguez, J.A.; Nelson, H.M. "Spatially-Aware Diffraction Mapping Enables Fully Autonomous MicroED" ChemRxiv 2025, DOI: 10.26434/chemrxiv-2025-4p4c3

Data Availability

Electron diffraction data are publicly available through the Caltech.

Repository: https://miledd.caltech.edu/shared/

ZENODO Dataset: Complete Raw and Processed REyes Dataset: Autonomous MicroED Collection for (S,S)-Salen Ligand - https://doi.org/10.5281/zenodo.16971798

Support

For support and questions, please contact:

Developers

Patent Disclosure

Dmitry B. Eremin, Hongyu Zhang, Jose A. Rodríguez, and Hosea M. Nelson have filed a provisional patent application related to the methods implemented in this software:

Patent Application: CIT-9295-P2, filed May 8, 2025

This disclosure is provided in accordance with academic transparency standards. The software remains available for academic and research use under the terms specified in the license.

Copyright © 2025, California Institute of Technology (Caltech). All rights reserved. Use of this software is permitted for academic and non‑commercial research only. Commercial use is prohibited without a license, please contact Caltech Office of Technology Transfer & Corporate Partnerships.

Metadata

Release files for pyREyes 3.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyREyes 3.6.0
File Size Uploaded Provenance Actions
pyreyes-3.6.0.tar.gz 39.9 MB Without provenance Details for pyreyes-3.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyREyes 3.6.0
File Interpreter ABI Platform Actions
pyreyes-3.6.0-py3-none-any.whl Python 3 none any Details for pyreyes-3.6.0-py3-none-any.whl

Total release size: 40.0 MB

Release files / pyreyes-3.6.0.tar.gz

Download URL pyreyes-3.6.0.tar.gz
Size 39.9 MB
Tags Source
SHA-256 checksum
How to use checksums
e9ce3b2f8350e575b9928669b73efdb868d30563d446035318012339d47f9d05
BLAKE2b-256 checksum
How to use checksums
c53a6a79ba74cb0a968bb11ff99489fdaf2a8c71082da821503bd8d8b0bc217f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Release files / pyreyes-3.6.0-py3-none-any.whl

Download URL pyreyes-3.6.0-py3-none-any.whl
Size 160.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84e84187201952c800e84210133c51f8d345542df1149f0b8b1208e56d29e08e
BLAKE2b-256 checksum
How to use checksums
3295c715b81bdde804ce60c5edfbcc60c7962cbbb4abfdbcabff7bf5749aa075
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Security for pyREyes 3.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page