Skip to content

Refactor Charge Engine for Hybrid Biological Electrostatics #11

@TKanX

Description

@TKanX

Description:

This task overhauls the forge module to support heterogeneous charge distribution strategies, a critical requirement for accurate protein-ligand modeling. The current uniform QEq approach is replaced with a component-aware system that applies standard force field charges (AMBER/CHARMM via ffcharge) to proteins and nucleic acids, while utilizing cheq v0.5.0 to compute environmentally polarized charges for ligands. This "electrostatic embedding" approach allows dreid-forge to generate simulation parameters where the ligand's electronic structure dynamically responds to the protein's electrostatic field. The engine will now intelligently discriminate between macromolecular residues, ions, and arbitrary ligands to apply the most physically appropriate electrostatic model to each component of the system.

Tasks:

  • Phase 1: Dependencies and Configuration Update

    • Update cheq to v0.5.0 in Cargo.toml.
    • Add ffcharge v0.2.0 as a new dependency.
    • In src/forge/config.rs:
      • Expand ChargeMethod enum to support new variants: Amber (with version selection), Charmm (with version selection), and Hybrid (custom composite strategies).
      • Update ForgeConfig to handle component-specific charge settings.
  • Phase 2: Component Segmentation Logic

    • In src/forge/intermediate.rs:
      • Enhance IntermediateAtom or IntermediateSystem to explicitly track component categories (Protein, Nucleic, Ion, Ligand) derived from input BioMetadata.
      • Implement filtering logic to extract subsets of atoms (e.g., "get all protein atoms", "get all ligand atoms") for separate processing.
  • Phase 3: Force Field Charge Integration

    • In src/forge/charge.rs:
      • Implement adapter for ffcharge: Map internal residues (ALA, TRP...) and atom names to ffcharge lookups.
      • Handle terminal residues (N-term/C-term, 5'/3'-end) and protonation states correctly during lookup.
      • Implement logic to assign fixed charges to Ions.
  • Phase 4: Polarized Ligand Charge Calculation

    • In src/forge/charge.rs:
      • Implement the "Environment Extraction": Convert assigned protein/ion charges into cheq::PointCharge objects.
      • Construct cheq::ExternalPotential from the environment.
      • Update the QEq caller to use solver.solve_in_field() for ligand atoms when the hybrid mode is active.
  • Phase 5: Pipeline Orchestration & API

    • In src/forge/mod.rs:
      • Update the main forge function to execute the charge phases in order: Fixed Components (Protein/Ions) -> Environment Construction -> Variable Components (Ligand QEq).
      • Ensure non-bonded exclusion rules (if any) are compatible with the new charge mixing.

Metadata

Metadata

Assignees

Labels

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions