topoppi 1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- topoppi-1.1/CHANGELOG.md +18 -0
- topoppi-1.1/CITATION.cff +9 -0
- topoppi-1.1/CONTRIBUTING.md +47 -0
- topoppi-1.1/LICENSE +21 -0
- topoppi-1.1/MANIFEST.in +21 -0
- topoppi-1.1/PKG-INFO +486 -0
- topoppi-1.1/README.md +431 -0
- topoppi-1.1/docs/assets/3ff22687bd403a67cd66caeacc95baee.png +0 -0
- topoppi-1.1/docs/benchmark_schema.md +47 -0
- topoppi-1.1/docs/release_checklist.md +109 -0
- topoppi-1.1/docs/reproducibility.md +73 -0
- topoppi-1.1/environment.yml +32 -0
- topoppi-1.1/pyproject.toml +103 -0
- topoppi-1.1/setup.cfg +4 -0
- topoppi-1.1/src/topoppi/__init__.py +23 -0
- topoppi-1.1/src/topoppi/_version.py +3 -0
- topoppi-1.1/src/topoppi/atlas/__init__.py +0 -0
- topoppi-1.1/src/topoppi/atlas/metrics.py +135 -0
- topoppi-1.1/src/topoppi/benchmarking/__init__.py +4 -0
- topoppi-1.1/src/topoppi/benchmarking/metrics_utils.py +281 -0
- topoppi-1.1/src/topoppi/benchmarking/reporting.py +187 -0
- topoppi-1.1/src/topoppi/benchmarking/runner.py +591 -0
- topoppi-1.1/src/topoppi/cli.py +61 -0
- topoppi-1.1/src/topoppi/config.py +300 -0
- topoppi-1.1/src/topoppi/errors.py +21 -0
- topoppi-1.1/src/topoppi/gui.py +25 -0
- topoppi-1.1/src/topoppi/gui_app/__init__.py +3 -0
- topoppi-1.1/src/topoppi/gui_app/app.py +171 -0
- topoppi-1.1/src/topoppi/gui_app/constants.py +9 -0
- topoppi-1.1/src/topoppi/gui_app/forms.py +249 -0
- topoppi-1.1/src/topoppi/gui_app/plot_mixin.py +167 -0
- topoppi-1.1/src/topoppi/gui_app/ui_mixin.py +1384 -0
- topoppi-1.1/src/topoppi/gui_app/workflow_mixin.py +488 -0
- topoppi-1.1/src/topoppi/install_optcuts.py +164 -0
- topoppi-1.1/src/topoppi/interactions/__init__.py +0 -0
- topoppi-1.1/src/topoppi/interactions/interaction_engine.py +196 -0
- topoppi-1.1/src/topoppi/interactions/metadata.py +31 -0
- topoppi-1.1/src/topoppi/io/__init__.py +0 -0
- topoppi-1.1/src/topoppi/io/io_loader.py +75 -0
- topoppi-1.1/src/topoppi/logging_utils.py +16 -0
- topoppi-1.1/src/topoppi/mesh/__init__.py +0 -0
- topoppi-1.1/src/topoppi/mesh/parameterization.py +516 -0
- topoppi-1.1/src/topoppi/mesh/surface.py +164 -0
- topoppi-1.1/src/topoppi/mesh/topology.py +231 -0
- topoppi-1.1/src/topoppi/optimization/__init__.py +0 -0
- topoppi-1.1/src/topoppi/optimization/optcuts/__init__.py +5 -0
- topoppi-1.1/src/topoppi/optimization/optcuts/joint_optimizer.py +604 -0
- topoppi-1.1/src/topoppi/pipeline.py +160 -0
- topoppi-1.1/src/topoppi/visualization/__init__.py +0 -0
- topoppi-1.1/src/topoppi/visualization/visualizer.py +464 -0
- topoppi-1.1/src/topoppi.egg-info/PKG-INFO +486 -0
- topoppi-1.1/src/topoppi.egg-info/SOURCES.txt +68 -0
- topoppi-1.1/src/topoppi.egg-info/dependency_links.txt +1 -0
- topoppi-1.1/src/topoppi.egg-info/entry_points.txt +4 -0
- topoppi-1.1/src/topoppi.egg-info/requires.txt +38 -0
- topoppi-1.1/src/topoppi.egg-info/top_level.txt +1 -0
- topoppi-1.1/tests/fixtures/1bvk.pdb +6076 -0
- topoppi-1.1/tests/fixtures/prolif_interactions.json +10 -0
- topoppi-1.1/tests/fixtures/tiny_complex.pdb +15 -0
- topoppi-1.1/tests/test_atlas_metrics.py +30 -0
- topoppi-1.1/tests/test_benchmark_reporting.py +14 -0
- topoppi-1.1/tests/test_benchmark_runner_preprocess.py +68 -0
- topoppi-1.1/tests/test_config.py +24 -0
- topoppi-1.1/tests/test_gui_forms.py +112 -0
- topoppi-1.1/tests/test_imports.py +14 -0
- topoppi-1.1/tests/test_install_optcuts.py +66 -0
- topoppi-1.1/tests/test_interaction_engine.py +17 -0
- topoppi-1.1/tests/test_io_loader.py +35 -0
- topoppi-1.1/tests/test_optcuts_optimizer.py +26 -0
- topoppi-1.1/tests/test_topology.py +19 -0
topoppi-1.1/CHANGELOG.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to TopoPPI are documented here.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [1.1] - 2026-05-09
|
|
8
|
+
|
|
9
|
+
- Improved GUI mode switching, sticky run controls, styling, run logs, validation, figure auto-save, manifests, and Matplotlib navigation.
|
|
10
|
+
- Added benchmark `resume`/`new`/`overwrite` modes, worker selection, config fingerprints, and invalid-input reports.
|
|
11
|
+
- Made benchmark preprocessing honor configured chain IDs consistently.
|
|
12
|
+
- Added ProLIF metadata validation and richer single-run reproducibility manifests.
|
|
13
|
+
- Hardened release packaging, PyPI metadata, and OptCuts installation checks.
|
|
14
|
+
- Added the `topoppi-install-optcuts` downloader for Linux x86-64 GitHub release artifacts.
|
|
15
|
+
|
|
16
|
+
## [1.0.0] - 2026-05-08
|
|
17
|
+
|
|
18
|
+
- Initial public release of TopoPPI.
|
topoppi-1.1/CITATION.cff
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use TopoPPI in your research, please cite this software."
|
|
3
|
+
title: "TopoPPI: a geometry-aware platform for visualization and low-distortion mapping of protein–protein interaction interfaces"
|
|
4
|
+
version: "1.1"
|
|
5
|
+
date-released: "2026-05-09"
|
|
6
|
+
repository-code: "https://github.com/GeraltZeroZhong/TopoPPI"
|
|
7
|
+
license: "MIT"
|
|
8
|
+
authors:
|
|
9
|
+
- name: "Shuyu Zhong"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Development Setup
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
conda env create -f environment.yml
|
|
7
|
+
conda activate bio3d
|
|
8
|
+
pip install -e ".[dev,benchmark,interactions,meshio]"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Install OptCuts into the active environment when running the full pipeline:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
bash tools/OptCuts/install_optcuts.sh
|
|
15
|
+
which OptCuts_bin
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Tests
|
|
19
|
+
|
|
20
|
+
Run the lightweight test suite:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
PYTHONPATH=src python -m unittest discover -s tests
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
With pytest installed:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pytest
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Tests that require the external OptCuts binary should be marked `requires_optcuts`.
|
|
33
|
+
Slow or dataset-scale tests should be marked `slow` and must not be required for basic pull-request validation.
|
|
34
|
+
|
|
35
|
+
## Code Style
|
|
36
|
+
|
|
37
|
+
Use English for code, comments, commit messages, and project documentation inside the repository.
|
|
38
|
+
Prefer small, reviewable changes and preserve core algorithm behavior unless a clear bug is identified.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
ruff check src tests
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Fixture Policy
|
|
45
|
+
|
|
46
|
+
Keep default fixtures small, synthetic, and redistributable.
|
|
47
|
+
Do not add downloaded PDB datasets, generated benchmark outputs, or large binary artifacts to the repository.
|
topoppi-1.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Shuyu Zhong
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
topoppi-1.1/MANIFEST.in
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
include LICENSE
|
|
2
|
+
include README.md
|
|
3
|
+
include environment.yml
|
|
4
|
+
include CHANGELOG.md
|
|
5
|
+
include CITATION.cff
|
|
6
|
+
include CONTRIBUTING.md
|
|
7
|
+
recursive-include docs *.md
|
|
8
|
+
recursive-include docs/assets *.png
|
|
9
|
+
include tests/fixtures/1bvk.pdb
|
|
10
|
+
include tests/fixtures/prolif_interactions.json
|
|
11
|
+
include tests/fixtures/tiny_complex.pdb
|
|
12
|
+
recursive-exclude .github *
|
|
13
|
+
recursive-exclude dist *
|
|
14
|
+
recursive-exclude build *
|
|
15
|
+
recursive-exclude *.egg-info *
|
|
16
|
+
recursive-exclude tools/OptCuts OptCuts_bin
|
|
17
|
+
recursive-exclude tests/fixtures *_cutoff*_res*_sigma*_min*_*.png
|
|
18
|
+
recursive-exclude tests/fixtures *_cutoff*_res*_sigma*_min*_*.topoppi.json
|
|
19
|
+
global-exclude __pycache__
|
|
20
|
+
global-exclude *.py[cod]
|
|
21
|
+
global-exclude .DS_Store
|
topoppi-1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: topoppi
|
|
3
|
+
Version: 1.1
|
|
4
|
+
Summary: Protein-protein interaction interface mapping from 3D structures to 2D UV atlases.
|
|
5
|
+
Author: TopoPPI contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/GeraltZeroZhong/TopoPPI
|
|
8
|
+
Project-URL: Repository, https://github.com/GeraltZeroZhong/TopoPPI
|
|
9
|
+
Project-URL: Issues, https://github.com/GeraltZeroZhong/TopoPPI/issues
|
|
10
|
+
Keywords: protein-protein interaction,bioinformatics,surface mesh,uv atlas,computational biology
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
18
|
+
Requires-Python: <3.11,>=3.10
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: numpy>=1.21
|
|
22
|
+
Requires-Dist: scipy>=1.8
|
|
23
|
+
Requires-Dist: biopython>=1.79
|
|
24
|
+
Requires-Dist: scikit-image>=0.19
|
|
25
|
+
Requires-Dist: matplotlib>=3.5
|
|
26
|
+
Requires-Dist: trimesh>=3.10
|
|
27
|
+
Requires-Dist: networkx>=2.8
|
|
28
|
+
Requires-Dist: pillow>=9.0
|
|
29
|
+
Requires-Dist: rtree>=1.0
|
|
30
|
+
Requires-Dist: shapely>=1.8
|
|
31
|
+
Requires-Dist: libigl<2.7,>=2.6
|
|
32
|
+
Provides-Extra: benchmark
|
|
33
|
+
Requires-Dist: psutil>=5.9; extra == "benchmark"
|
|
34
|
+
Requires-Dist: tqdm>=4.60; extra == "benchmark"
|
|
35
|
+
Provides-Extra: interactions
|
|
36
|
+
Requires-Dist: MDAnalysis>=2.0; extra == "interactions"
|
|
37
|
+
Requires-Dist: prolif>=2.0; extra == "interactions"
|
|
38
|
+
Requires-Dist: rdkit>=2023.9; extra == "interactions"
|
|
39
|
+
Provides-Extra: meshio
|
|
40
|
+
Requires-Dist: meshio>=5.0; extra == "meshio"
|
|
41
|
+
Provides-Extra: dev
|
|
42
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
43
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
44
|
+
Requires-Dist: pytest-cov>=5.0; extra == "dev"
|
|
45
|
+
Requires-Dist: ruff>=0.4; extra == "dev"
|
|
46
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
47
|
+
Provides-Extra: all
|
|
48
|
+
Requires-Dist: psutil>=5.9; extra == "all"
|
|
49
|
+
Requires-Dist: tqdm>=4.60; extra == "all"
|
|
50
|
+
Requires-Dist: MDAnalysis>=2.0; extra == "all"
|
|
51
|
+
Requires-Dist: prolif>=2.0; extra == "all"
|
|
52
|
+
Requires-Dist: rdkit>=2023.9; extra == "all"
|
|
53
|
+
Requires-Dist: meshio>=5.0; extra == "all"
|
|
54
|
+
Dynamic: license-file
|
|
55
|
+
|
|
56
|
+
# TopoPPI
|
|
57
|
+
|
|
58
|
+
> **Release:** This README targets `topoppi 1.1`. The matching GitHub release tag is `v1.1`.
|
|
59
|
+
|
|
60
|
+
TopoPPI maps **protein-protein interaction (PPI) interfaces** from 3D structures into annotated 2D UV atlases. It is built for interactive inspection, reproducible figure export, and benchmark-style evaluation across structure sets.
|
|
61
|
+
|
|
62
|
+
The toolkit includes:
|
|
63
|
+
|
|
64
|
+
- a **Basic/Advanced Tkinter GUI** for single-structure analysis, interaction styling, benchmark launching, and reproducible export,
|
|
65
|
+
- a **command-line pipeline** for one-shot interface map generation,
|
|
66
|
+
- a **benchmark framework** for multi-structure evaluation with JSON/CSV reports,
|
|
67
|
+
- optional typed interaction annotation through ProLIF, with geometric fallback when no ProLIF data is available.
|
|
68
|
+
|
|
69
|
+
The pipeline loads protein chains from PDB/mmCIF files, builds a receptor surface, extracts interface patches against a partner chain, flattens patches to UV space, optimizes UVs with [**OptCuts**](https://github.com/liminchen/OptCuts), and renders annotated interface maps.
|
|
70
|
+
|
|
71
|
+
<img width="1920" height="1032" alt="TopoPPI GUI showing the Basic workflow and interface map" src="https://raw.githubusercontent.com/GeraltZeroZhong/TopoPPI/v1.1/docs/assets/3ff22687bd403a67cd66caeacc95baee.png" />
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Quick Start (GUI, ~5 minutes)
|
|
76
|
+
|
|
77
|
+
If you only want to launch the GUI and run your first structure quickly:
|
|
78
|
+
|
|
79
|
+
1. Create and activate the Conda environment:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
conda env create -f environment.yml
|
|
83
|
+
conda activate bio3d
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
2. Install TopoPPI in editable mode:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pip install -e ".[benchmark,interactions,meshio]"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
3. Install OptCuts into the active Conda environment:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
topoppi-install-optcuts
|
|
96
|
+
which OptCuts_bin
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Source checkout users can also install the bundled binary directly:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
bash tools/OptCuts/install_optcuts.sh
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
4. Launch GUI:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
topoppi-gui
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
5. In the GUI:
|
|
112
|
+
- Use **Basic** to load a `.pdb`/`.cif` structure file,
|
|
113
|
+
- Review detected chains and use **Swap A/B** if the surface/partner assignment is reversed,
|
|
114
|
+
- Choose which interaction types to display and adjust colors if needed,
|
|
115
|
+
- Click **Run Single Analysis** to generate and auto-save the interface map.
|
|
116
|
+
|
|
117
|
+
> Note: [OptCuts](https://github.com/liminchen/OptCuts) is required by the current pipeline. Running without OptCuts is intentionally unsupported.
|
|
118
|
+
> PyPI wheels do not include the OptCuts binary, but the `topoppi-install-optcuts` command downloads the Linux x86-64 binary from the matching GitHub release and installs it into your active Conda environment or `~/.local/bin`.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Project Overview
|
|
123
|
+
|
|
124
|
+
### Core workflow
|
|
125
|
+
|
|
126
|
+
1. **Load structure data** for Chain A (receptor/surface chain) and Chain B (ligand chain).
|
|
127
|
+
2. **Generate molecular surface** for Chain A.
|
|
128
|
+
3. **Extract interface patches** using a distance cutoff to Chain B atoms.
|
|
129
|
+
4. **Parameterize patches** with LSCM.
|
|
130
|
+
5. **Optimize UV patches** with OptCuts (required in current pipeline).
|
|
131
|
+
6. **Visualize and export** annotated 2D interface maps.
|
|
132
|
+
|
|
133
|
+
### Main entry points
|
|
134
|
+
|
|
135
|
+
- `topoppi`: installed command-line pipeline.
|
|
136
|
+
- `topoppi-gui`: installed Tkinter GUI.
|
|
137
|
+
- `topoppi-install-optcuts`: download and install the Linux x86-64 OptCuts binary from the matching GitHub release.
|
|
138
|
+
- `topoppi.pipeline.run_interface_mapping`: importable single-structure API.
|
|
139
|
+
- `topoppi.benchmarking`: benchmark engine, metrics, aggregation, and CSV/JSON reporting.
|
|
140
|
+
|
|
141
|
+
All user-facing defaults live in `topoppi.config`.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Installation & Requirements
|
|
146
|
+
|
|
147
|
+
### System requirements
|
|
148
|
+
|
|
149
|
+
- Python **3.10** (recommended via Conda)
|
|
150
|
+
- OS with Tk support (for GUI mode)
|
|
151
|
+
- **libigl Python bindings 2.6.x** (package: `igl`)
|
|
152
|
+
- **ProLIF + MDAnalysis are recommended** for automatic typed interaction generation; the GUI can leave ProLIF blank and fall back to geometric heuristics if generation is unavailable
|
|
153
|
+
- **OptCuts binary (`OptCuts_bin`) must be installed** and available in your PATH (or passed via `--optcuts-bin`)
|
|
154
|
+
|
|
155
|
+
### Create environment from a source checkout
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
conda env create -f environment.yml
|
|
159
|
+
conda activate bio3d
|
|
160
|
+
pip install -e ".[benchmark,interactions,meshio]"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The repository includes `pyproject.toml` for standard Python packaging and PyPI publication.
|
|
164
|
+
|
|
165
|
+
### Install from PyPI
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
conda create -n topoppi python=3.10
|
|
169
|
+
conda activate topoppi
|
|
170
|
+
pip install "topoppi[benchmark,interactions,meshio]"
|
|
171
|
+
topoppi-install-optcuts
|
|
172
|
+
which OptCuts_bin
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
For this release, `topoppi-install-optcuts` downloads from the matching GitHub release tag, for example `v1.1`. It currently supports Linux x86-64 release artifacts. On other platforms, build OptCuts manually and set `TOPOPPI_OPTCUTS_BIN=/absolute/path/to/OptCuts_bin`.
|
|
176
|
+
|
|
177
|
+
### Install [OptCuts](https://github.com/liminchen/OptCuts) binary
|
|
178
|
+
|
|
179
|
+
For PyPI installs, use the installed downloader:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
topoppi-install-optcuts
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
From a source checkout, the repository also includes a helper script that installs `tools/OptCuts/OptCuts_bin` into your active Conda environment:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
bash tools/OptCuts/install_optcuts.sh
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
After installation, verify:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
which OptCuts_bin
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
> Required: the current pipeline does **not** support running without [OptCuts](https://github.com/liminchen/OptCuts). You can also set `TOPOPPI_OPTCUTS_BIN=/absolute/path/to/OptCuts_bin`.
|
|
198
|
+
> PyPI source and wheel distributions intentionally do not include `tools/OptCuts`; `topoppi-install-optcuts` downloads the release-provided binary artifact instead.
|
|
199
|
+
|
|
200
|
+
### Python dependencies
|
|
201
|
+
|
|
202
|
+
See `environment.yml` and `pyproject.toml` for the authoritative lists.
|
|
203
|
+
The full Conda environment includes ProLIF/MDAnalysis for automatic interaction generation.
|
|
204
|
+
|
|
205
|
+
Main dependencies include:
|
|
206
|
+
|
|
207
|
+
- `numpy`, `scipy`, `matplotlib`
|
|
208
|
+
- `biopython`, `scikit-image`, `trimesh`, `igl` (**2.6.x**)
|
|
209
|
+
- `networkx`, `rtree`, `shapely`, `pillow`
|
|
210
|
+
- optional interaction extras: `MDAnalysis`, `prolif`, `rdkit`
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Usage
|
|
215
|
+
|
|
216
|
+
### 1) GUI mode
|
|
217
|
+
|
|
218
|
+
Launch the desktop app:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
topoppi-gui
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
GUI supports:
|
|
225
|
+
|
|
226
|
+
- Basic single-file analysis with structure loading, chain preview, A/B swapping, interaction filters, and color controls,
|
|
227
|
+
- Advanced controls for chain IDs, cutoffs, surface parameters, OptCuts export, labels, layout, and output directories,
|
|
228
|
+
- folder-level benchmark runs with explicit `resume`, `new`, and `overwrite` modes,
|
|
229
|
+
- interaction-type filtering, custom colors, and style presets (`Exploration`, `Publication`, `High contrast`),
|
|
230
|
+
- recent input/output path pickers,
|
|
231
|
+
- inline validation before launching a run,
|
|
232
|
+
- staged progress (`Load`, `Surface`, `Patch`, `OptCuts`, `Render`) and cooperative cancellation,
|
|
233
|
+
- optional OptCuts frame export,
|
|
234
|
+
- auto-saved figures and sidecar manifests for reproducibility.
|
|
235
|
+
|
|
236
|
+
### 2) Command-line mode
|
|
237
|
+
|
|
238
|
+
Run the full pipeline on a single PDB/mmCIF structure:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
topoppi <input.pdb|input.cif> [options]
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Example:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
topoppi ./data/1abc.pdb -A A -B B -o interface_map.png --cutoff 9.0 --res 1.0 --sigma 1.5
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### 3) Benchmark mode (via GUI workflow)
|
|
251
|
+
|
|
252
|
+
Select **Benchmark**, choose a folder containing `.pdb` files, select a run mode, and run **Run Benchmark** in GUI.
|
|
253
|
+
Benchmark preprocessing uses the configured surface/partner chain IDs for every file.
|
|
254
|
+
Outputs are written under:
|
|
255
|
+
|
|
256
|
+
- `benchmark_report.json`
|
|
257
|
+
- `benchmark_summary.csv`
|
|
258
|
+
- `benchmark_checkpoint.json` (resume support)
|
|
259
|
+
|
|
260
|
+
### 4) Output artifacts (what gets written)
|
|
261
|
+
|
|
262
|
+
#### Single-run CLI / GUI outputs
|
|
263
|
+
|
|
264
|
+
- Main rendered interface image (default: `interface_map.png`, or your `-o/--output` value)
|
|
265
|
+
- GUI single runs auto-save a figure to the selected save directory and write a `<figure>.topoppi.json` sidecar manifest
|
|
266
|
+
- Auto-generated ProLIF JSON when `--prolif` is not provided (saved as `<input_basename>.<chain_a>-<chain_b>.prolif.json` beside the input file)
|
|
267
|
+
|
|
268
|
+
#### Benchmark outputs
|
|
269
|
+
|
|
270
|
+
- `benchmark_report.json`: full structured report with runtime worker count and config fingerprint
|
|
271
|
+
- `benchmark_summary.csv`: tabular summary for all processed structures
|
|
272
|
+
- `benchmark_checkpoint.json`: resume/checkpoint state
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Configuration
|
|
277
|
+
|
|
278
|
+
### Command-line options (`topoppi`)
|
|
279
|
+
|
|
280
|
+
- `pdb_file`: input structure file (`.pdb` or `.cif`)
|
|
281
|
+
- `-A, --chain-a`: receptor/surface chain ID
|
|
282
|
+
- `-B, --chain-b`: ligand chain ID
|
|
283
|
+
- `--prolif` (`--arpeggio` alias): optional ProLIF JSON path
|
|
284
|
+
- `--cutoff`: interface distance cutoff (Å)
|
|
285
|
+
- `--res`: surface grid resolution (Å)
|
|
286
|
+
- `--sigma`: Gaussian smoothing sigma
|
|
287
|
+
- `-o, --output` (default `interface_map.png`): output image path
|
|
288
|
+
- `--optcuts-bin` (default `OptCuts_bin`): OptCuts executable path/name
|
|
289
|
+
- `--patch-gap`: minimum spacing between charts in global UV atlas
|
|
290
|
+
- `--show`: display the Matplotlib figure after saving
|
|
291
|
+
- `-v, --verbose`: verbose logging
|
|
292
|
+
|
|
293
|
+
CLI defaults are read from `topoppi.config.DEFAULT_RUN_CONFIG`.
|
|
294
|
+
|
|
295
|
+
### Benchmark configuration (`BenchmarkConfig`)
|
|
296
|
+
|
|
297
|
+
`topoppi.config.BenchmarkConfig` defines reusable benchmark settings, including:
|
|
298
|
+
|
|
299
|
+
- input/output roots,
|
|
300
|
+
- chain IDs,
|
|
301
|
+
- nested surface/topology/parameterization/OptCuts configuration,
|
|
302
|
+
- parallelism (`max_workers`),
|
|
303
|
+
- resume behavior (`resume`),
|
|
304
|
+
- minimum patch validity thresholds.
|
|
305
|
+
|
|
306
|
+
### ProLIF behavior
|
|
307
|
+
|
|
308
|
+
If `--prolif` is not provided (or the GUI ProLIF field is left blank), TopoPPI tries to auto-generate `<input_basename>.<chain_a>-<chain_b>.prolif.json` using MDAnalysis + ProLIF. If generation is unavailable or fails, visualization falls back to geometric interaction heuristics.
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Examples
|
|
313
|
+
|
|
314
|
+
### Test fixture: 1BVK
|
|
315
|
+
|
|
316
|
+
The repository includes `tests/fixtures/1bvk.pdb` for smoke tests and reproducible examples.
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
topoppi tests/fixtures/1bvk.pdb -A A -B C -o 1bvk_interface.png
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### CLI: basic run
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
topoppi ./data/complex.pdb -A A -B B -o complex_interface.png
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### CLI: custom OptCuts binary and tighter patch gap
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
topoppi ./data/complex.pdb -A A -B C \
|
|
332
|
+
--optcuts-bin /usr/local/bin/OptCuts_bin \
|
|
333
|
+
--patch-gap 0.05 \
|
|
334
|
+
--output complex_interface_optcuts.png
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### CLI: use existing ProLIF interactions
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
topoppi ./data/complex.pdb -A A -B B \
|
|
341
|
+
--prolif ./data/complex.prolif.json \
|
|
342
|
+
--output complex_with_prolif.png
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Python: run one interface map programmatically
|
|
346
|
+
|
|
347
|
+
```python
|
|
348
|
+
from topoppi.config import TopoPPIRunConfig
|
|
349
|
+
from topoppi.pipeline import run_interface_mapping
|
|
350
|
+
|
|
351
|
+
result = run_interface_mapping(
|
|
352
|
+
TopoPPIRunConfig(
|
|
353
|
+
pdb_file="./data/complex.pdb",
|
|
354
|
+
chain_a="A",
|
|
355
|
+
chain_b="B",
|
|
356
|
+
output_file="complex_interface.png",
|
|
357
|
+
)
|
|
358
|
+
)
|
|
359
|
+
print(result.to_dict())
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### Python: run benchmark programmatically
|
|
363
|
+
|
|
364
|
+
```python
|
|
365
|
+
from dataclasses import replace
|
|
366
|
+
|
|
367
|
+
from topoppi.config import BenchmarkConfig, DEFAULT_RUN_CONFIG
|
|
368
|
+
from topoppi.benchmarking import BenchmarkRunner
|
|
369
|
+
|
|
370
|
+
config = BenchmarkConfig(
|
|
371
|
+
input_folder="./dataset",
|
|
372
|
+
output_root="./benchmark_results",
|
|
373
|
+
chain_a="A",
|
|
374
|
+
chain_b="B",
|
|
375
|
+
surface=replace(DEFAULT_RUN_CONFIG.surface, grid_resolution=1.0, sigma=1.0),
|
|
376
|
+
topology=replace(DEFAULT_RUN_CONFIG.topology, distance_cutoff=9.0),
|
|
377
|
+
optcuts=replace(DEFAULT_RUN_CONFIG.optcuts, optcuts_bin="OptCuts_bin").for_headless(),
|
|
378
|
+
resume=True,
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
runner = BenchmarkRunner(config=config, log_fn=print)
|
|
382
|
+
report = runner.run()
|
|
383
|
+
print(report["summary"])
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
## Project Structure
|
|
389
|
+
|
|
390
|
+
```text
|
|
391
|
+
TopoPPI/
|
|
392
|
+
├─ pyproject.toml # Python package metadata and console scripts
|
|
393
|
+
├─ environment.yml # Conda environment definition
|
|
394
|
+
├─ docs/ # Release and reproducibility notes
|
|
395
|
+
├─ tests/ # Lightweight smoke/unit tests
|
|
396
|
+
├─ tools/
|
|
397
|
+
│ └─ OptCuts/
|
|
398
|
+
│ ├─ OptCuts_bin # Source-checkout convenience executable
|
|
399
|
+
│ ├─ install_optcuts.sh # Installer script for Conda env
|
|
400
|
+
│ ├─ NOTICE.md # Binary provenance and packaging policy
|
|
401
|
+
│ └─ LICENSE.txt # OptCuts license
|
|
402
|
+
└─ src/
|
|
403
|
+
└─ topoppi/
|
|
404
|
+
├─ cli.py # CLI entry point
|
|
405
|
+
├─ config.py # Central runtime, benchmark, GUI, and OptCuts configuration
|
|
406
|
+
├─ install_optcuts.py # Release artifact downloader for OptCuts
|
|
407
|
+
├─ pipeline.py # Importable single-run API
|
|
408
|
+
├─ io/ # PDB/mmCIF loading and chain extraction
|
|
409
|
+
├─ mesh/ # Surface generation, topology, parameterization
|
|
410
|
+
├─ optimization/ # OptCuts-based UV optimization
|
|
411
|
+
├─ interactions/ # ProLIF integration and interaction normalization
|
|
412
|
+
├─ visualization/ # 2D interface rendering
|
|
413
|
+
├─ atlas/ # Atlas metrics
|
|
414
|
+
├─ gui_app/ # GUI mixins and application orchestration
|
|
415
|
+
└─ benchmarking/ # Benchmark runner, metrics, reporting
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
## Troubleshooting
|
|
421
|
+
|
|
422
|
+
### `OptCuts_bin` not found
|
|
423
|
+
|
|
424
|
+
Symptoms:
|
|
425
|
+
- CLI/GUI fails when entering optimization stage
|
|
426
|
+
- `which OptCuts_bin` returns empty
|
|
427
|
+
|
|
428
|
+
Fix:
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
topoppi-install-optcuts
|
|
432
|
+
which OptCuts_bin
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
From a source checkout, this also works:
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
bash tools/OptCuts/install_optcuts.sh
|
|
439
|
+
which OptCuts_bin
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
If still missing, pass an explicit binary path:
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
topoppi <input.pdb|input.cif> -A <chainA> -B <chainB> --optcuts-bin /absolute/path/to/OptCuts_bin
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
### ProLIF/MDAnalysis import errors
|
|
449
|
+
|
|
450
|
+
Symptoms:
|
|
451
|
+
- Import errors for `prolif` or `MDAnalysis`
|
|
452
|
+
|
|
453
|
+
Fix:
|
|
454
|
+
- Recreate environment from `environment.yml`
|
|
455
|
+
- Confirm packages are installed in the active env
|
|
456
|
+
|
|
457
|
+
```bash
|
|
458
|
+
conda env create -f environment.yml
|
|
459
|
+
conda activate bio3d
|
|
460
|
+
python -c "import MDAnalysis, prolif; print('ok')"
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
### `igl` / libigl compatibility issues
|
|
464
|
+
|
|
465
|
+
Symptoms:
|
|
466
|
+
- Import failures or runtime issues in geometry/parameterization stages
|
|
467
|
+
|
|
468
|
+
Fix:
|
|
469
|
+
- Use the project environment and keep `igl` in the documented `2.6.x` range.
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
## Changelog
|
|
474
|
+
|
|
475
|
+
- **v1.1** adds improved GUI workflows, benchmark reporting, reproducibility manifests, PyPI packaging, and one-command Linux x86-64 OptCuts installation.
|
|
476
|
+
- **v1.0.0** is the initial public release of TopoPPI.
|
|
477
|
+
|
|
478
|
+
See [CHANGELOG.md](./CHANGELOG.md) for release history.
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## License
|
|
483
|
+
|
|
484
|
+
This project is distributed under the terms of the **MIT License**. See [LICENSE](./LICENSE).
|
|
485
|
+
|
|
486
|
+
The source checkout includes a Linux x86-64 OptCuts binary for convenience. It is not included in the Python package distribution; see [`tools/OptCuts/NOTICE.md`](./tools/OptCuts/NOTICE.md) and [`tools/OptCuts/LICENSE.txt`](./tools/OptCuts/LICENSE.txt) before redistributing binary artifacts.
|