-
Notifications
You must be signed in to change notification settings - Fork 0
Implement Configurable, Role-Based Energy Weighting System #37
Description
Description:
The current energy model, while physically sound for vacuum calculations, exhibits a tendency to over-optimize for internal van der Waals packing. This often leads to conformations where side chains collapse into the protein core rather than forming crucial interactions with external molecules, such as ligands. This behavior stems from a limitation in the scoring function, which treats all non-bonded interactions with equal importance, failing to prioritize biologically critical interactions (e.g., protein-ligand hydrogen bonds) over general intramolecular packing.
To address this and provide users with greater control for specific scientific applications like drug design, a flexible energy weighting system is required. This system will allow for the selective amplification or dampening of specific energy terms (VDW, Coulomb, H-bond) based on the roles of the interacting atoms (Sidechain, Ligand, Backbone, etc.). This enhancement will transform the scoring function from a generic model into a targeted tool capable of producing more biologically relevant structures.
Tasks:
-
Phase 1: Define and Parse Weighting Configuration (
scream-cli/src/config.rs)- In the
config.tomlformat, design a new[forcefield.energy-weights]table that accepts a list of rules. Each rule should specify twoAtomRolegroups and the correspondingvdw,coulomb, andhbondweighting factors. - Implement the necessary
structs (EnergyComponentWeights,WeightRule) withserde::Deserializeto parse this new configuration section. - Implement
FromStrforAtomRoleto allow direct parsing of role names (e.g., "Sidechain") from the configuration string. - Update
PartialPlacementConfigandPlacementConfigto include the new energy weighting rules.
- In the
-
Phase 2: Enhance Scorer to Apply Energy Weights (
scream-core/src/core/forcefield/scoring.rs)- Modify the
Scorerstruct to hold a pre-processedHashMapfor efficient weight lookups. The key for this map should be a canonical (sorted) pair ofAtomRoles. - Update
Scorer::newto accept the parsed weighting rules. It should process these rules into the internalHashMap, ensuring that(RoleA, RoleB)and(RoleB, RoleA)map to the same weights. - In the core calculation loops of
score_interactionandscore_group_internal, for each pair of interacting atoms:- Determine the roles of the two atoms.
- Look up the corresponding weighting factors from the
HashMap. Use a default of1.0if no specific rule is found. - Apply the retrieved factors by multiplying them with the calculated
vdw,coulomb, andhbondenergy components before adding them to the totalEnergyTerm.
- Modify the
-
Phase 3: Integrate Weight Configuration into Workflows (
scream-core)- Update all instantiation points of the
Scorer(primarily within theengine/tasks/*.rsmodules) to pass the new energy weighting rules from theOptimizationContext. - Ensure that the new, weighted energy calculations are used consistently across all stages of the optimization, including
el_energy,clash_detection, anddoublet_optimization.
- Update all instantiation points of the