Skip to content

Report pTM as aggregate score for single-chain inputs - #431

Open
barlowa124 wants to merge 1 commit into
chaidiscovery:mainfrom
barlowa124:fix/single-chain-aggregate-score
Open

barlowa124 wants to merge 1 commit into
chaidiscovery:mainfrom
barlowa124:fix/single-chain-aggregate-score

Conversation

@barlowa124

@barlowa124 barlowa124 commented Sep 28, 2026 •

Copy link
Copy Markdown

Description

For a single-chain input, interface_ptm is meaningless: its key-token
mask selects other chains, leaving an empty mask and a score of zero.
rank() still blended it into aggregate_score, so single-chain
predictions reported 0.2 * pTM rather than pTM itself.

rank() now counts distinct asym ids first. Multi-chain inputs keep
the existing pTM/ipTM/clash blend. Single-chain inputs aggregate on
complex_ptm alone, still minus the clash penalty so the formula
stays uniform.

Motivation

Fixes #327. scores.npz for single-chain predictions reports
misleadingly low confidence, corrupting sample ranking and any
downstream consumer of aggregate_score.

Test plan

pytest tests/test_ranking.py passes on CPU with no GPU or inference.
The new tests build minimal synthetic inputs (one atom per token, 5A
spacing) covering the single-chain case, where aggregate_score
equals complex_ptm and differs from the old blended value, and the
two-chain case, where the blend is unchanged.

ipTM is undefined when only one chain is present, so the
0.2*pTM + 0.8*ipTM aggregate reported ~0.2*pTM for monomers.
Aggregate on pTM alone when a single asym id exists.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@barlowa124

Copy link
Copy Markdown
Author

Checks are green and the PR is mergeable. Anything blocking review? Happy to adjust.

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.

Small bug for printed confidence scores on single chain proteins

1 participant