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

feat(workflows): Implement Standard Sidechain Placement Workflow#21

Merged
TKanX merged 129 commits intomainfrom
feature/18-implement-standard-placement-workflow
Jul 30, 2025
Merged

feat(workflows): Implement Standard Sidechain Placement Workflow#21
TKanX merged 129 commits intomainfrom
feature/18-implement-standard-placement-workflow

Conversation

@TKanX
Copy link
Member

@TKanX TKanX commented Jul 30, 2025

Summary:

Introduces a complete, multi-stage sidechain placement workflow (workflows::place), providing a powerful and configurable method for conformational sampling. The workflow is orchestrated by a new, underlying engine module, which manages configuration, state, and task execution. This feature necessitated a significant refactoring of the forcefield and rotamer modules to support a more robust and performant architecture. Key changes include making the rotamer library self-contained with topology/charge information, caching VDW parameters directly on atoms, and implementing a canonical sorting system for reproducible I/O.

Changes:

  • Implemented the Placement Workflow (workflows::place):

    • A new top-level workflow orchestrates the entire sidechain placement process through distinct, observable phases:
      1. Setup: Loads all necessary resources like the forcefield and rotamer library.
      2. EL Pre-computation: Caches Empty Lattice energies for all possible rotamers against the static backbone.
      3. Initialization: Places initial ground-state rotamers to establish a baseline.
      4. Clash Resolution: Iteratively resolves the most severe steric clashes using doublet optimization.
      5. Simulated Annealing (Optional): Performs a global search to escape local energy minima.
      6. Final Refinement: Conducts a final pass of singlet optimization to refine the best solutions.
  • Refactored Core engine Module:

    • This module provides the foundational components to support the workflow:
    • config.rs: Fluent builders for creating type-safe configurations (PlacementConfig, DesignConfig, etc.).
    • state.rs: An OptimizationState manager using a BinaryHeap to efficiently track the top N solutions.
    • context.rs: A Context struct to centralize access to the system, configuration, and libraries, featuring a robust residue selection resolver (including ligand-binding sites via k-d tree).
    • tasks/: A suite of modular, parallelizable tasks for el_energy, doublet_optimization, clash_detection, and total_energy calculations.
    • placement.rs: Logic for placing rotamers onto a backbone using the Kabsch alignment algorithm.
  • Refactored forcefield, rotamer, and I/O Systems:

    • Decoupled Topology/Charges: Forcefield is now leaner. Topology and charge information is self-contained within the RotamerLibrary definitions, simplifying the data flow.
    • Cached VDW Parameters: Atom structs now cache their VDW parameters (CachedVdwParam), significantly speeding up energy calculations by avoiding repeated lookups.
    • Enhanced Rotamer Library: The rotamer definition now includes internal bond information. The library loader is responsible for the full parameterization of each rotamer upon loading.
    • Canonical I/O Sorting: A new io::sorting module ensures that output files have a deterministic, canonical atom order, making them clean and easily comparable.
  • Added Dependencies and Features:

    • Integrated rayon under a parallel feature flag for high-performance, parallel task execution.
    • Added kiddo for efficient k-d tree spatial lookups.
    • Added itertools, rand, and tracing for advanced iteration, sampling, and logging.

TKanX added 30 commits July 20, 2025 17:10
…ng config and reorganizing placement and design configs
…nContext and improve error handling for empty rotamer lists
TKanX added 23 commits July 28, 2025 11:19
@TKanX TKanX self-assigned this Jul 30, 2025
Copilot AI review requested due to automatic review settings July 30, 2025 03:19
@TKanX TKanX added the enhancement ✨ New feature or request label Jul 30, 2025
@TKanX TKanX linked an issue Jul 30, 2025 that may be closed by this pull request
11 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 introduces bond information to the TOML rotamer library definitions by adding bonds arrays to each rotamer entry. This data provides the internal connectivity information for each rotamer, supporting the enhanced rotamer library functionality described in the PR where topology information is now self-contained within the rotamer definitions.

  • Adds bond connectivity data to all rotamer entries across all amino acid types
  • Bond information is represented as pairs of atom serial numbers defining connectivity
  • All bonds are represented consistently as pairs [atom1_serial, atom2_serial]

@TKanX TKanX merged commit 238b92e into main Jul 30, 2025
3 checks passed
@TKanX TKanX deleted the feature/18-implement-standard-placement-workflow branch July 30, 2025 03:22
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 Standard Placement Workflow

2 participants