Skip to content

Explain empty interfaces.csv instead of writing it silently (#17)#19

Merged
DimaMolod merged 1 commit into
mainfrom
fix/empty-interfaces-csv-diagnostics
Jun 16, 2026
Merged

Explain empty interfaces.csv instead of writing it silently (#17)#19
DimaMolod merged 1 commit into
mainfrom
fix/empty-interfaces-csv-diagnostics

Conversation

@DimaMolod

Copy link
Copy Markdown
Collaborator

Problem

Fixes #17. For a small fraction of AF3 heterodimer predictions, process() produced a zero-byte interfaces.csv (no header) while the log still said wrote .../interfaces.csv with no error. A genuine "no interface" result was indistinguishable from a parse/load failure.

Root cause

AlphaJudge only emits interface rows for chain pairs with at least one inter-chain contact within --contact_thresh (default 8 Å, Cβ–Cβ). When AlphaFold places the two chains with no contact at that cutoff, comp.interfaces is empty, rows stays empty, and the old code wrote an empty file silently:

else:
    f.write("")
logger.info(f"wrote {out}")

This is reproducible on re-prediction because those models genuinely have non-contacting chains.

Fix

  • Track lightweight per-run diagnostics (models processed, interfaces detected, interfaces dropped by --pae_filter).
  • When rows is empty, emit a WARNING explaining why the CSV is empty and which knob to relax (e.g. no inter-chain contacts within contact_thresh=8.0 A ... try a larger --contact_thresh).
  • File-write behavior is unchanged (still an empty file) for backward compatibility — only the logging improves.

Test

Adds a regression test that runs the AF3 fixture with a sub-Ångström contact_thresh, asserting the empty CSV plus the explanatory warning. Targeted runner tests pass (4 passed).

🤖 Generated with Claude Code

When no interface row is produced for a run, process() wrote a zero-byte
interfaces.csv (no header) and still logged "wrote .../interfaces.csv" with
no error, making a genuine "no interface" result indistinguishable from a
parse/load failure (issue #17).

The common case for heterodimers is that AlphaFold placed the chains with
no inter-chain contact within --contact_thresh (default 8 A, Cb-Cb), so no
interface is detected and rows is empty.

Track lightweight per-run diagnostics (models processed, interfaces found,
interfaces dropped by --pae_filter) and emit a WARNING explaining why the
CSV is empty and which knob to relax. File-write behavior is unchanged
(still an empty file) for backward compatibility; only the logging improves.

Add a regression test that runs the AF3 fixture with a sub-Angstrom
contact_thresh and asserts the empty CSV plus the explanatory warning.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DimaMolod DimaMolod merged commit 3cc8d72 into main Jun 16, 2026
12 checks passed
@DimaMolod DimaMolod deleted the fix/empty-interfaces-csv-diagnostics branch June 16, 2026 06:24
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.

Alphajudge generating empty interfaces.csv

1 participant