Skip to content

Fix disulfide bond detection for split cysteines with altlocs - #94

Merged
HatPdotS merged 2 commits into
mainfrom
claude/hopeful-lamport-mebyuj
Oct 22, 2026
Merged

HatPdotS merged 2 commits into
mainfrom
claude/hopeful-lamport-mebyuj

Conversation

@HatPdotS

Copy link
Copy Markdown
Owner

Summary

Disulfide bond detection now correctly handles alternative conformations (altlocs) by ensuring that an SG atom in conformer A only bonds with an SG in conformer A or one without an altloc designation. This prevents incorrect cross-conformer bonds (e.g., A to B) that would artificially pull different conformers together.

Key Changes

  • find_disulfide_links() function: Added optional altloc parameter to filter disulfide pairs based on conformer labels. When both atoms have altloc assignments, they must match to form a bond.
  • build_topology_with_values() function: Updated to pass the altloc column data to find_disulfide_links().
  • Test coverage: Added comprehensive test test_disulfide_bonds_stay_within_one_conformer() that verifies:
    • Split cysteines (with altlocs A and B) correctly bond A-to-A and B-to-B
    • Associated angles and torsions are properly assigned per conformer
    • Includes helper function _split_cys21() to generate test PDB with split cysteines

Implementation Details

The fix modifies the disulfide pair filtering logic to check altloc compatibility:

  • If both SG atoms have non-blank altloc labels, they must be identical to form a bond
  • If either atom lacks an altloc (blank or empty), it can bond with any conformer
  • This preserves the existing behavior for non-split cysteines while correctly handling split cases

The changelog has been updated to document this fix.

https://claude.ai/code/session_016Kt1r7DAxHJxaawQ7HogvG

find_disulfide_links paired SG atoms by distance and residue alone, so
with both cysteines of a bridge split into altlocs, conformer A of one
was bonded to conformer B of the other as well. An SG with an altloc
now pairs only with the same altloc or a blank one, matching the rule
the disulfide angles and torsions already follow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Kt1r7DAxHJxaawQ7HogvG
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T12:59:51.808607Z d26aaae PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Kt1r7DAxHJxaawQ7HogvG
@HatPdotS
HatPdotS merged commit ad0dfe5 into main Oct 22, 2026
13 checks passed
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.

1 participant