feat(cli): Implement DREID-Forge Command-Line Interface#10
Merged
Conversation
…flect CLI implementation
…file format detection
…utputTarget enums
…tom type information
…mmand line progress display
…n, Solvation, and Topology options
…, and lammps submodules
…nd parameterization
…s including Acetaminophen, Aspirin, and others
…for structure images
37 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive CLI tool (dforge) for the DREID-Forge molecular parameterization library, exposing the complete pipeline from structure preparation to force field generation. The implementation follows good practices with modular architecture, proper error handling, and rich user experience features. Key changes also include critical bug fixes in the core library for deterministic atom ordering and robust parsing.
Key Changes:
- Implemented full-featured CLI with
bioandchemsubcommands for different molecular workflows - Replaced
BTreeMapwithIndexMapin topology conversion for deterministic ordering - Fixed edge cases in SDF parsing and BGF writing for Unicode safety
- Added interactive progress reporting and detailed error diagnostics
Reviewed changes
Copilot reviewed 27 out of 68 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/io/util.rs |
Switched to IndexMap for deterministic atom ordering in bio topology conversion |
src/io/sdf/reader.rs |
Fixed potential panics with .get() for safe string slicing |
src/io/mod.rs |
Split LAMMPS format into separate Data and Settings variants |
src/io/bgf/writer.rs |
Fixed truncation to handle Unicode properly with char boundaries |
src/forge/config.rs |
Updated documentation comment for clarity |
src/bin/dforge/main.rs |
CLI entry point with context detection and error handling |
src/bin/dforge/cli.rs |
Comprehensive argument parsing with clap |
src/bin/dforge/commands/ |
Command handlers for bio and chem workflows |
src/bin/dforge/config/ |
Configuration builders mapping CLI args to library types |
src/bin/dforge/io/ |
I/O abstraction layer with format inference |
src/bin/dforge/display/ |
Progress reporting, error display, and summary tables |
src/bin/dforge/util/ |
Text wrapping and truncation utilities |
examples/drugs/ |
Example drug molecules with documentation |
examples/large/ |
Large biomolecule examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Introduced
dforge, a feature-rich command-line interface (CLI) for the DREID-Forge library. This tool exposes the complete parameterization pipeline—from structure preparation to force field generation—through two intuitive subcommands:dforge biofor biological macromolecules anddforge chemfor small molecule chemistry. It includes robust I/O handling, interactive progress reporting, and extensive configuration options for fine-tuning the DREIDING force field application.Changes:
Implemented CLI Architecture:
src/bin/dforgestructure with modular command handlers (commands/bio.rs,commands/chem.rs).clapfor argument parsing with subcommands, aliases (b/c), and grouped help messages.Developed
dforge bioCommand:bio-forgepreparation pipeline: cleaning (water/ions/hetero removal), protonation (pH, His tautomers), and solvation (box size, ion concentration).Developed
dforge chemCommand:Enhanced User Experience:
indicatiffor rich, interactive progress spinners and step completion reporting.Configuration & Flexibility:
CleanConfig,ProtonationConfig,ForgeConfig,LammpsConfig) to CLI flags.Documentation:
MANUAL.mdas a definitive user guide for the CLI.examples/directory.README.mdwith CLI installation and usage instructions.Performance & Refactoring:
BTreeMapwithIndexMapinto_bio_topologyto ensure deterministic atom ordering, critical for reproducible simulations.SDFparsing andBGFwriting.