Skip to content

topology fixes merged into the main branch#26

Merged
johibuck merged 8 commits into
mainfrom
fix/topology_fixes
Jun 9, 2026
Merged

topology fixes merged into the main branch#26
johibuck merged 8 commits into
mainfrom
fix/topology_fixes

Conversation

@johibuck

@johibuck johibuck commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Fixes following issues:

  • martini-ff problems
  • martini-PYD topology corrected
  • replace function corrected
  • new error messages/info messages for combination that dont make sense
  • amber crosslink exclusions written
  • pr My patches may2026 #25 issues

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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.

Comment thread src/colbuilder/core/topology/crosslink.py Outdated
Comment thread src/colbuilder/colbuilder.py
Comment thread src/colbuilder/core/utils/config.py
Comment thread pyproject.toml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@johibuck johibuck merged commit 89ef658 into main Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants