This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Conversation
…forcefield calculations
…cefield configuration
…proved forcefield handling
…ergy calculations
…r forcefield configuration
12 tasks
Contributor
There was a problem hiding this comment.
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, andEnergyComponentWeightsstructs - Updated
Forcefield::loadto accept energy weights configuration and build a weight lookup map - Modified
Scorerto apply role-based weights during energy calculations - Enhanced CLI configuration to parse
energy-weightsrules 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.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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:
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. TheScorerandForcefieldmodules have been updated to seamlessly integrate and apply these weights during energy calculations.Changes:
Implemented Energy Weighting System:
forcefield/params.rs: IntroducedEnergyWeights,WeightRule, andEnergyComponentWeightsstructs to define the weighting system. TheForcefieldstruct now includes aweight_mapfor fast, role-based lookup of weights.config.rs: Added aforcefield.energy-weightssection to the CLI configuration schema, allowing users to specify rules likegroups = ["Backbone", "Ligand"]with customvdw,coulomb, andhbondweights.forcefield/scoring.rs: TheScorernow retrieves the appropriate weight for each interacting atom pair based on theirAtomRoleand applies it to the corresponding energy component.Enhanced CLI and Data Handling:
energy-weightsconfiguration block.