Metadata-Version: 2.4
Name: reactifptm
Version: 0.1.0
Summary: A reimplementation of the actifPTM score for assessing AlphaFold-Multimer interface confidence.
Project-URL: Homepage, https://github.com/adamsimpkin/reactifptm
Project-URL: Repository, https://github.com/adamsimpkin/reactifptm
Project-URL: Issues, https://github.com/adamsimpkin/reactifptm/issues
Author-email: Adam Simpkin <adamsimpkin1@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Adam Simpkin
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: actifptm,alphafold,iptm,predicted-aligned-error,protein-structure,structural-biology
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.8
Requires-Dist: gemmi>=0.6
Requires-Dist: numpy>=1.20
Provides-Extra: dev
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# reactifptm

A reimplementation of the **actifpTM** score for assessing AlphaFold-Multimer
interface confidence.

actifpTM is a variant of ipTM that restricts the per-residue alignment score
to **interface contacts** only — pairs of residues whose Cβ–Cβ distance falls
under a contact threshold. This focuses the score on the residues that
actually mediate the predicted interaction.

## Installation

```bash
pip install reactifptm
```

Or, from a clone:

```bash
git clone https://github.com/adamsimpkin/reactifptm
cd reactifptm
pip install -e .
```

## Quickstart

### Command line

```bash
reactifptm scores.json model.pdb -o results.json
```

`scores.json` is a PAE file (any of `.json`, `.npz`,
`.npy`, or `.pkl` containing the predicted aligned error matrix). `model.pdb`
is the corresponding predicted structure (`.pdb` or `.cif`).

Output:

```
reactifpTM: 0.951

pairwise reactifpTM (directional):
  A-B: 0.951
  B-A: 0.940

pairwise reactifpTM (max of both directions):
  A-B: 0.951
```

### Python

```python
from reactifptm import Reactifptm

r = Reactifptm("scores.json", "model.pdb")
overall, pairwise = r.compute_reactifptm()

print(overall)                       # global reactifpTM
print(pairwise)                      # {"A-B": 0.951, "B-A": 0.940}
print(r.reactifptm_pairwise_max)     # {"A-B": 0.951}

r.save_results("results.json")
```

## Output

- **`reactifptm`** — the global reactifpTM score, computed over interface
  contacts across the entire complex.
- **`reactifptm_pairwise`** — directional pairwise scores. `A-B` is the
  best-aligned residue from chain A's perspective onto its partner; `B-A`
  is the same from chain B's side. Useful for diagnosing which side of an
  interface dominates the score.
- **`reactifptm_pairwise_max`** — per unordered pair, the max of the two
  directional scores. This is what you'd typically compare against
  reference single-direction implementations.

## Options

| Flag | Default | Description |
|---|---|---|
| `-t`, `--threshold` | `8.0` | Cβ–Cβ contact threshold in Ångström |
| `-o`, `--output` | — | Path to write JSON results |

## Development

```bash
pip install -e ".[dev]"
pytest
```

The test suite verifies reactifPTM values against reference `actifptm`
fields shipped in `tests/data/`.

## License

MIT — see [LICENSE](LICENSE).
