Pull Request №695 RosettaCommons/rosetta/main ← lyskov-ai/rosetta/fix/off-by-one-pose-residue-loops
Merge: d10f3af574b60550f256856d5a9742600ce1128b←4b3d46d15a4d313462e17745dd631debe813c3b1
Fix off-by-one bugs in 1-indexed loops over pose residues
----------------
Merge commit message:
Fix off-by-one bugs in 1-indexed loops over pose residues
Replace `i != end` with `i <= end` (or `i != size()` with `i <= size()`)
in several loops that iterate over 1-indexed residue ranges. With the
old condition, the last residue (index == end) was skipped:
* core/pack/task/PackerTask_.cc: pymol-style debug selection output
omitted the last residue.
* protocols/forge/components/BDR.cc:
- the full-atom check used to gate `switch_to_residue_type_set`
skipped the last residue, so a non-full-atom last residue could
bypass conversion and later cause sidechain-restore mismatch.
- the loop building the `RestrictResidueToRepacking` operation
skipped the last residue, so residues outside `new_positions`
at the C-terminus were designed instead of repack-only.
* protocols/fldsgn/BluePrintBDR.cc: same full-atom check bug as BDR.
* protocols/denovo_design/components/StructureData.cc:
`compute_cutpoints` skipped the last residue, dropping a
CUTPOINT_LOWER variant on the C-terminal residue.
* protocols/enzdes/BackboneSampler.cc: the user-requested number of
trials was off by one (e.g. `bb_moves_=1000` actually ran 999).