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.

Crash on Placement when include-input-conformation is Enabled #29

@TKanX

Description

@TKanX

Description:

A critical bug causes the application to crash during the side-chain placement workflow whenever the include-input-conformation option is set to true. The error message consistently points to a failure in place_rotamer_on_system, indicating that a Rotamer template is missing a required anchor atom (e.g., 'CA').

This issue arises from a flaw in the data handling pipeline for rotamers extracted from the input MolecularSystem:

  1. Rotamer Extraction: When include-input-conformation is enabled, the RotamerLibrary::include_system_conformations function is called. This function correctly clones atoms from the input system to create new Rotamer objects representing the initial side-chain conformations.

  2. Missing Parameterization: The core of the problem is that these newly extracted Rotamer objects are never parameterized. They are added directly to the RotamerLibrary. As a result, all atoms within these rotamers retain their default AtomRole of Other.

  3. Downstream Failure: Later in the workflow (e.g., during EL energy calculation or clash resolution), the place_rotamer_on_system function receives one of these unparameterized rotamers. When it attempts to find anchor atoms for alignment, its filter for atom.role == AtomRole::Backbone fails because all atoms have the Other role. This leads to an empty set of backbone atoms and triggers the "Anchor atom not found" error, causing the crash.

This bug effectively renders the include-input-conformation feature unusable and prevents workflows that rely on sampling the native conformation.

Tasks:

  • Phase 1: Refactor include_system_conformations to Accept Parameterizer (scream-core/src/core/rotamers/library.rs)

    • Modify the signature of RotamerLibrary::include_system_conformations to accept a reference to the Parameterizer.
    • Inside the function, after a Rotamer is successfully extracted from the system, immediately call parameterizer.parameterize_rotamer on it. This ensures that its atoms are assigned the correct roles (Backbone, Sidechain) and physicochemical properties before it is added to the library.
  • Phase 2: Update Workflow to Pass Parameterizer (scream-core/src/workflows/place.rs)

    • In the main place::run workflow, locate the call to rotamer_library.include_system_conformations.
    • Ensure this call happens after the Parameterizer has been instantiated.
    • Pass the created parameterizer instance into the function call to satisfy the new signature.
  • Phase 3: Enhance Robustness of Rotamer Extraction

    • In extract_rotamer_from_system, implement a robust "consuming pool" logic for handling atoms with duplicate names that may appear in both anchor and sidechain topology lists (e.g., Proline). This should mirror the logic already present in assign_protein_roles_from_pool.
    • Add a final self-check at the end of extract_rotamer_from_system to ensure all required anchor atoms have been successfully extracted into the new Rotamer object, preventing the creation of corrupt templates.

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions