Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

feat(core): Implement Configurable, Role-Based Energy Weighting System#38

Merged
TKanX merged 31 commits intomainfrom
feature/37-implement-configurable-role-based-energy-weighting-system
Aug 20, 2025
Merged

feat(core): Implement Configurable, Role-Based Energy Weighting System#38
TKanX merged 31 commits intomainfrom
feature/37-implement-configurable-role-based-energy-weighting-system

Conversation

@TKanX
Copy link
Member

@TKanX TKanX commented Aug 20, 2025

Summary:

Introduces a flexible energy weighting system that allows for fine-grained control over interaction energies based on atom roles (e.g., Backbone, Sidechain, Ligand). Users can now define custom weights for VDW, Coulomb, and H-bond energy components for specific pairs of roles via the main TOML configuration file. This enhancement enables sophisticated energy models, such as up-weighting protein-ligand interactions or down-weighting intra-backbone energies, providing greater control over the optimization process. The Scorer and Forcefield modules have been updated to seamlessly integrate and apply these weights during energy calculations.

Changes:

  • Implemented Energy Weighting System:

    • forcefield/params.rs: Introduced EnergyWeights, WeightRule, and EnergyComponentWeights structs to define the weighting system. The Forcefield struct now includes a weight_map for fast, role-based lookup of weights.
    • config.rs: Added a forcefield.energy-weights section to the CLI configuration schema, allowing users to specify rules like groups = ["Backbone", "Ligand"] with custom vdw, coulomb, and hbond weights.
    • forcefield/scoring.rs: The Scorer now retrieves the appropriate weight for each interacting atom pair based on their AtomRole and applies it to the corresponding energy component.
  • Enhanced CLI and Data Handling:

    • The CLI was updated to recognize and parse the new energy-weights configuration block.

TKanX added 30 commits August 19, 2025 17:01
@TKanX TKanX self-assigned this Aug 20, 2025
Copilot AI review requested due to automatic review settings August 20, 2025 22:31
@TKanX TKanX added the enhancement ✨ New feature or request label Aug 20, 2025
@TKanX TKanX linked an issue Aug 20, 2025 that may be closed by this pull request
12 tasks
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a configurable, role-based energy weighting system that allows users to define custom weights for VDW, Coulomb, and H-bond energy components based on atom roles (Backbone, Sidechain, Ligand, etc.). The system enables sophisticated energy models by allowing fine-grained control over interaction energies between different types of atoms.

  • Added energy weighting infrastructure with EnergyWeights, WeightRule, and EnergyComponentWeights structs
  • Updated Forcefield::load to accept energy weights configuration and build a weight lookup map
  • Modified Scorer to apply role-based weights during energy calculations
  • Enhanced CLI configuration to parse energy-weights rules from TOML files

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/scream-core/src/workflows/place.rs Updated Forcefield loading calls to include energy weights parameter and fixed test setup
crates/scream-core/src/engine/tasks/*.rs Updated test code to include energy weights parameter in Forcefield loading
crates/scream-core/src/engine/config.rs Added energy_weights field to configuration structs and builders
crates/scream-core/src/core/models/atom.rs Enhanced AtomRole with Hash, PartialOrd, Ord traits and FromStr implementation
crates/scream-core/src/core/forcefield/scoring.rs Implemented weight lookup and application logic in energy calculations with comprehensive tests
crates/scream-core/src/core/forcefield/params.rs Added core energy weighting data structures and weight map building logic
crates/scream-cli/src/config.rs Added CLI configuration parsing for energy weights with conversion to core types

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@TKanX TKanX merged commit f74312d into main Aug 20, 2025
2 checks passed
@TKanX TKanX deleted the feature/37-implement-configurable-role-based-energy-weighting-system branch August 20, 2025 22:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Configurable, Role-Based Energy Weighting System

2 participants