{"id":50005560,"url":"https://github.com/caltechmsc/dreid-forge","last_synced_at":"2026-05-19T17:12:59.590Z","repository":{"id":327869084,"uuid":"1110256072","full_name":"caltechmsc/dreid-forge","owner":"caltechmsc","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.","archived":false,"fork":false,"pushed_at":"2026-03-28T08:20:51.000Z","size":20861,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-28T12:36:25.386Z","etag":null,"topics":["biochemistry","biology","cheminformatics","chemistry","dna","dreiding","forcefield","forcefield-parameterization","molecular-dynamics","molecule","nucleic-acids","partial-charges","protien","qeq","rna","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caltechmsc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-04T23:44:52.000Z","updated_at":"2026-03-28T08:20:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/caltechmsc/dreid-forge","commit_stats":null,"previous_names":["caltechmsc/dreid-forge"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/caltechmsc/dreid-forge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechmsc%2Fdreid-forge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechmsc%2Fdreid-forge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechmsc%2Fdreid-forge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechmsc%2Fdreid-forge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caltechmsc","download_url":"https://codeload.github.com/caltechmsc/dreid-forge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechmsc%2Fdreid-forge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33225449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T15:49:41.270Z","status":"ssl_error","status_checked_at":"2026-05-19T15:49:22.917Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biochemistry","biology","cheminformatics","chemistry","dna","dreiding","forcefield","forcefield-parameterization","molecular-dynamics","molecule","nucleic-acids","partial-charges","protien","qeq","rna","rust"],"created_at":"2026-05-19T17:12:58.632Z","updated_at":"2026-05-19T17:12:59.582Z","avatar_url":"https://github.com/caltechmsc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DREID-Forge\n\n**DREID-Forge** is a high-performance, pure-Rust library for automated DREIDING force field parameterization. It orchestrates atom typing, partial charge calculation, and potential energy function generation to produce simulation-ready inputs for both biological macromolecules and arbitrary chemical systems—all without leaving the Rust type system.\n\n## Highlights\n\n- **Automated atom typing** — assigns DREIDING atom types (e.g., `C_3`, `O_R`, `N_2`) based on element, hybridization, and local bonding environment via the `dreid-typer` crate.\n- **Flexible charge assignment** — supports global QEq charge equilibration via `cheq`, or hybrid mode combining classical force field charges for biomolecules (AMBER/CHARMM) with QEq for ligands via `ffcharge`.\n- **Embedded QEq for ligands** — polarizes ligand charges based on the surrounding protein electrostatic environment using efficient spatial indexing.\n- **Comprehensive potential generation** — produces bond (harmonic/Morse), angle (cosine/theta-harmonic), torsion, inversion, van der Waals (LJ 12-6/Buckingham), and hydrogen bond potentials.\n- **Format interoperability** — reads PDB, mmCIF, MOL2, and SDF structures with optional biomolecular preparation (cleaning, protonation, solvation); exports to BGF format.\n- **Rust-first ergonomics** — no FFI, no global mutable state, edition 2024, and a carefully designed public API with comprehensive RustDoc documentation.\n\n## Parameterization Pipeline at a Glance\n\n```mermaid\nflowchart LR\n    Input[System] --\u003e Intermediate[IntermediateSystem]\n    Intermediate --\u003e Typer[Atom Typing]\n    Typer --\u003e Charge[Charge Calculation]\n    Charge --\u003e ParamGen[Parameter Generation]\n    ParamGen --\u003e Output[ForgedSystem]\n```\n\n1. **Convert** — `IntermediateSystem::from_system` builds neighbor lists and prepares bonds for physical order assignment.\n2. **Type** — `assign_atom_types` delegates to `dreid-typer` to assign DREIDING atom types and enumerate angles, torsions, and inversions.\n3. **Charge** — `assign_charges` computes partial charges using QEq (global or embedded) or classical force field parameters.\n4. **Generate** — `generate_parameters` produces all bonded and non-bonded potential parameters according to DREIDING rules.\n5. **Output** — The resulting `ForgedSystem` is ready for export to BGF format.\n\n## Quick Start\n\n### For CLI Users\n\nInstall the latest DREID-Forge CLI binary from the [releases page](https://github.com/caltechmsc/dreid-forge/releases) or via `cargo`:\n\n```bash\ncargo install dreid-forge\n```\n\nOnce the `dforge` binary is installed, you can parameterize a molecule in a single step:\n\n```bash\ndforge bio -i input.pdb -o output.bgf\n```\n\nExplore the complete parameterization pipeline and more options in the [user manual](MANUAL.md) and browse the [examples directory](https://github.com/caltechmsc/dreid-forge/tree/main/examples) for runnable walkthroughs.\n\n### For Library Developers\n\nDREID-Forge is also available as a library crate. Add it to your `Cargo.toml` dependencies:\n\n```toml\n[dependencies]\ndreid-forge = \"0.4.2\"\n```\n\n#### Example: Parameterizing a Molecule\n\n```rust\nuse dreid_forge::{Atom, Bond, BondOrder, Element, System};\nuse dreid_forge::{forge, ForgeConfig, ChargeMethod, QeqConfig, ForgeError};\n\nfn main() -\u003e Result\u003c(), ForgeError\u003e {\n    // Build a water molecule\n    let mut system = System::new();\n    system.atoms.push(Atom::new(Element::O, [0.0, 0.0, 0.0]));\n    system.atoms.push(Atom::new(Element::H, [0.9575, 0.0, 0.0]));\n    system.atoms.push(Atom::new(Element::H, [-0.2399, 0.9272, 0.0]));\n    system.bonds.push(Bond::new(0, 1, BondOrder::Single));\n    system.bonds.push(Bond::new(0, 2, BondOrder::Single));\n\n    // Parameterize with QEq charges\n    let config = ForgeConfig {\n        charge_method: ChargeMethod::Qeq(QeqConfig::default()),\n        ..Default::default()\n    };\n    let forged = forge(\u0026system, \u0026config)?;\n\n    // Inspect results\n    println!(\"Atom types: {:?}\", forged.atom_types);\n    println!(\"Bonds: {}\", forged.potentials.bonds.len());\n    println!(\"Angles: {}\", forged.potentials.angles.len());\n\n    // Oxygen should be negatively charged, hydrogens positive\n    assert!(forged.atom_properties[0].charge \u003c 0.0);\n    assert!(forged.atom_properties[1].charge \u003e 0.0);\n\n    Ok(())\n}\n```\n\n#### Example: Reading PDB and Writing BGF\n\n```rust\nuse std::fs::File;\nuse std::io::{BufReader, BufWriter};\n\nuse dreid_forge::{forge, ForgeConfig};\nuse dreid_forge::io::{BioReader, Format, CleanConfig, ProtonationConfig, write_bgf};\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // Read and prepare a PDB structure\n    let file = File::open(\"protein.pdb\")?;\n    let system = BioReader::new(BufReader::new(file), Format::Pdb)\n        .clean(CleanConfig { remove_water: true, remove_ions: true, ..Default::default() })\n        .protonate(ProtonationConfig::default())\n        .read()?;\n\n    // Parameterize with DREIDING force field\n    let forged = forge(\u0026system, \u0026ForgeConfig::default())?;\n\n    // Write BGF file\n    let mut output = BufWriter::new(File::create(\"system.bgf\")?);\n    write_bgf(\u0026mut output, \u0026forged)?;\n\n    Ok(())\n}\n```\n\n#### Example: Hybrid Charges for Protein-Ligand Systems\n\n```rust\nuse std::fs::File;\nuse std::io::BufReader;\n\nuse dreid_forge::{forge, ForgeConfig, ForgeError};\nuse dreid_forge::{ChargeMethod, HybridConfig, LigandChargeConfig, LigandQeqMethod};\nuse dreid_forge::{ResidueSelector, EmbeddedQeqConfig, QeqConfig};\nuse dreid_forge::io::{BioReader, Format, ProtonationConfig, TopologyConfig};\n\nfn main() -\u003e Result\u003c(), ForgeError\u003e {\n    // Read a protein-ligand complex\n    let file = File::open(\"complex.pdb\").unwrap();\n    let system = BioReader::new(BufReader::new(file), Format::Pdb)\n        .protonate(ProtonationConfig { target_ph: Some(7.4), ..Default::default() })\n        .topology(TopologyConfig::default())\n        .read()\n        .unwrap();\n\n    // Configure hybrid charges:\n    // - Protein: AMBER ff99SB charges\n    // - Ligand at chain A, residue 500: embedded QEq (polarized by protein)\n    let config = ForgeConfig {\n        charge_method: ChargeMethod::Hybrid(HybridConfig {\n            ligand_configs: vec![\n                LigandChargeConfig {\n                    selector: ResidueSelector::new(\"A\", 500, None),\n                    method: LigandQeqMethod::Embedded(EmbeddedQeqConfig {\n                        cutoff_radius: 12.0,  // Include protein atoms within 12 Å\n                        qeq: QeqConfig::default(),\n                    }),\n                },\n            ],\n            ..Default::default()\n        }),\n        ..Default::default()\n    };\n\n    let forged = forge(\u0026system, \u0026config)?;\n\n    // Protein atoms have classical AMBER charges\n    // Ligand atoms have QEq charges polarized by protein environment\n    println!(\"Total atoms: {}\", forged.atom_properties.len());\n\n    Ok(())\n}\n```\n\n\u003e **Tip**: For small molecules without biological context, use `ChemReader` with MOL2 or SDF formats instead.\n\nFor detailed usage instructions and configuration options, refer to the [API Documentation](https://docs.rs/dreid-forge).\n\n## Documentation\n\n- [CLI User Manual](MANUAL.md) — detailed explanation of command-line usage and options.\n- [API Documentation](https://docs.rs/dreid-forge) — comprehensive reference for all public types and functions.\n- [Architecture Overview](ARCHITECTURE.md) — detailed explanation of the internal design, algorithms, and data flow.\n\n## Dependencies\n\n`dreid-forge` builds on several specialized crates:\n\n| Crate                                                   | Purpose                                                                         |\n| ------------------------------------------------------- | ------------------------------------------------------------------------------- |\n| [`dreid-typer`](https://crates.io/crates/dreid-typer)   | DREIDING atom type assignment and topology enumeration                          |\n| [`cheq`](https://crates.io/crates/cheq)                 | Charge equilibration (QEq) solver with embedded field support                   |\n| [`ffcharge`](https://crates.io/crates/ffcharge)         | Classical force field charges for proteins, nucleic acids, water, and ions      |\n| [`dreid-kernel`](https://crates.io/crates/dreid-kernel) | Stateless DREIDING energy/force kernels with precomputed parameters             |\n| [`bio-forge`](https://crates.io/crates/bio-forge)       | Biomolecular structure preparation (cleaning, protonation, solvation, topology) |\n\n## License\n\nThis project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaltechmsc%2Fdreid-forge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaltechmsc%2Fdreid-forge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaltechmsc%2Fdreid-forge/lists"}