Skip to content

fix(ml): don't require CCD leaving groups when substituting residues - #95

Open
benz0id wants to merge 1 commit into
RosettaCommons:productionfrom
benz0id:fix/undesired-res-token-leaving-atoms
Open

fix(ml): don't require CCD leaving groups when substituting residues#95
benz0id wants to merge 1 commit into
RosettaCommons:productionfrom
benz0id:fix/undesired-res-token-leaving-atoms

Conversation

@benz0id

@benz0id benz0id commented Jul 30, 2026

Copy link
Copy Markdown

📋 PR Checklist

  • This PR is tagged as a draft if it is still under development and not ready for review.

    This avoids auto-triggering the slower tests in the CI and needlessly wasting resources.

  • I have ensured that all my commits follow angular commit message conventions.

  • I have run make format on the codebase before submitting the PR (this autoformats the code and lints it).

  • I have named the PR in angular PR message format as well (c.f. above), with a sensible tag line that summarizes all the changes in the PR.


ℹ️ PR Description

What changes were made and why?

In _map_to_closest_canonical_residue we use a template canonical residue to check if an unwanted residue might be substituted for a canonical. The template canonical residue includes leaving groups, causing it to always fail for residues in a polymer when checking if it subsets the atoms of the residue to be substituted. This fix removes leaving groups from the comparison logic when required.

How were the changes tested?

Regression tests demonstrating both the in-chain and chain-terminus cases. The in-chain tests fail on production and pass with this change. Existing test_filters.py unchanged and still passing.

Additional Notes

This commit contains code written by Claude.

In _map_to_closest_canonical_residue we use a template canonical residue
to check if an unwanted residue might be substituted for a canonical.
The template canonical residue includes leaving groups, causing it to
always fail for residues in a polymer when checking if it subsets the
atoms of the residue to be substituted. This fix removes leaving groups
from the comparison logic when required and adds regression tests
demonstrating both the in-chain and chain-terminus cases.
@rclune
rclune requested a review from nscorley July 30, 2026 15:57
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