Skip to main content

Crate molrs

Crate molrs 

Source
Expand description

§molrs

Unified façade for the molrs molecular simulation toolkit.

This crate re-exports the molrs workspace crates under a single namespace. Downstream users add one dependency and opt into sub-systems via features:

molcrafts-molrs = { version = "0.0.11", features = ["io", "smiles"] }

Then:

use molrs::Frame;              // from molrs-core
use molrs::io::read_xyz;       // feature = "io"
use molrs::smiles::parse;      // feature = "smiles"

§Features

  • io — file I/O (PDB, XYZ, LAMMPS, CHGCAR, Cube, Zarr)
  • compute — trajectory analysis (RDF, MSD, clustering, tensors)
  • smiles — SMILES parser
  • ff — force fields (MMFF94, PME, typifier)
  • embed — 3D coordinate generation
  • full — everything above

Core flags forwarded to molrs-core: rayon, zarr, filesystem, blas.

§Molecular packing

The Packmol port lives in the standalone molcrafts-molpack crate (https://github.com/MolCrafts/molpack); add it as a separate dependency when needed.

Modules§

atomistic
All-atom molecular graph with element-level semantics.
block
Block: dict-like keyed arrays with consistent axis-0 length and heterogeneous types.
coarsegrain
Coarse-grained molecular graph.
data
Embedded data files shipped with molrs-core.
element
Element data and basic lookup utilities.
error
Unified error types for the molrs library.
field
Field observables for MolRec-style continuous physical quantities.
frame
Frame: a dictionary mapping string keys to heterogeneous Blocks.
frame_access
Unified access trait for owned and borrowed frame types.
frame_view
Zero-copy borrowed view of a Frame.
gasteiger
Gasteiger-Marsili (1980) iterative electronegativity equalization.
grid
Uniform spatial grid storing multiple named scalar arrays.
hydrogens
Hydrogen addition for molecular graphs.
mapping
AA ↔ CG mapping: coarsen and backmap between Atomistic and CoarseGrain molecular graphs.
math
Small linear algebra helpers with optional BLAS-backed implementation.
molgraph
Dynamic molecular graph for editing-oriented CRUD operations.
molrec
Backend-agnostic MolRec logical model.
neighbors
Neighbor-list algorithms for pairwise distance queries.
region
Region module exports
rings
Ring detection for molecular graphs.
rotatable
Rotatable bond detection and downstream atom BFS.
stereo
Stereochemistry support for molecular graphs.
topology
Graph-based molecular topology using petgraph.
types
Common numeric and geometry type aliases used across the crate.

Structs§

Atom
A dynamic property bag representing an atom (or bead).
AtomId
Stable handle to an atom in a MolGraph.
Atomistic
All-atom molecular graph.
Block
A dictionary from string keys to ndarray arrays with a consistent axis-0 length.
Bond
A bond between two atoms.
BondId
Stable handle to a bond in a MolGraph.
CGMapping
AA ↔ CG mapping definition.
CoarseGrain
Coarse-grained molecular graph.
Frame
A dictionary from string keys to Blocks.
FrameView
A borrowed, read-only view of a Frame.
GasteigerCharges
Computed Gasteiger partial charges for one heavy atom.
Grid
A collection of named scalar arrays on a shared uniform spatial grid.
MolGraph
A dynamic molecular graph supporting ergonomic CRUD for atoms, bonds, angles, and dihedrals.
MolRec
Single logical MolRec object.
ObservableRecord
Named observable with semantic metadata.
RingInfo
All ring information for a MolGraph, produced by find_rings.
Topology
Graph-based molecular topology.
TopologyRingInfo
Ring information from SSSR detection on a Topology graph.
Trajectory
Trajectory-like list of frame states plus shared indexing arrays.
UniformGridField
Uniform real-space grid samples of a scalar field.

Enums§

BondStereo
Double-bond stereochemistry.
Element
Chemical element with complete periodic table (elements 1-118)
MolRsError
Main error type for the molrs library.
ObservableData
Raw observable payload.
ObservableKind
Observable kind aligned with the MolRec metadata contract.
PropValue
Heterogeneous property value stored in an Atom.
TetrahedralStereo
Tetrahedral stereochemistry at an atom.
WeightScheme
How bead positions are computed from constituent atoms.

Traits§

FrameAccess
Unified read-only access for Frame and FrameView.

Functions§

add_hydrogens
Return a new MolGraph with explicit hydrogen atoms added to every heavy atom that has unfilled valence.
assign_bond_stereo_from_3d
Infer E/Z stereochemistry for every double bond from 3-D coordinates.
assign_stereo_from_3d
Infer tetrahedral chirality for every potential stereocentre from 3-D coordinates.
chiral_volume
Compute the signed scalar triple product (chiral volume) at center.
compute_gasteiger_charges
Compute Gasteiger-Marsili (1980) partial charges for every heavy atom in mol.
find_chiral_centers
Return the atom IDs that are potential tetrahedral stereocentres: atoms with exactly 4 distinct neighbour atom IDs.
find_rings
Compute the ring information (SSSR / minimum cycle basis) for mol.
implicit_h_count
Compute the number of hydrogens to add to atom_id.
remove_hydrogens
Return a new MolGraph with all terminal explicit hydrogen atoms removed.

Type Aliases§

Bead
Alias for coarse-grained usage — same type, different prop keys by convention.
SchemaValue
Hierarchical schema node used by meta, method, and parameters.