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

Copy link
Copy Markdown

Description

ipTM is undefined when the input contains a single chain: interface_ptm masks key tokens to other chains, so the mask is empty and the score is always 0. rank() still blended it into aggregate_score, so a single-chain prediction reported 0.2 * pTM instead of the pTM it should report.

rank() now counts unique asym ids before computing the aggregate. Multi-chain inputs keep the 0.2 * pTM + 0.8 * ipTM - 100 * clash blend. Single-chain inputs aggregate on complex_ptm alone, still minus the clash penalty so the formula stays uniform.

Motivation

Fixes #327. Confidence scores written to scores.npz for single-chain predictions are misleadingly low, which affects ranking of samples and any downstream consumer of aggregate_score.

Test plan

  • New tests/test_ranking.py builds minimal synthetic inputs (one atom per token, atoms spaced 5A apart, batch dim of 1) and asserts:
    • Single chain: aggregate_score == complex_ptm, and differs from 0.2 * pTM (the buggy value).
    • Two chains: aggregate_score == 0.2 * pTM + 0.8 * ipTM, confirming the multi-chain blend is unchanged.
  • pytest tests/test_ranking.py: 2 passed on CPU. No GPU or inference is needed for the ranking path.

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>
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