feat(model): Define Core Data Models and Spatial Algorithms#2
Merged
Conversation
…s, length, and distance calculations
…n, subtraction, dot and cross products, and normalization
…ptimized insertion
…and sidechain overflow
…does not exceed `u32::MAX`
…r negative cell size
2 tasks
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Vec3for fast 3D vector operations andTypeIdxfor atom types.arrayvecdependency for allocation-free inline collections.Molecular Representation:
ResidueTypes with structural metadata (n_atoms,reach, packability).SystemandResiduemodels to manage mobile packable slots and aFixedAtomPool.VdwMatrix,HBondParams).Energy & State Tracking:
Conformationsto efficiently pack and retrieve rotamer coordinates.SelfEnergyTableandPairEnergyTablewith support for dynamic pruning and memory compaction.Spatial Indexing:
SpatialGrid, a uniform cubic grid forFixedAtomswrapper to integrate fixed system atoms with spatial indexing.Graph & Tree Decomposition:
ContactGraphfor modeling residue-residue collision boundaries.JunctionTreeutilizing Maximum Cardinality Search (MCS) and min-fill heuristics for chordal/non-chordal graph decomposition.