Skip to content

Skip HADDOCK restraints without atoms in either direction - #79

Merged
amjjbonvin merged 2 commits into
mainfrom
78-skip-empty-selections
Nov 23, 2026
Merged

amjjbonvin merged 2 commits into
mainfrom
78-skip-empty-selections

Conversation

@amjjbonvin

@amjjbonvin amjjbonvin commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What does this PR do and why?

A HADDOCK restraint whose selections have no atoms in the fixed and scanning chains, in either direction (e.g. on a residue missing from an unbound structure), is skipped with a warning in the log, as CNS does, instead of stopping DisVis with a ValueError. DisVis stops only when all restraints are skipped. parse_restraints/parse_tbl take an optional skipped list with the numbers of the skipped restraints, passed to the report so that its labels keep the numbers of the file. The choice of direction moved to _restraint_masks (complexity limit of parse_tbl).

How was this tested?

  • Unit test: a restraint on a residue missing from the scanning chain is skipped, with the warning and its number; all skipped is still an error. All tests pass, ruff clean.
  • disvis on 2FGR of the protein-peptide benchmark (receptor starting at residue 3, a restraint on residue 2) with the original restraints: restraint 1 skipped, the search and the report run, the report labels restraints 2-11.
  • Not tested: the GPU path (unchanged, parsing only).

AI assistance

Written with Claude Code (Claude Opus 5.5); checked with the tests and the 2FGR run above.

Checklist

  • Tests cover the new and/or changed code
  • Documentation updated if needed (README.md)
  • Reference results in test-cases/*/example-results/ updated if the output changes (no change: no restraint is skipped there)

Related issues

Closes #78. Found in the haddock3 protein-peptide and protein-glycan benchmarks with the disvis module (haddocking/haddock3#1783).

🤖 Generated with Claude Code

A restraint whose selections are not found in the fixed and scanning
chains (e.g. on a residue missing from an unbound structure) is skipped
with a warning, as by CNS, instead of stopping DisVis. The report keeps
the numbers of the restraints in the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@amjjbonvin
amjjbonvin merged commit 470d417 into main Nov 23, 2026
21 checks passed
@amjjbonvin
amjjbonvin deleted the 78-skip-empty-selections branch November 23, 2026 12:06
amjjbonvin added a commit to haddocking/haddock3 that referenced this pull request Nov 23, 2026
DisVis 3.4.2 skips restraints on residues missing from a structure, as
CNS does, instead of stopping (haddocking/disvis#79).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HADDOCK restraints: a selection without atoms stops DisVis instead of being skipped

1 participant