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

Placement Workflow Optimizes Fixed Disulfide Bonds, Leading to Invalid Structures #48

@TKanX

Description

@TKanX

Description:

The current place workflow (workflows::place.rs) treats all Cysteine (CYS/CYX) residues as flexible side-chains, regardless of their bonding state. This is physically incorrect, as a disulfide bond is a strong covalent link that rigidly constrains the side-chain conformations of the two participating residues.

Optimizing these residues using a rotamer library can lead to geometrically invalid or high-energy structures, as the algorithm may attempt to place rotamers that violate the covalent bond geometry in favor of optimizing non-bonded interactions.

This issue stems from the fact that the current implementation's ResidueSelection logic and optimization engine are unaware of this crucial topological feature. They operate solely on a list of residues to optimize, without considering covalent cross-links between them.

The correct approach is to automatically identify these disulfide-bonded Cysteines and treat them as part of the fixed environment, similar to the protein backbone. They should be explicitly excluded from the set of active_residues passed to the optimization engine, as their conformation is a structural constraint, not a variable to be optimized.

Tasks:

  • Implement a new public method find_disulfide_bonded_residues(&self) -> HashSet<ResidueId> on MolecularSystem in core/models/system.rs.
  • This method should iterate through all Cysteine residues (both CYS and CYX), identify their Sulfur-Gamma (SG) atoms, and check for covalent bonds to other SG atoms on different Cysteine residues.
  • Ensure the ResidueType enum and its FromStr implementation in core/models/residue.rs correctly handle the "CYX" three-letter code, mapping it to a distinct variant like CysteineDisulfide for robustness.
  • Modify the workflows::place::run function (specifically, within its setup stage before the main optimization begins).
  • After resolving the initial set of active_residues from the user's configuration, call the new find_disulfide_bonded_residues() method on the input system.
  • Remove any residues found to be in disulfide bonds from the active_residues set before passing it to the engine.
  • Add a tracing::info! or debug! log message to inform the user when residues are automatically excluded from optimization due to their participation in a disulfide bond. This is crucial for transparency.
  • Add unit tests for find_disulfide_bonded_residues to verify it correctly identifies bonded pairs and correctly ignores non-bonded Cysteines.

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

No fields configured for Bug.

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions