Expand description
A high-performance, pure Rust library for automated DREIDING force field parameterization. It orchestrates structure repair, topology perception, and partial atomic charge calculation to produce simulation-ready inputs for both biological macromolecules and arbitrary chemical systems.
§Features
- Atom typing — Automatic assignment of DREIDING atom types based on element, hybridization, and local bonding environment
- Flexible charge calculation — Global QEq, hybrid (classical + QEq), or embedded QEq with environment polarization for ligands in protein complexes
- Parameter generation — Bond, angle, dihedral, improper, van der Waals, and hydrogen bond potentials with multiple functional forms
- Flexible I/O — Read/write PDB, mmCIF, MOL2, SDF formats; export to BGF and LAMMPS simulation input files
§Quick Start
The main entry point is the forge function, which takes a System and
ForgeConfig and produces a fully parameterized ForgedSystem:
use dreid_forge::{System, Atom, Bond, Element, BondOrder};
use dreid_forge::{forge, ForgeConfig, ForgeError};
// Build an ethanol molecule (C₂H₅OH)
let mut system = System::new();
// Atoms: C1 (methyl), C2 (methylene), O, and hydrogens
system.atoms.push(Atom::new(Element::C, [-1.270, 0.248, 0.000])); // C1
system.atoms.push(Atom::new(Element::C, [ 0.139, -0.308, 0.000])); // C2
system.atoms.push(Atom::new(Element::O, [ 1.036, 0.789, 0.000])); // O
system.atoms.push(Atom::new(Element::H, [-1.317, 0.885, 0.883])); // H on C1
system.atoms.push(Atom::new(Element::H, [-1.317, 0.885, -0.883])); // H on C1
system.atoms.push(Atom::new(Element::H, [-2.030, -0.533, 0.000])); // H on C1
system.atoms.push(Atom::new(Element::H, [ 0.358, -0.920, 0.876])); // H on C2
system.atoms.push(Atom::new(Element::H, [ 0.358, -0.920, -0.876])); // H on C2
system.atoms.push(Atom::new(Element::H, [ 1.939, 0.473, 0.000])); // H on O
// Bonds
system.bonds.push(Bond::new(0, 1, BondOrder::Single)); // C1-C2
system.bonds.push(Bond::new(1, 2, BondOrder::Single)); // C2-O
system.bonds.push(Bond::new(0, 3, BondOrder::Single)); // C1-H
system.bonds.push(Bond::new(0, 4, BondOrder::Single)); // C1-H
system.bonds.push(Bond::new(0, 5, BondOrder::Single)); // C1-H
system.bonds.push(Bond::new(1, 6, BondOrder::Single)); // C2-H
system.bonds.push(Bond::new(1, 7, BondOrder::Single)); // C2-H
system.bonds.push(Bond::new(2, 8, BondOrder::Single)); // O-H
// Parameterize with default settings
let forged = forge(&system, &ForgeConfig::default())?;
// Atom types: C_3 (sp³ carbon), O_3 (sp³ oxygen), H_, H_HB (H-bond donor)
assert_eq!(forged.atom_types.len(), 4);
assert!(forged.atom_types.contains(&"C_3".to_string()));
assert!(forged.atom_types.contains(&"O_3".to_string()));
assert!(forged.atom_types.contains(&"H_HB".to_string()));
// Per-atom properties: charge, mass, type index
assert_eq!(forged.atom_properties.len(), 9);
// Bond potentials: C-C, C-O, C-H, O-H
assert_eq!(forged.potentials.bonds.len(), 8);
// Angle potentials: all angles around sp³ centers
assert_eq!(forged.potentials.angles.len(), 13);
// Dihedral potentials: H-C-C-H, H-C-C-O, C-C-O-H, H-C-O-H
assert_eq!(forged.potentials.dihedrals.len(), 12);
// Improper potentials: none for all-sp³ molecule
assert!(forged.potentials.impropers.is_empty());
// VdW pair potentials: n(n+1)/2 = 4×5/2 = 10 pairs
assert_eq!(forged.potentials.vdw_pairs.len(), 10);
// H-bond potential: O_3 as donor/acceptor with H_HB
assert_eq!(forged.potentials.h_bonds.len(), 1);§Module Organization
io— File I/O for molecular structures (PDB, mmCIF, MOL2, SDF, BGF, LAMMPS)forge— Main parameterization functionForgeConfig— Configuration for potential types and charge methods
§Data Types
§Input Structures
System— Molecular system with atoms, bonds, and optional metadataAtom— Single atom with element and Cartesian coordinatesBond— Bond between two atoms with bond orderElement— Chemical element (H through Og)BondOrder— Bond order (Single, Double, Triple, Aromatic)
§Output Structures
ForgedSystem— Fully parameterized system ready for simulationAtomParam— Per-atom charge, mass, and type indexPotentials— Collection of all potential energy functionsBondPotential— Harmonic or Morse bond stretchingAnglePotential— Cosine-harmonic or theta-harmonic bendingDihedralPotential— Periodic torsion potentialsImproperPotential— Planar or umbrella out-of-plane termsVdwPairPotential— Lennard-Jones or Exponential-6 dispersionHBondPotential— Directional hydrogen bond terms
§Configuration
ChargeMethod— None, QEq, or Hybrid charge equilibrationQeqConfig— QEq solver settings (total charge, convergence)HybridConfig— Hybrid biological/QEq charge assignment settingsBondPotentialType— Harmonic vs Morse selectionAnglePotentialType— Cosine-harmonic vs theta-harmonicVdwPotentialType— Lennard-Jones vs Exponential-6
§Biological Metadata
BioMetadata— Per-atom PDB/mmCIF annotationsAtomResidueInfo— Residue name, chain, sequence numberStandardResidue— Standard amino acids and nucleotidesResidueCategory— Standard, hetero, or ion classificationResiduePosition— Terminal position (N/C-terminal, 5’/3’-end)
Modules§
- io
- Molecular structure file I/O operations.
Structs§
- Atom
- A single atom with element type and 3D position.
- Atom
Param - Per-atom force field parameters.
- Atom
Residue Builder - Builder for constructing
AtomResidueInfoinstances. - Atom
Residue Info - Biological annotation for a single atom.
- BioMetadata
- Collection of biological metadata for all atoms in a system.
- Bond
- A chemical bond between two atoms.
- Dihedral
Potential - Proper dihedral (torsion) potential.
- Embedded
QeqConfig - Configuration for embedded QEq calculations.
- Forge
Config - Main configuration for DREIDING force field parameterization.
- Forged
System - A fully parameterized molecular system.
- HBond
Potential - Hydrogen bond directional potential.
- Hybrid
Config - Configuration for hybrid biological/QEq charge assignment.
- Ligand
Charge Config - Charge configuration for a specific ligand residue.
- Parse
Bond Order Error - Error returned when parsing an invalid bond order string.
- Parse
Element Error - Error returned when parsing an invalid or unsupported element symbol.
- Potentials
- Collection of all potential energy functions for a system.
- QeqConfig
- Configuration for QEq charge equilibration.
- Residue
Selector - Residue selector for identifying specific residues.
- Solver
Options - Configuration parameters for the charge equilibration solver.
- System
- A complete molecular system.
Enums§
- Angle
Potential - Angle bending potential functions.
- Angle
Potential Type - Angle bending potential function type.
- Basis
Type - Specifies the type of basis functions used for Coulomb integrals.
- Bond
Order - Bond order classification for chemical bonds.
- Bond
Potential - Bond stretching potential functions.
- Bond
Potential Type - Bond stretching potential function type.
- Charge
Method - Method for calculating partial atomic charges.
- Damping
Strategy - Strategy for damping charge updates during SCF iterations.
- Element
- Chemical element from the periodic table (Z = 1 through 118).
- Forge
Error - Errors that can occur during DREIDING parameterization.
- Improper
Potential - Improper dihedral (out-of-plane) potential functions.
- Ligand
QeqMethod - QEq method variant for ligand charge assignment.
- Nucleic
Scheme - Nucleic acid charge scheme.
- Protein
Scheme - Protein charge scheme.
- Residue
Category - Classification of a residue’s chemical nature.
- Residue
Position - Position of a residue within its polymer chain.
- Standard
Residue - Standard residue types from PDB/mmCIF nomenclature.
- VdwPair
Potential - Van der Waals non-bonded pair potential functions.
- VdwPotential
Type - Van der Waals non-bonded potential function type.
- Water
Scheme - Water charge scheme.
Functions§
- forge
- Parameterizes a molecular system with DREIDING force field parameters.