Skip to main content

Crate molrs

Crate molrs 

Source
Expand description

§molrs

A Rust library providing core molecular modeling functionality.

§Features

  • Element data and lookup by atomic number or symbol
  • Core data structures, geometry, IO, and neighbor-list algorithms
  • Type-safe molecular representations

§Examples

§Element lookup

use molrs::Element;

// Look up elements by atomic number
let hydrogen = Element::by_number(1).unwrap();
assert_eq!(hydrogen.symbol(), "H");

// Or by symbol (case-insensitive)
let h = Element::by_symbol("h").unwrap();
assert_eq!(h.name(), "Hydrogen");

§Packing (moved to molrs-pack)

use molrs_pack::Molpack;

let mut packer = Molpack::new(None).with_precision(1e-3);
let _ = &mut packer;

Re-exports§

pub use atomistic::Atomistic;
pub use block::Block;
pub use coarsegrain::CoarseGrain;
pub use element::Element;
pub use error::MolRsError;
pub use frame::Frame;
pub use gasteiger::GasteigerCharges;
pub use gasteiger::compute_gasteiger_charges;
pub use gen3d::EmbedAlgorithm;
pub use gen3d::ForceFieldKind;
pub use gen3d::Gen3DOptions;
pub use gen3d::Gen3DReport;
pub use gen3d::Gen3DSpeed;
pub use gen3d::StageKind;
pub use gen3d::StageReport;
pub use gen3d::generate_3d;
pub use hydrogens::add_hydrogens;
pub use hydrogens::implicit_h_count;
pub use hydrogens::remove_hydrogens;
pub use mapping::CGMapping;
pub use mapping::WeightScheme;
pub use molgraph::Atom;
pub use molgraph::AtomId;
pub use molgraph::Bead;
pub use molgraph::Bond;
pub use molgraph::BondId;
pub use molgraph::MolGraph;
pub use molgraph::PropValue;
pub use rings::RingInfo;
pub use rings::find_rings;
pub use stereo::BondStereo;
pub use stereo::TetrahedralStereo;
pub use stereo::assign_bond_stereo_from_3d;
pub use stereo::assign_stereo_from_3d;
pub use stereo::chiral_volume;
pub use stereo::find_chiral_centers;
pub use topology::Topology;
pub use typifier::Typifier;
pub use typifier::mmff::MMFFAtomProp;
pub use typifier::mmff::MMFFEquiv;
pub use typifier::mmff::MMFFParams;
pub use typifier::mmff::MMFFTypifier;
pub use smiles::parse_smarts;
pub use smiles::parse_smiles;
pub use smiles::to_atomistic;
pub use smiles::to_atomistic;
pub use forcefield::xml::read_forcefield_xml;
pub use forcefield::xml::read_forcefield_xml_str;
pub use io::lammps_data::read_lammps_data;
pub use io::pdb::read_pdb_frame;
pub use io::pdb::write_pdb_frame;
pub use io::xyz::read_xyz_frame;
pub use io::xyz::read_xyz_traj;
pub use io::xyz::write_xyz_frame;

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.
compute
Analysis compute modules for molrs molecular simulation.
data
Embedded data files shipped with molrs-core.
element
Element data and basic lookup utilities.
error
Unified error types for the molrs library.
forcefield
Force field definition types.
frame
Frame: a dictionary mapping string keys to heterogeneous Blocks.
gasteiger
Gasteiger-Marsili (1980) iterative electronegativity equalization.
gen3d
3D coordinate generation pipeline for molecular graphs.
hydrogens
Hydrogen addition for molecular graphs.
io
IO modules: readers and format parsers.
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.
neighbors
Neighbor-list algorithms for pairwise distance queries.
potential
Potential energy evaluation traits and kernel registry.
region
Region module exports
rings
Ring detection for molecular graphs.
rotatable
Rotatable bond detection and downstream atom BFS.
smiles
SMILES and SMARTS string parsing.
stereo
Stereochemistry support for molecular graphs.
topology
Graph-based molecular topology using petgraph.
types
Common numeric and geometry type aliases used across the crate.
typifier
Molecular typifiers.