feat(pack): Implement Core Sidechain Packing Algorithm#6
Merged
Conversation
…rogen torsion symmetry
…r instead of vdw_cutoff
…`neighbor_edges` method
…of for atom count
…pdate tests accordingly
…gyTable and PairEnergyTable
7 tasks
There was a problem hiding this comment.
Pull request overview
Implements the core sidechain packing pipeline to solve for a GMEC using a multi-phase workflow (sampling → graph → pruning → pair energies → DEE → DP), with Rayon-based parallelization and new packing-scope selection during IO conversion.
Changes:
- Added rotamer sampling (Dunbrack + polar-H sampling) and contact-graph construction, plus self/pair energy computation and pruning.
- Implemented DEE (Goldstein + Split) and a tree-decomposition DP solver with edge decomposition fallback.
- Introduced parallel spatial indexing and IO-level
PackingScope(Full/Pocket/Interface/List), plus new pack configuration and constants.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pack/phase/sample.rs | Rotamer/polar-H conformation sampling (parallel). |
| src/pack/phase/graph.rs | Builds contact graph using spatial grid queries. |
| src/pack/phase/prune.rs | Computes self energies vs fixed atoms and threshold-prunes candidates. |
| src/pack/phase/pair.rs | Computes pairwise SC–SC energy matrices for contact edges. |
| src/pack/phase/dee.rs | Dead-End Elimination (Goldstein + Split) with absorption of fixed slots. |
| src/pack/phase/dp.rs | Tree-decomposition dynamic programming GMEC solver with edge decomposition fallback. |
| src/pack/phase/mod.rs | Orchestrates the 6-phase pack pipeline and writes back best conformers. |
| src/pack/model/spatial.rs | Parallel SpatialGrid build (AtomicU32) + query iterator changes. |
| src/pack/model/graph.rs | ContactGraph now tracks edge indices; adds neighbor_edges() iterator. |
| src/pack/model/energy.rs | Introduces PRUNED sentinel; adjusts energy table APIs/tests. |
| src/pack/model/conformation.rs | Removes n_atoms() accessor; tests updated to use coords_of().len(). |
| src/pack/model/mod.rs | Removes junction module export. |
| src/pack/model/junction.rs | Deleted junction tree implementation (superseded by DP code in phase). |
| src/pack/energy.rs | Adds VdW/HBond/Coulomb kernels and helpers (dreid-kernel integration). |
| src/pack/constant.rs | Adds cutoffs/constants and max_interaction_cutoff(). |
| src/pack/config.rs | Adds PackConfig defaults and parameters. |
| src/pack/mod.rs | Exposes PackConfig and pack(); internalizes pack submodules. |
| src/model/system.rs | Adds residue ω angle and plumbs it through Residue::new() and accessors. |
| src/model/residue.rs | Updates is_packable() and adds polar_h_period() used by sampling. |
| src/io/config.rs | Adds PackingScope to ReadConfig. |
| src/io/convert.rs | Applies packing scope selection; computes φ/ψ/ω; builds mobile residues accordingly. |
| src/io/error.rs | Adds Error::Scope for packing-scope configuration failures. |
| src/io/mod.rs | Re-exports PackingScope and updates module docs. |
| Cargo.toml | Bumps/sets kernel + rotamer versions and adds rayon. |
💡 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:
Implemented the complete high-performance sidechain packing pipeline to resolve the Global Minimum Energy Conformation (GMEC). The system introduces a highly parallelized 6-phase workflow (Sample, Graph, Prune, Pair, DEE, DP), integrating
rayonfor concurrency, spatial hashing for interaction graphs, anddreid-kernelfor physical energy evaluations. Flexible packing scopes (Pocket, Interface, List) were also added for targeted region repacking.Changes:
phase/): Developed the corepackorchestrator executing 6 parallelized phases:sample,graph,prune(self-energy),pair(pair-energy),dee, anddp.dee.rswith Goldstein and Split criteria) and Tree-Decomposition Dynamic Programming (dp.rswith rank-1 edge decomposition) to exactly or near-exactly solve for the GMEC.sample.rs): Integrated the Dunbrack rotamer library (viarotamercrate) with support for backbonepolar_h_period).energy.rs): Integrateddreid-kernelfor vectorized evaluation of VdW (Lennard-Jones/Buckingham), Hydrogen Bonds, and distance-dependent Coulomb electrostatics.config.rs,convert.rs): AddedPackingScope(Full, Pocket, Interface, List) utilizingrayondependency. UpgradedSpatialGridconstruction (usingAtomicU32) and energy/graph calculations to leverage multi-threading.