How phzwart/agentsg works
agentsg is a dependency-free crystallographic toolkit for unit-cell comparison, space-group operations, and serial-crystallography reindexing. A typical comparison computes root-form distances, optionally searches precomputed PDB cells, and exposes results through a read-only HTTP API; reindexing provides a separate workflow for matching cell settings. Space-group operations also support reflection conditions, asymmetric units, and ITA-style diagrams, while manifold utilities parse CrystFEL streams and describe cell trajectories. The README documents these capabilities; sampled source confirms portions of the API and reindexing internals, so uncertain links are omitted.
Main entry points: handlers.py API handlers · celldb.py Cell database · app.py HTTP service · space_groups.py Space groups
Components 20
Cell comparison
- Cell metrics
agentsg/src/agentsg/cell/metric.py - Niggli reduction
agentsg/src/agentsg/cell/reduction.py - Root invariants
agentsg/src/agentsg/cell/rootform.py - Cell database
agentsg/src/agentsg/cell/celldb.py - Metric index
agentsg/src/agentsg/cell/neartree.py
Space-group symmetry
- Space groups
agentsg/src/agentsg/space_groups.py - Group settings
agentsg/src/agentsg/setting.py - Hall operations
agentsg/src/agentsg/hall.py - Reflection conditions
agentsg/src/agentsg/reflections.py - Asymmetric units
agentsg/src/agentsg/asu.py - ITA diagrams
agentsg/src/agentsg/cell/diagrams.py
Serial reindexing
- Reindexing ambiguity
agentsg/src/agentsg/cell/ambiguity.py - Canonical operators
agentsg/src/agentsg/cell/canonical.py - Reindexing
agentsg/src/agentsg/cell/reindex.py - Cell manifold
agentsg/src/agentsg/cell/manifold.py - CrystFEL streams
agentsg/src/agentsg/cell/crystfel_stream.py
Data and interface
- PDB database app
agentsg/src/agentsg/cell/pdb_app.py - API handlers
agentsg/src/agentsg/serve/handlers.py - HTTP service
agentsg/src/agentsg/serve/app.py
Other components
- Crystallography user
Connections 19
- Crystallography user → HTTP service: sends requests
- HTTP service → API handlers: dispatches requests
- API handlers → Space groups: resolves groups
- API handlers → Group settings: parses settings
- API handlers → Reflection conditions: computes conditions
- API handlers → Asymmetric units: uses reciprocal ASU
- API handlers → ITA diagrams: renders plates
- API handlers → Cell metrics: builds cell metrics
- API handlers → Niggli reduction: reduces cells
- API handlers → Root invariants: compares roots
- API handlers → Cell database: looks up cells
- HTTP service → Cell database: opens database
- Cell database → Metric index: builds index
- PDB database app → Cell database: builds database
- Space groups → Hall operations: derives operations
- Canonical operators → Reindexing ambiguity: handles reduction flips
- Crystallography user → Canonical operators: requests reindexing
- Crystallography user → CrystFEL streams: provides stream data
- CrystFEL streams → Cell manifold: supports trajectories