molex
molex (molecular exchange) is a Rust library for parsing, analyzing, transforming, and serializing molecular structure data. It supports PDB, mmCIF, BinaryCIF, MRC/CCP4 density maps, and DCD trajectories.
Key concepts
-
MoleculeEntityrepresents a single molecule: a protein chain, a DNA/RNA strand, a ligand, an ion, or a group of waters. Parsing a structure file produces aVec<MoleculeEntity>. -
Assemblyis the top-level host container: it owns the entities, cross-entity bonds (disulfides), per-entity DSSP secondary structure, and backbone H-bonds, with a generation counter that increments on every mutation. -
Atomholds a position, element, atom name, occupancy, and B-factor. Residue and chain context live on the entity that contains the atom. -
AtomIdandCovalentBondare the cross-cutting identifiers: bonds reference atoms byAtomId { entity, index }so they remain addressable across reorderings. -
Coordsis a flat binary serialization format used for FFI and IPC.ASSEM01is the entity-aware counterpart that round-trips molecule type metadata. -
Analysis includes covalent bond inference, DSSP hydrogen bond detection, disulfide bridges, secondary structure classification, AABBs, and volumetric/SES utilities.
-
VoxelGridandDensityrepresent 3D volumetric data (electron density, cryo-EM maps).
Crate features
| Feature | Description |
|---|---|
default | Core Rust library (no Python) |
python | PyO3 bindings + AtomWorks interop |
API documentation
For the full Rust API reference, run:
cargo doc --open --document-private-items