Skip to content

Fix off-by-one loops + self-distance bug in SEWING/splice/de novo/RNA (split 3/4 of #707) - #732

Open
lyskov-ai wants to merge 1 commit into
RosettaCommons:mainfrom
lyskov-ai:fix/off-by-one-sewing-splice-denovo
Open

Fix off-by-one loops + self-distance bug in SEWING/splice/de novo/RNA (split 3/4 of #707)#732
lyskov-ai wants to merge 1 commit into
RosettaCommons:mainfrom
lyskov-ai:fix/off-by-one-sewing-splice-denovo

Conversation

@lyskov-ai

Copy link
Copy Markdown
Contributor

Summary

One of four PRs splitting #707 (originally a single 35-file off-by-one batch) into coherent, per-subsystem pieces, so each can be reviewed and its regression-test impact assessed independently. #707 is being closed in favor of these four. The split is deliberate — the individual diffs are below the usual bundling threshold — because the changes are behavior-affecting and the maintainer asked to isolate regression-test impact per subsystem.

This PR: SEWING / splice / de novo / RNA structural assembly (10 files). Two related fixes.

Off-by-one in 1-indexed loops (<<=)

The last element was silently skipped:

  • legacy_sewing/conformation/Assembly.cc ×2 — pose_loop_anchors, disconnected_segments; the last segment, which by definition has no next, was skipped — exactly the case the predicate !has_next(i) is meant to catch
  • pose_sewing/movers/BlockwiseAnalysisMover.cc
  • pose_sewing/movers/OmnibusDisulfideAnalysisLabelerMover.cc
  • splice/SampleRotamersFromPDB.cc ×2 — rotamer-deduplication scan
  • splice/SpliceManager.cc — PSSM row check ("go over all the PSSM segments")
  • stepwise/legacy/modeler/rna/StepWiseRNA_WorkingParametersSetup.cc
  • rna/movers/RNAIdealizeMover.ccCoordinateConstraint application
  • denovo_design/components/FoldGraph.cc
  • fldsgn/MatchResidues.cc ×2 — RMSD / superimpose atom-id map build
  • features/strand_assembly/StrandBundleFeatures.cc ×2 — per-atom distance scan

Self-distance copy/paste bug (in the two pose_sewing movers)

pose.residue(upstream_res).xyz(2).distance(pose.residue(upstream_res).xyz(2)) is identically 0, so the <= crit_dist_ gate was always satisfied and the distance filter was a no-op. Corrected the second operand to downstream_res.

Regression tests

This PR touches pose_sewing. The output change is intentional (combined off-by-one + self-distance correction) but results-affecting and warrants scientific sign-off before merge. The other files here are not in the reported changed-test set.

… RNA)

Split from RosettaCommons#707. Two related fixes in structural-assembly / design code.

Off-by-one in 1-indexed loops (< -> <=), last element was silently skipped:
- legacy_sewing/conformation/Assembly.cc x2  (pose_loop_anchors,
  disconnected_segments -- the last segment, which by definition has no next,
  was skipped, exactly the case '!has_next(i)' is meant to catch)
- pose_sewing/movers/BlockwiseAnalysisMover.cc
- pose_sewing/movers/OmnibusDisulfideAnalysisLabelerMover.cc
- splice/SampleRotamersFromPDB.cc x2  (rotamer-deduplication scan)
- splice/SpliceManager.cc  (PSSM row check -- 'go over all the PSSM segments')
- stepwise/legacy/modeler/rna/StepWiseRNA_WorkingParametersSetup.cc
- rna/movers/RNAIdealizeMover.cc  (CoordinateConstraint application)
- denovo_design/components/FoldGraph.cc
- fldsgn/MatchResidues.cc x2  (RMSD/superimpose atom-id map build)
- features/strand_assembly/StrandBundleFeatures.cc x2  (per-atom distance scan)

Self-distance copy/paste bug in the two pose_sewing movers:
'pose.residue(upstream_res).xyz(2).distance(pose.residue(upstream_res).xyz(2))'
is identically 0, so the '<= crit_dist_' gate was always satisfied and the
distance filter was a no-op. Corrected the second operand to downstream_res.

Note: the pose_sewing regression test output changes with this batch; the
change is intentional and warrants scientific sign-off before merge.

@roccomoretti roccomoretti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, pending updates to the OmnibusDisulfideAnalysisLabelerMover unit test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants