topology fixes merged into the main branch#26
Merged
Conversation
…tils robustness, install deps
…tils robustness, install deps
Contributor
There was a problem hiding this comment.
Pull request overview
This PR consolidates multiple fixes across geometry, topology (Amber/Martini), and crosslink handling to prevent stale intermediate reuse, improve crosslink/type correctness, and make topology output robust when some models are skipped or connected.
Changes:
- Add cleanup/guardrails to avoid reusing stale caps/PDB intermediates and to prevent duplicate-atom emission in assembled PDBs.
- Improve crosslink parsing/validation (incl. trivalent handling) and fail early on inconsistent crosslink type selections for user-provided PDBs.
- Harden topology generation (Martini/Amber): correct martinize2 invocation, connected-group collapsing, correct include writing, and add Amber crosslink exclusions.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/colbuilder/core/utils/files.py | Add pre-run cleanup for stale geometry/mixing/replacement intermediates. |
| src/colbuilder/core/utils/error_codes.py | Update force-field messaging and add GEO_ERR_008 for type mismatches. |
| src/colbuilder/core/utils/data_structures.py | Extend crosslink position structure for trivalent 3rd-residue second-atom support. |
| src/colbuilder/core/utils/crosslinks.py | Parse/propagate A32 for trivalent crosslinks; emit correct atom32 value. |
| src/colbuilder/core/utils/crosslink_detector.py | Add crosslink-type categorization + PDB-vs-config validation logic. |
| src/colbuilder/core/utils/config.py | Adjust defaults/validators (mixing, fibril_length required-ness, topology requirements). |
| src/colbuilder/core/topology/martini.py | Fix martinize2 invocation/env selection, connected-group collapsing, safer topology includes, TER parsing. |
| src/colbuilder/core/topology/main_topology.py | Restrict cleanup to working topology dir; expand temp patterns. |
| src/colbuilder/core/topology/itp.py | Fix atom-count offsets independent of posres presence. |
| src/colbuilder/core/topology/crosslink.py | Tighten cutoffs and add SC5-LY2 handling for PYD-like crosslinks. |
| src/colbuilder/core/topology/amber.py | Improve molecule block detection; add mapping-failure visibility and crosslink exclusions. |
| src/colbuilder/core/sequence/sequence_generator.py | Fail loudly when crosslinking is enabled but no crosslinks match requested types/combos. |
| src/colbuilder/core/geometry/unpaired_crosslinks.py | Handle multiple unpaired markers per model/type instead of dropping all but the last. |
| src/colbuilder/core/geometry/system.py | Avoid double-writing atoms (body + caps) for the same model. |
| src/colbuilder/core/geometry/optimize.py | Avoid adding unconnected point-reflection “orphan” helices. |
| src/colbuilder/core/geometry/main_geometry.py | Ensure final write uses correct temp dir after mixing; clear stale dirs at run start. |
| src/colbuilder/core/geometry/geometry_replacer.py | Correct LKNL pairing, directory search order, bounds math, and ratio replacement defaults. |
| src/colbuilder/core/geometry/crosslink.py | Fix PDB coordinate column slicing for crosslink coordinate extraction. |
| src/colbuilder/core/geometry/connect.py | Fix external connect file indexing (remove incorrect -1 shifting). |
| src/colbuilder/core/geometry/chimera.py | Log swapaa failures explicitly (avoid silent replacement failures). |
| src/colbuilder/colbuilder.py | Add crosslink-type validation step for input PDBs prior to topology/geometry. |
| README.md | Document ratio_replace_scope and crosslink type validation behavior. |
| pyproject.toml | Adjust numpy constraints and dependency list; add Python 3.12 classifier. |
| docs/user_guide.md | Document ratio_replace_scope. |
| docs/data_dictionary.md | Add ratio_replace_scope parameter documentation. |
| docs/configuration.md | Document ratio_replace_scope and crosslink type validation behavior. |
| config.yaml | Expand configuration reference and update defaults/docs inline. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Fixes following issues: