Conversation
…iateBond, and IntermediateSystem
… force field parameterization
…d molecular graph construction
…pology generation
…ameter generation
…dral parameterization
…oper parameterization
…aals parameterization
…n bond parameterization
There was a problem hiding this comment.
Pull request overview
This PR implements the core "Forge" engine for DREIDING force field parameterization, establishing a complete pipeline that transforms raw molecular systems into simulation-ready topologies with assigned atom types, charges, and force field parameters. The implementation integrates external libraries for atom typing (dreid-typer) and charge calculation (cheq), and includes comprehensive test coverage across all modules.
Key Changes:
- Implemented complete force field parameterization pipeline with configurable potential types (Harmonic/Morse bonds, ThetaHarmonic/CosineHarmonic angles, LennardJones/Exponential6 VdW)
- Integrated atom typing via dreid-typer and charge assignment via cheq's QEq solver
- Generated systematic parameter assignment for bonds, angles, dihedrals, impropers, VdW pairs, and hydrogen bonds
- Updated BGF writer with fixed-width formatting and atomic mass output
- Added comprehensive unit tests for all forge modules
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib.rs | Exports new forge module to public API |
| src/io/bgf/writer.rs | Updates FORMAT_ATOM to include mass field (f10.5), changes residue_name alignment to left, adds atomic mass output, improves test assertions with column-based validation |
| src/forge/mod.rs | Main forge module exposing forge() function and configuration types; orchestrates typing, charge assignment, and parameter generation |
| src/forge/typer.rs | Bridges IntermediateSystem with dreid-typer library for atom typing and topology analysis |
| src/forge/params.rs | Defines force field parameter structures, loads from embedded TOML or custom overrides, provides torsion parameter lookup |
| src/forge/paramgen.rs | Generates all force field potentials (bonds, angles, dihedrals, impropers, VdW, H-bonds) based on atom types and configuration |
| src/forge/intermediate.rs | Defines IntermediateSystem holding transient data during parameterization (neighbors, charges, hybridization) |
| src/forge/error.rs | Defines forge-specific error types with conversions from external libraries (dreid-typer, cheq) |
| src/forge/config.rs | Defines ForgeConfig with charge methods and potential type selections |
| src/forge/charge.rs | Integrates cheq library for QEq charge assignment with configurable solver options |
| resources/default.params.toml | Official DREIDING force field parameters including atom types, global constants, and H-bond settings |
| Cargo.toml | Updates dependency versions for bio-forge (0.2.1), dreid-typer (0.4.0), and cheq (0.3.0) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…f static references, preventing memory leaks and simplifying ownership for callers
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary:
Implemented the central "Forge" engine responsible for transforming a raw molecular system into a parameterized, simulation-ready topology. This engine orchestrates atom typing (via
dreid-typer), charge assignment (viacheq's QEq solver), and the rigorous mapping of DREIDING force field parameters to bonds, angles, dihedrals, impropers, and non-bonded interactions. Establishes the core computational pipeline for molecular mechanics preparation.Changes:
Implemented Forge Pipeline:
src/forge/mod.rsas the main entry point, exposing theforge()function that drives the parameterization workflow.ForgeConfigto control simulation settings, including potential types (Harmonic/Morse, Cosine/Theta), charge methods, and custom parameters.Integrated Atom Typing:
src/forge/typer.rsto bridgeIntermediateSystemwith thedreid-typerlibrary.Implemented Charge Assignment:
src/forge/charge.rsto integrate thecheqlibrary for electronegativity equalization (QEq).Developed Parameter Generator:
src/forge/paramgen.rsto systematically assign physics parameters based on atom types.Defined Force Field Parameters:
src/forge/params.rsandresources/default.params.tomlcontaining the official DREIDING force field specification (masses, radii, angles, vdW parameters).Created Intermediate Representation:
IntermediateSystemto hold transient data required during the forging process (e.g., neighbors, partial charges, graph connectivity) without polluting the coreSystemmodel.System.Updated BGF Writer:
src/io/bgf/writer.rsto include atomic mass in the output and ensure strict fixed-width formatting, fixing column alignment issues and ensuring compatibility with legacy tools.