Skip to content

feat(model): Define Core Data Models and Spatial Algorithms#2

Merged
TKanX merged 45 commits intomainfrom
feature/1-define-core-data-models-for-dreid-pack
Mar 19, 2026
Merged

feat(model): Define Core Data Models and Spatial Algorithms#2
TKanX merged 45 commits intomainfrom
feature/1-define-core-data-models-for-dreid-pack

Conversation

@TKanX
Copy link
Copy Markdown
Member

@TKanX TKanX commented Mar 19, 2026

Summary:

Established the foundational data structures and algorithms. Introduces high-performance molecular representations, 3D spatial hashing, energy tables, and graph decomposition components essential for the sidechain packing pipeline.

Changes:

  • Core Math & Types:

    • Implemented Vec3 for fast 3D vector operations and TypeIdx for atom types.
    • Added arrayvec dependency for allocation-free inline collections.
  • Molecular Representation:

    • Defined 29 ResidueTypes with structural metadata (n_atoms, reach, packability).
    • Built System and Residue models to manage mobile packable slots and a FixedAtomPool.
    • Added force-field parameter matrices (VdwMatrix, HBondParams).
  • Energy & State Tracking:

    • Created Conformations to efficiently pack and retrieve rotamer coordinates.
    • Implemented SelfEnergyTable and PairEnergyTable with support for dynamic pruning and memory compaction.
  • Spatial Indexing:

    • Developed SpatialGrid, a uniform cubic grid for $O(1)$ neighbor queries.
    • Added FixedAtoms wrapper to integrate fixed system atoms with spatial indexing.
  • Graph & Tree Decomposition:

    • Implemented ContactGraph for modeling residue-residue collision boundaries.
    • Developed JunctionTree utilizing Maximum Cardinality Search (MCS) and min-fill heuristics for chordal/non-chordal graph decomposition.

TKanX added 30 commits March 16, 2026 16:12
…n, subtraction, dot and cross products, and normalization
@TKanX TKanX self-assigned this Mar 19, 2026
Copilot AI review requested due to automatic review settings March 19, 2026 19:41
@TKanX TKanX added the enhancement ✨ New feature or request label Mar 19, 2026
@TKanX TKanX linked an issue Mar 19, 2026 that may be closed by this pull request
2 tasks
Copy link
Copy Markdown

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 lays down the core data structures and algorithms needed for the sidechain packing pipeline: math/types, molecular system representation, energy/state tables, spatial neighbor queries, and graph decomposition primitives.

Changes:

  • Added foundational model types (Vec3, TypeIdx, ResidueType, System/Residue, force-field parameter containers).
  • Implemented packing-support tables (Conformations, SelfEnergyTable, PairEnergyTable) and a fixed-atom spatial wrapper (FixedAtoms + SpatialGrid).
  • Added interaction-graph utilities (ContactGraph) and a junction tree builder (JunctionTree) with MCS/min-fill ordering.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Cargo.toml Adds arrayvec dependency and approx for tests.
src/lib.rs Exposes new top-level model and pack modules.
src/model/mod.rs Declares core model submodules.
src/model/types.rs Introduces Vec3 and TypeIdx primitives used across modeling/packing.
src/model/residue.rs Defines ResidueType metadata (counts, packability, reach).
src/model/system.rs Implements System, Residue, fixed-atom pool, and force-field parameter containers.
src/pack/mod.rs Exposes the pack module.
src/pack/model/mod.rs Declares pack model submodules.
src/pack/model/conformation.rs Adds storage/compaction for candidate sidechain conformations.
src/pack/model/energy.rs Adds self/pair energy tables and self-table pruning/compaction.
src/pack/model/spatial.rs Implements a uniform-grid spatial index for fast neighbor queries.
src/pack/model/fixed.rs Wraps FixedAtomPool with a spatial grid for neighbor enumeration.
src/pack/model/graph.rs Adds a compact contact graph representation for slot interactions.
src/pack/model/junction.rs Implements junction tree construction via elimination ordering heuristics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/model/system.rs Outdated
Comment thread src/pack/model/fixed.rs
Comment thread src/pack/model/spatial.rs
Comment thread src/pack/model/spatial.rs
Copy link
Copy Markdown

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

Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/pack/model/junction.rs
Comment thread src/pack/model/junction.rs
Comment thread src/model/system.rs
Comment thread src/pack/model/conformation.rs
Comment thread src/model/system.rs Outdated
Comment thread src/model/system.rs Outdated
Comment thread src/pack/model/spatial.rs
@TKanX TKanX merged commit 9bd6c3a into main Mar 19, 2026
2 checks passed
@TKanX TKanX deleted the feature/1-define-core-data-models-for-dreid-pack branch March 19, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define Core Data Models for dreid-pack

2 participants