Skip to content

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

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

barlowa124 wants to merge 159 commits 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.

jackdent and others added 30 commits September 9, 2024 08:45
allways -> always
move ESM to/from GPU once per complex, not once per chain
…reenshot

Update lab.chaidiscovery.com screenshot
Co-authored-by: Alex Rogozhnikov <arogozhnikov@users.noreply.github.com>
Warn user about potentially wrong EntityType
wukevin and others added 28 commits February 24, 2025 14:33
* relax torch version + rework deps
relax torch version, move type-stubs to dev deps, use typer-slim to reduce deps bloat, clean out some commented packages

* suppress complain from mypy
* do not use esm from transformers

* minor
…ies (chaidiscovery#355)

* Fix corner case for templates being enabled with no protein entities

* Fix typo
* Remove threads from kalign; add test

* Update docstring

* Add kalign to pytest
…aidiscovery#368)

* map d-partners to X in sequence

* rm residue corruption logic
…scovery#371)

* Add docstring

* Global template cif cache folder

* Update readme
)

* allow torch 2.7 - tested to work correctly with 2.7.1

* Update requirements.in

---------

Co-authored-by: Alex Rogozhnikov <arogozhnikov@users.noreply.github.com>
…mers + reasonable timeout) (chaidiscovery#410)

* fixed issue where process hangs on reference conformer generation

* autoformat

* suppress complain from mypy

---------

Co-authored-by: Keaun A <kja.working@gmail.com>
…tity names (chaidiscovery#384)

* support [] in addition to ()

* fix

* relax check
* upgrade gemmi

* reorder for compatibility
* relax requirement on numpy

* allow_pickle = False (taming mypy)
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.
@barlowa124

Copy link
Copy Markdown
Author

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

@barlowa124
barlowa124 force-pushed the fix/single-chain-aggregate-score branch from 8bd8ebb to b264987 Compare December 4, 2026 22:05
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

9 participants