boltz2-python-client 0.5.1__tar.gz → 0.6.0__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.
- boltz2_python_client-0.6.0/CHANGELOG.md +233 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/MANIFEST.in +3 -1
- boltz2_python_client-0.6.0/PKG-INFO +221 -0
- boltz2_python_client-0.6.0/README.md +158 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/__init__.py +1 -38
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/cli/__init__.py +7 -1
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/cli/info.py +6 -16
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/cli/msa.py +21 -8
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/cli/predict.py +21 -14
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/cli/screen.py +15 -4
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/client.py +90 -34
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/models.py +97 -49
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/multi_endpoint_client.py +254 -84
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/utils.py +2 -16
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/virtual_screening.py +43 -19
- boltz2_python_client-0.6.0/boltz2_python_client.egg-info/PKG-INFO +221 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_python_client.egg-info/SOURCES.txt +36 -33
- boltz2_python_client-0.6.0/boltz2_python_client.egg-info/requires.txt +38 -0
- boltz2_python_client-0.6.0/docs/a3m_to_multimer_msa.md +39 -0
- boltz2_python_client-0.6.0/docs/affinity_prediction.md +59 -0
- boltz2_python_client-0.6.0/docs/async.md +37 -0
- boltz2_python_client-0.6.0/docs/covalent_complex.md +30 -0
- boltz2_python_client-0.6.0/docs/deployment.md +64 -0
- boltz2_python_client-0.6.0/docs/development.md +93 -0
- boltz2_python_client-0.6.0/docs/migration-0.6.md +62 -0
- boltz2_python_client-0.6.0/docs/msa_search.md +46 -0
- boltz2_python_client-0.6.0/docs/multi_endpoint.md +38 -0
- boltz2_python_client-0.6.0/docs/outputs.md +58 -0
- boltz2_python_client-0.6.0/docs/parameters.md +81 -0
- boltz2_python_client-0.6.0/docs/refresh-review.md +104 -0
- boltz2_python_client-0.6.0/docs/virtual_screening.md +39 -0
- boltz2_python_client-0.6.0/docs/yaml.md +52 -0
- boltz2_python_client-0.6.0/examples/README.md +51 -0
- boltz2_python_client-0.6.0/examples/data/nim_1_9_request.json +8 -0
- boltz2_python_client-0.6.0/examples/msa_search.py +13 -0
- boltz2_python_client-0.6.0/examples/multi_endpoint.py +15 -0
- boltz2_python_client-0.6.0/examples/nim_1_9.py +19 -0
- boltz2_python_client-0.6.0/examples/notebooks/01_protein_prediction.ipynb +196 -0
- boltz2_python_client-0.6.0/examples/notebooks/02_protein_complexes.ipynb +201 -0
- boltz2_python_client-0.6.0/examples/notebooks/03_cdk4_affinity.ipynb +187 -0
- boltz2_python_client-0.6.0/examples/notebooks/04_protein_dna_complex.ipynb +135 -0
- boltz2_python_client-0.6.0/examples/notebooks/05_covalent_ligand.ipynb +137 -0
- boltz2_python_client-0.6.0/examples/paired_msa.py +22 -0
- boltz2_python_client-0.6.0/examples/predict.py +8 -0
- boltz2_python_client-0.6.0/examples/predict_yaml.py +12 -0
- boltz2_python_client-0.6.0/examples/screen.py +18 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/pyproject.toml +14 -5
- boltz2_python_client-0.6.0/pytest.ini +35 -0
- boltz2_python_client-0.6.0/scripts/start_local_nim.sh +35 -0
- boltz2_python_client-0.6.0/scripts/validate_cli.sh +105 -0
- boltz2_python_client-0.6.0/scripts/validate_live_nim.py +65 -0
- boltz2_python_client-0.6.0/scripts/validate_notebooks.py +76 -0
- boltz2_python_client-0.6.0/tests/data/protein_A.a3m +20 -0
- boltz2_python_client-0.6.0/tests/data/protein_A_large.a3m +22 -0
- boltz2_python_client-0.6.0/tests/data/protein_A_large.fasta +2 -0
- boltz2_python_client-0.6.0/tests/data/protein_B.a3m +20 -0
- boltz2_python_client-0.6.0/tests/data/protein_B_large.a3m +22 -0
- boltz2_python_client-0.6.0/tests/data/protein_B_large.fasta +2 -0
- boltz2_python_client-0.6.0/tests/data/sample_protein.a3m +22 -0
- boltz2_python_client-0.6.0/tests/fixtures/nim_1_9_request_schema.json +822 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/tests/test_cli_multi_endpoint.py +45 -53
- boltz2_python_client-0.6.0/tests/test_comprehensive_stress.py +134 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/tests/test_live_endpoints.py +6 -7
- boltz2_python_client-0.6.0/tests/test_live_workflows.py +154 -0
- boltz2_python_client-0.6.0/tests/test_multi_endpoint_reliability.py +317 -0
- boltz2_python_client-0.6.0/tests/test_nim_19.py +243 -0
- boltz2_python_client-0.6.0/tests/test_notebooks.py +95 -0
- boltz2_python_client-0.5.1/CHANGELOG.md +0 -114
- boltz2_python_client-0.5.1/PKG-INFO +0 -324
- boltz2_python_client-0.5.1/README.md +0 -278
- boltz2_python_client-0.5.1/boltz2_python_client.egg-info/PKG-INFO +0 -324
- boltz2_python_client-0.5.1/boltz2_python_client.egg-info/requires.txt +0 -17
- boltz2_python_client-0.5.1/docs/a3m_to_multimer_msa.md +0 -599
- boltz2_python_client-0.5.1/docs/affinity_prediction.md +0 -292
- boltz2_python_client-0.5.1/docs/async.md +0 -510
- boltz2_python_client-0.5.1/docs/covalent_complex.md +0 -213
- boltz2_python_client-0.5.1/docs/msa_search.md +0 -446
- boltz2_python_client-0.5.1/docs/multi_endpoint.md +0 -488
- boltz2_python_client-0.5.1/docs/parameters.md +0 -651
- boltz2_python_client-0.5.1/docs/virtual_screening.md +0 -327
- boltz2_python_client-0.5.1/docs/yaml.md +0 -402
- boltz2_python_client-0.5.1/examples/01_basic_protein_folding.py +0 -53
- boltz2_python_client-0.5.1/examples/02_protein_structure_prediction_with_msa.py +0 -190
- boltz2_python_client-0.5.1/examples/03_protein_ligand_complex.py +0 -237
- boltz2_python_client-0.5.1/examples/04_covalent_bonding.py +0 -203
- boltz2_python_client-0.5.1/examples/05_dna_protein_complex.py +0 -215
- boltz2_python_client-0.5.1/examples/06_yaml_configurations.py +0 -277
- boltz2_python_client-0.5.1/examples/07_advanced_parameters.py +0 -347
- boltz2_python_client-0.5.1/examples/08_affinity_prediction_simple.py +0 -106
- boltz2_python_client-0.5.1/examples/09_virtual_screening.py +0 -226
- boltz2_python_client-0.5.1/examples/10_msa_search_integration.py +0 -382
- boltz2_python_client-0.5.1/examples/11_msa_search_large_protein.py +0 -394
- boltz2_python_client-0.5.1/examples/12_msa_affinity_prediction.py +0 -249
- boltz2_python_client-0.5.1/examples/13_a3m_to_multimer_csv.py +0 -371
- boltz2_python_client-0.5.1/examples/README.md +0 -102
- boltz2_python_client-0.5.1/examples/barnase_barstar_with_msa.py +0 -219
- boltz2_python_client-0.5.1/examples/cdk4_msa_affinity_example.py +0 -312
- boltz2_python_client-0.5.1/examples/comprehensive_multi_endpoint_demo.py +0 -357
- boltz2_python_client-0.5.1/examples/data/cdk2_target.txt +0 -1
- boltz2_python_client-0.5.1/examples/data/cdk4_msa_affinity/cdk4_palbociclib_results.json +0 -23
- boltz2_python_client-0.5.1/examples/data/kinase_y7w_affinity.json +0 -10
- boltz2_python_client-0.5.1/examples/data/msa-kras-g12c_combined.a3m +0 -1178
- boltz2_python_client-0.5.1/examples/data/multi_protein_complex.yaml +0 -10
- boltz2_python_client-0.5.1/examples/data/sars_cov2_mpro_nirmatrelvir.yaml +0 -8
- boltz2_python_client-0.5.1/examples/data/test_msa_endpoint_curl.sh +0 -35
- boltz2_python_client-0.5.1/examples/msa_search_simple_demo.py +0 -217
- boltz2_python_client-0.5.1/examples/multi_endpoint_screening.py +0 -207
- boltz2_python_client-0.5.1/examples/notebooks/01_multimer_prediction.ipynb +0 -687
- boltz2_python_client-0.5.1/examples/notebooks/02_cdk4_msa_affinity_prediction.ipynb +0 -1174
- boltz2_python_client-0.5.1/examples/notebooks/03_colabfold_a3m_to_multimer.ipynb +0 -658
- boltz2_python_client-0.5.1/examples/notebooks/boltz2_comprehensive_demo.ipynb +0 -34
- boltz2_python_client-0.5.1/examples/notebooks/boltz2_demo.ipynb +0 -1106
- boltz2_python_client-0.5.1/examples/notebooks/boltz2_nim_DNA_Protein_Complex_example_py3Dmol.ipynb +0 -937
- boltz2_python_client-0.5.1/examples/notebooks/boltz2_nim_protein_ligand_covalent_complex_molstar_visualization.ipynb +0 -736
- boltz2_python_client-0.5.1/tests/test_comprehensive_stress.py +0 -628
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/LICENSE +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/__main__.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/a3m/__init__.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/a3m/converter.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/a3m/pairing.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/a3m/parser.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/a3m_to_csv_converter.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/data/__init__.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/data/speclist.txt +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/exceptions.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_client/msa_search.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_python_client.egg-info/dependency_links.txt +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_python_client.egg-info/entry_points.txt +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/boltz2_python_client.egg-info/top_level.txt +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/examples/data/protein_ligand.yaml +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/licenses/PyYAML-LICENSE +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/licenses/README.md +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/licenses/aiofiles-LICENSE +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/licenses/aiohttp-LICENSE +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/licenses/click-LICENSE +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/licenses/httpx-LICENSE +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/licenses/py3Dmol-LICENSE +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/licenses/pydantic-LICENSE +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/licenses/rich-LICENSE +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/licenses/typing-extensions-LICENSE +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/setup.cfg +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/tests/__init__.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/tests/conftest.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/tests/constants.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/tests/test_a3m_to_csv_converter.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/tests/test_basic.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/tests/test_examples_syntax.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/tests/test_integration_scenarios.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/tests/test_msa_search.py +0 -0
- {boltz2_python_client-0.5.1 → boltz2_python_client-0.6.0}/tests/test_multi_endpoint_functionality.py +0 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# 0.6.0 — 2026-09-11
|
|
2
|
+
|
|
3
|
+
- Target NIM 1.9.0: diffusion concurrency and affinity embeddings.
|
|
4
|
+
- Correct PAE/PDE documentation to server-side NPZ artifacts.
|
|
5
|
+
- Reject unknown/malformed request fields; accept protein X residues.
|
|
6
|
+
- Fix YAML affinity conversion and missing-MSA handling.
|
|
7
|
+
- Bound hosted polling, preserve HTTP errors, choose hosted URL automatically.
|
|
8
|
+
- Save complete responses, all scores, and affinity embeddings.
|
|
9
|
+
- Refresh notebooks, deployment instructions, examples and release validation.
|
|
10
|
+
- Consolidate seven notebooks into five numbered workflows, fold A3M pairing
|
|
11
|
+
into protein complexes, and move the SageMaker connection example into docs.
|
|
12
|
+
Show actual NIM/client versions, restore the mature barstar sequence, correct
|
|
13
|
+
DNA strand complementarity, and validate supplied MSA query sequences.
|
|
14
|
+
- Require Python 3.10+; make visualization an optional notebook extra.
|
|
15
|
+
- Forward NIM parameters through async/sync multi-endpoint methods.
|
|
16
|
+
- Return a nonzero CLI status when compound screening fails; report unsupported hosted readiness/metadata calls explicitly.
|
|
17
|
+
- Consolidate duplicate examples and guides; validate actual notebook kernels, viewers, Python methods and Bash CLI workflows.
|
|
18
|
+
|
|
19
|
+
# Changelog
|
|
20
|
+
|
|
21
|
+
All notable changes to this project will be documented in this file.
|
|
22
|
+
|
|
23
|
+
## [0.5.2.post1] - 2026-02-24
|
|
24
|
+
|
|
25
|
+
PEP 440 post-release patch on top of `0.5.2`. **No public API changes**;
|
|
26
|
+
fixes a long-standing packaging defect that has been present since
|
|
27
|
+
`0.5.0` (and was carried into `0.5.2` unchanged). Users on a clean
|
|
28
|
+
environment should upgrade to `0.5.2.post1`; users who already have
|
|
29
|
+
`pandas` installed will see no behavior difference.
|
|
30
|
+
|
|
31
|
+
### Fixed — packaging
|
|
32
|
+
- **`import boltz2_client` now works on a clean install.** Previously
|
|
33
|
+
`boltz2_client/virtual_screening.py` did `import pandas as pd` at
|
|
34
|
+
module top, but `pandas` is only declared in the `[dev]` extra (not a
|
|
35
|
+
runtime dependency), so any clean `pip install boltz2-python-client`
|
|
36
|
+
followed by `import boltz2_client` raised
|
|
37
|
+
`ModuleNotFoundError: No module named 'pandas'`. The pandas import is
|
|
38
|
+
now deferred into the four methods that actually need it
|
|
39
|
+
(`CompoundLibrary.from_csv`, `VirtualScreeningResult.to_dataframe`,
|
|
40
|
+
`VirtualScreeningResult.get_top_hits`,
|
|
41
|
+
`VirtualScreeningResult.get_statistics_by_group`); calling any of those
|
|
42
|
+
methods still requires pandas, but importing the package, the CLI,
|
|
43
|
+
and every other code path no longer does. Callers who use the virtual
|
|
44
|
+
screening DataFrame helpers should install with
|
|
45
|
+
`pip install "boltz2-python-client[dev]"` or add `pandas` to their
|
|
46
|
+
own environment.
|
|
47
|
+
- A `from __future__ import annotations` was added to
|
|
48
|
+
`virtual_screening.py` so the `pd.DataFrame` return-type annotations
|
|
49
|
+
on those methods are evaluated lazily and do not require `pandas` at
|
|
50
|
+
import time. Static type checkers and IDEs continue to resolve the
|
|
51
|
+
annotations via a `TYPE_CHECKING` block.
|
|
52
|
+
|
|
53
|
+
## [0.5.2] - 2026-02-24
|
|
54
|
+
|
|
55
|
+
### Fixed — `MultiEndpointClient` reliability
|
|
56
|
+
- **No longer cascades into "All endpoints failed" after a single endpoint glitch.**
|
|
57
|
+
`failed_requests` is now reset on every successful call across all
|
|
58
|
+
`predict_*` methods (`predict`, `predict_sync`, `predict_protein_structure`,
|
|
59
|
+
`predict_protein_ligand_complex`, `predict_covalent_complex`,
|
|
60
|
+
`predict_dna_protein_complex`, `predict_with_advanced_parameters`,
|
|
61
|
+
`predict_from_yaml_config`, `predict_from_yaml_file`, and the
|
|
62
|
+
corresponding `*_sync` variants). Previously a recovered endpoint could
|
|
63
|
+
remain marked unhealthy indefinitely after three transient failures.
|
|
64
|
+
- **`_select_endpoint()` now honours the per-request `attempted_endpoints`
|
|
65
|
+
set.** The `LEAST_LOADED` and `RANDOM` strategies could otherwise re-pick
|
|
66
|
+
the same dead endpoint repeatedly inside a single dispatch loop, wasting
|
|
67
|
+
retries and (on `LEAST_LOADED`) starving healthy endpoints. Round-robin
|
|
68
|
+
also now skips already-attempted endpoints fairly without resetting the
|
|
69
|
+
global rotation counter.
|
|
70
|
+
- **`health_check_sync()` now normalises `HealthStatus` to a boolean.**
|
|
71
|
+
Previously it stored the entire `HealthStatus` object on
|
|
72
|
+
`EndpointStatus.is_healthy`, which is always truthy and broke the sync
|
|
73
|
+
recovery + status-table paths.
|
|
74
|
+
- **Background health-check loop runs an immediate probe at startup.**
|
|
75
|
+
Initial unreachability is now detected without waiting a full
|
|
76
|
+
`health_check_interval` (default 60 s).
|
|
77
|
+
- **Synchronous `__exit__` no longer crashes when no event loop is running.**
|
|
78
|
+
`with MultiEndpointClient(...)` is now safe in plain synchronous code.
|
|
79
|
+
|
|
80
|
+
### Fixed — CLI
|
|
81
|
+
- `boltz2 msa-search`, `boltz2 msa-predict`, and `boltz2 msa-ligand` now
|
|
82
|
+
exit with a non-zero status when the underlying call fails (previously
|
|
83
|
+
they printed the error and exited cleanly, masking failures in pipelines).
|
|
84
|
+
- `boltz2 screen` now reports a clear error if client initialization fails
|
|
85
|
+
or if `--pocket-residues` is malformed, instead of crashing with a stack
|
|
86
|
+
trace before the progress UI starts.
|
|
87
|
+
- Removed a redundant local `import json` inside
|
|
88
|
+
`boltz2 multimer-msa --save-all`; the module-level import is used.
|
|
89
|
+
|
|
90
|
+
### Fixed — virtual screening
|
|
91
|
+
- `VirtualScreening` no longer raises `IndexError` when a prediction
|
|
92
|
+
response comes back with empty `structures`, `confidence_scores`, or
|
|
93
|
+
affinity score lists; missing fields are reported as `None` and the
|
|
94
|
+
campaign continues.
|
|
95
|
+
|
|
96
|
+
### Fixed — async client
|
|
97
|
+
- `Boltz2Client._sagemaker_predict` now uses `asyncio.get_running_loop()`
|
|
98
|
+
instead of the deprecated `asyncio.get_event_loop()` (silences the
|
|
99
|
+
Python 3.10+ `DeprecationWarning` and avoids a future-version hard
|
|
100
|
+
error).
|
|
101
|
+
|
|
102
|
+
### Added
|
|
103
|
+
- **`boltz2 --version` / `boltz2 -V`** prints the installed package
|
|
104
|
+
version (previously the CLI had no version flag).
|
|
105
|
+
|
|
106
|
+
### Removed
|
|
107
|
+
- Dead `_HAS_VISUALIZATION` / `_HAS_ANALYSIS` optional-import scaffolding
|
|
108
|
+
in `boltz2_client/__init__.py` referencing modules that have never
|
|
109
|
+
shipped. The package public surface is unchanged: no name was ever
|
|
110
|
+
successfully exported from those blocks.
|
|
111
|
+
|
|
112
|
+
### Docs
|
|
113
|
+
- Updated the README tagline to accurately describe what ships in the
|
|
114
|
+
package (multi-endpoint load balancing + notebook examples that
|
|
115
|
+
visualize structures with `py3Dmol` and Molstar) instead of claiming a
|
|
116
|
+
non-existent "built-in 3D visualization" module.
|
|
117
|
+
|
|
118
|
+
### Tests
|
|
119
|
+
- Added `tests/test_multi_endpoint_reliability.py` with 11 regression
|
|
120
|
+
tests pinning each of the fixes above. Each test fails on 0.5.1 and
|
|
121
|
+
passes on 0.5.2; the full suite (excluding live-endpoint tests) is now
|
|
122
|
+
134 passing.
|
|
123
|
+
|
|
124
|
+
## [0.5.1] - 2026-04-07
|
|
125
|
+
|
|
126
|
+
### Fixed
|
|
127
|
+
- CLI `metadata` command now shows a clear error for SageMaker endpoints instead of a cryptic `NoneType` error
|
|
128
|
+
- SageMaker endpoint exception handling cleanup in CLI
|
|
129
|
+
|
|
130
|
+
## [0.5.0] - 2026-04-07
|
|
131
|
+
|
|
132
|
+
### Added
|
|
133
|
+
- AWS SageMaker endpoint support (`EndpointType.SAGEMAKER`, CLI `--endpoint-type sagemaker`, `--sagemaker-endpoint-name`, `--sagemaker-region`)
|
|
134
|
+
|
|
135
|
+
### Changed
|
|
136
|
+
- **PocketConstraint API** now uses `Contact` objects (binder + contacts)
|
|
137
|
+
- **Parameter ranges:** `recycling_steps` 1–10, `diffusion_samples` 1–25
|
|
138
|
+
- **`write_full_pde`** support for full predicted distance error matrix output
|
|
139
|
+
- **`Ligand.id`** is optional
|
|
140
|
+
- Compatibility updates for **Boltz-2 NIM v1.6.0**
|
|
141
|
+
|
|
142
|
+
### Fixed
|
|
143
|
+
- Comprehensive test suite fixes and live endpoint tests
|
|
144
|
+
|
|
145
|
+
## [0.4.0] - 2025-11-01
|
|
146
|
+
|
|
147
|
+
### Added
|
|
148
|
+
- A3M to multimer MSA conversion utilities, `multimer-msa` and `convert-msa` CLI commands
|
|
149
|
+
- Example script `13_a3m_to_multimer_csv.py` and guides (`docs/a3m_to_multimer_msa.md`)
|
|
150
|
+
- Multimer notebooks (`01_multimer_prediction.ipynb`, `03_colabfold_a3m_to_multimer.ipynb`) and related example scripts
|
|
151
|
+
- `08_affinity_prediction_simple.py` as the maintained affinity example (with `kinase_y7w_affinity.json`)
|
|
152
|
+
|
|
153
|
+
### Changed
|
|
154
|
+
- Multi-endpoint client default load-balancing strategy documented as **least-loaded**; expanded multi-endpoint coverage across prediction APIs
|
|
155
|
+
- README and guides updated for v1.5 NIM parameter limits (recycling/diffusion), PAE/PDE output, and PDB export
|
|
156
|
+
|
|
157
|
+
### Documentation
|
|
158
|
+
- Multi-endpoint virtual screening guide and examples (`comprehensive_multi_endpoint_demo.py`, `multi_endpoint_screening.py`)
|
|
159
|
+
|
|
160
|
+
## [0.3.0] - 2025-09-11
|
|
161
|
+
|
|
162
|
+
### Added
|
|
163
|
+
- **GPU-accelerated MSA Search NIM Integration**:
|
|
164
|
+
- New `MSASearchClient` for direct MSA Search NIM interaction
|
|
165
|
+
- `MSAFormatConverter` for A3M, FASTA, and Stockholm format support
|
|
166
|
+
- `MSASearchIntegration` for Boltz-2 workflow integration
|
|
167
|
+
- **New Client Methods**:
|
|
168
|
+
- `configure_msa_search()` - Configure MSA Search NIM endpoint
|
|
169
|
+
- `search_msa()` - Standalone MSA search
|
|
170
|
+
- `predict_with_msa_search()` - Integrated MSA + structure prediction
|
|
171
|
+
- `predict_ligand_with_msa_search()` - MSA + ligand + affinity prediction
|
|
172
|
+
- `batch_msa_search()` - Batch processing for multiple sequences
|
|
173
|
+
- **CLI Commands**:
|
|
174
|
+
- `boltz2 msa-search` - Search and save MSA alignments
|
|
175
|
+
- `boltz2 msa-predict` - Combined MSA search + structure prediction
|
|
176
|
+
- `boltz2 msa-ligand` - MSA-guided ligand affinity prediction
|
|
177
|
+
- `--msa-file` option for existing MSA files
|
|
178
|
+
- **Examples**:
|
|
179
|
+
- `10_msa_search_integration.py` - Comprehensive MSA integration demo
|
|
180
|
+
- `11_msa_search_large_protein.py` - Large protein optimization
|
|
181
|
+
- `12_msa_affinity_prediction.py` - MSA-guided affinity prediction
|
|
182
|
+
- **Documentation**:
|
|
183
|
+
- New MSA Search Guide with complete usage examples
|
|
184
|
+
- Updated Affinity Prediction Guide with MSA-guided section
|
|
185
|
+
- Enhanced README with MSA integration examples
|
|
186
|
+
|
|
187
|
+
### Fixed
|
|
188
|
+
- Parameter naming consistency: `max_hits` → `max_msa_sequences`, `e_value_threshold` → `e_value`
|
|
189
|
+
- MSA file handling in `predict_protein_structure()` method
|
|
190
|
+
- Documentation inconsistencies and outdated examples
|
|
191
|
+
|
|
192
|
+
### Improved
|
|
193
|
+
- Better error handling for MSA Search API responses
|
|
194
|
+
- Retry logic for MSA Search requests
|
|
195
|
+
- More comprehensive test coverage
|
|
196
|
+
|
|
197
|
+
## [0.2.1] - 2025-08-14
|
|
198
|
+
|
|
199
|
+
### Added
|
|
200
|
+
- Complete multi-endpoint support for ALL Boltz2 NIM functionalities:
|
|
201
|
+
- `predict_protein_structure()` with MSA support
|
|
202
|
+
- `predict_protein_ligand_complex()` with affinity prediction
|
|
203
|
+
- `predict_covalent_complex()`
|
|
204
|
+
- `predict_dna_protein_complex()`
|
|
205
|
+
- `predict_with_advanced_parameters()`
|
|
206
|
+
- `predict_from_yaml_config()` and `predict_from_yaml_file()`
|
|
207
|
+
- New `msa` parameter in `predict_protein_structure()` for direct MSA input
|
|
208
|
+
- Comprehensive demo notebook (`examples/boltz2_comprehensive_demo.ipynb`) with:
|
|
209
|
+
- Single and multi-endpoint examples
|
|
210
|
+
- Both Python API and CLI demonstrations
|
|
211
|
+
- Advanced features and visualization
|
|
212
|
+
- `AlignmentFormat` export in `__init__.py`
|
|
213
|
+
|
|
214
|
+
### Fixed
|
|
215
|
+
- MSA support now correctly uses nested dictionary format `{database: {format: AlignmentFileRecord}}`
|
|
216
|
+
- CLI multi-endpoint initialization (removed incorrect `is_async` parameter)
|
|
217
|
+
- Multi-endpoint client MSA parameter passing
|
|
218
|
+
- YAML configuration MSA format handling
|
|
219
|
+
|
|
220
|
+
### Changed
|
|
221
|
+
- Updated README.md examples (removed `is_async=True` from MultiEndpointClient)
|
|
222
|
+
- Improved error handling in multi-endpoint operations
|
|
223
|
+
- Better organization of test scripts into `test_scripts/` directory
|
|
224
|
+
|
|
225
|
+
### Documentation
|
|
226
|
+
- New comprehensive demo notebook with complete examples
|
|
227
|
+
- Updated all guides for consistency
|
|
228
|
+
- Added troubleshooting tips for multi-endpoint usage
|
|
229
|
+
|
|
230
|
+
## [0.2.0] - Previous release
|
|
231
|
+
- Initial multi-endpoint support for virtual screening
|
|
232
|
+
- Basic affinity prediction features
|
|
233
|
+
- Virtual screening capabilities
|
|
@@ -5,7 +5,9 @@ recursive-include docs *.md
|
|
|
5
5
|
recursive-include licenses *.md *.txt LICENSE* *-LICENSE
|
|
6
6
|
recursive-include boltz2_client *.py
|
|
7
7
|
recursive-include examples *.py *.yaml *.a3m *.ipynb *.md *.json *.txt *.sh
|
|
8
|
-
recursive-include tests *.py
|
|
8
|
+
recursive-include tests *.py *.json *.a3m *.fasta
|
|
9
|
+
recursive-include scripts *.py *.sh
|
|
10
|
+
include pytest.ini
|
|
9
11
|
recursive-exclude * __pycache__
|
|
10
12
|
recursive-exclude * *.py[co]
|
|
11
13
|
recursive-exclude * .DS_Store
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: boltz2-python-client
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: Python client for Boltz-2 protein structure prediction API with covalent complex and multi-endpoint support
|
|
5
|
+
Author-email: NVIDIA Corporation <bionemo-support@nvidia.com>
|
|
6
|
+
Maintainer-email: NVIDIA Corporation <bionemo-support@nvidia.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/NVIDIA/digital-biology-examples/tree/main/examples/nims/boltz-2
|
|
9
|
+
Project-URL: Repository, https://github.com/NVIDIA/digital-biology-examples
|
|
10
|
+
Project-URL: Documentation, https://github.com/NVIDIA/digital-biology-examples/tree/main/examples/nims/boltz-2/docs
|
|
11
|
+
Project-URL: Changelog, https://github.com/NVIDIA/digital-biology-examples/blob/main/examples/nims/boltz-2/CHANGELOG.md
|
|
12
|
+
Project-URL: Bug Reports, https://github.com/NVIDIA/digital-biology-examples/issues
|
|
13
|
+
Keywords: protein,structure,prediction,AI,machine learning,bioinformatics,covalent,complex,boltz2
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
26
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
|
+
Requires-Python: >=3.10
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: httpx>=0.24.0
|
|
31
|
+
Requires-Dist: pydantic>=2.0.0
|
|
32
|
+
Requires-Dist: typing-extensions>=4.0.0
|
|
33
|
+
Requires-Dist: aiofiles>=23.0.0
|
|
34
|
+
Requires-Dist: rich>=13.0.0
|
|
35
|
+
Requires-Dist: click>=8.0.0
|
|
36
|
+
Requires-Dist: PyYAML>=6.0.0
|
|
37
|
+
Requires-Dist: aiohttp>=3.8.0
|
|
38
|
+
Provides-Extra: screening
|
|
39
|
+
Requires-Dist: pandas>=1.5; extra == "screening"
|
|
40
|
+
Provides-Extra: notebooks
|
|
41
|
+
Requires-Dist: jupyterlab>=4; extra == "notebooks"
|
|
42
|
+
Requires-Dist: ipykernel>=6; extra == "notebooks"
|
|
43
|
+
Requires-Dist: py3Dmol>=2.0; extra == "notebooks"
|
|
44
|
+
Requires-Dist: matplotlib>=3.6; extra == "notebooks"
|
|
45
|
+
Requires-Dist: numpy>=1.23; extra == "notebooks"
|
|
46
|
+
Provides-Extra: analysis
|
|
47
|
+
Requires-Dist: numpy>=1.23; extra == "analysis"
|
|
48
|
+
Requires-Dist: biopython>=1.80; extra == "analysis"
|
|
49
|
+
Provides-Extra: sagemaker
|
|
50
|
+
Requires-Dist: boto3>=1.26.0; extra == "sagemaker"
|
|
51
|
+
Provides-Extra: dev
|
|
52
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
53
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
54
|
+
Requires-Dist: pandas>=1.5.0; extra == "dev"
|
|
55
|
+
Requires-Dist: biopython>=1.80; extra == "dev"
|
|
56
|
+
Requires-Dist: nbformat>=5.7; extra == "dev"
|
|
57
|
+
Requires-Dist: jsonschema>=4.17; extra == "dev"
|
|
58
|
+
Requires-Dist: py3Dmol>=2.0; extra == "dev"
|
|
59
|
+
Requires-Dist: nbclient>=0.7; extra == "dev"
|
|
60
|
+
Requires-Dist: ipykernel>=6; extra == "dev"
|
|
61
|
+
Requires-Dist: build>=1; extra == "dev"
|
|
62
|
+
Requires-Dist: twine>=6; extra == "dev"
|
|
63
|
+
|
|
64
|
+
# Boltz-2 Python Client
|
|
65
|
+
|
|
66
|
+
Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved.
|
|
67
|
+
|
|
68
|
+
[](https://pypi.org/project/boltz2-python-client/)
|
|
69
|
+
[](LICENSE)
|
|
70
|
+
|
|
71
|
+
Python and command-line interfaces for NVIDIA Boltz-2 NIM: protein, DNA/RNA,
|
|
72
|
+
ligand and covalent complexes, binding affinity, MSA integration, templates,
|
|
73
|
+
and multi-endpoint screening.
|
|
74
|
+
|
|
75
|
+
Version **0.6.0** targets **NIM 1.9.0**. Releases are validated on
|
|
76
|
+
[TestPyPI](https://test.pypi.org/project/boltz2-python-client/0.6.0/)
|
|
77
|
+
before production publication. Select the matching index when installing.
|
|
78
|
+
See [migration and compatibility](docs/migration-0.6.md).
|
|
79
|
+
|
|
80
|
+
The source archive (`.tar.gz`) under the release page's **Download files** includes
|
|
81
|
+
the current guides, scripts and notebooks. Relative links in this README refer
|
|
82
|
+
to files in that extracted archive or a matching repository checkout.
|
|
83
|
+
|
|
84
|
+
## Install
|
|
85
|
+
|
|
86
|
+
Python 3.10 or newer:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# PyPI, after production publication
|
|
90
|
+
python -m pip install boltz2-python-client==0.6.0
|
|
91
|
+
|
|
92
|
+
# TestPyPI release and dependencies from PyPI
|
|
93
|
+
python -m pip install --index-url https://test.pypi.org/simple/ \
|
|
94
|
+
--extra-index-url https://pypi.org/simple/ boltz2-python-client==0.6.0
|
|
95
|
+
|
|
96
|
+
# From this checkout or the extracted source archive
|
|
97
|
+
python -m pip install -e '.[dev,notebooks]'
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Optional extras: `notebooks` (Jupyter and visualization), `sagemaker` (boto3),
|
|
101
|
+
`analysis` (NumPy and structure conversion), and `screening` (pandas for CSV and
|
|
102
|
+
DataFrame helpers). The Python client itself needs no GPU;
|
|
103
|
+
a running NIM server performs inference.
|
|
104
|
+
|
|
105
|
+
## Quick start
|
|
106
|
+
|
|
107
|
+
Run against a ready local server. This sequence is an input-format example;
|
|
108
|
+
confidence scores do not establish a biological interaction.
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
from pathlib import Path
|
|
112
|
+
from boltz2_client import Boltz2SyncClient
|
|
113
|
+
|
|
114
|
+
client = Boltz2SyncClient(base_url="http://localhost:8000", timeout=600)
|
|
115
|
+
result = client.predict_protein_structure(
|
|
116
|
+
sequence="MKTVRQERLKSIVRILERSKEPVSGAQLAEELSVSRQVIVQDIAYLRSLGYNIVATPRGYVLAGG",
|
|
117
|
+
output_dir=Path("results/protein"),
|
|
118
|
+
)
|
|
119
|
+
print(result.confidence_scores)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
For notebooks and asynchronous programs, use `Boltz2Client` and `await`:
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
from boltz2_client import Boltz2Client, Ligand, Polymer, PredictionRequest
|
|
126
|
+
|
|
127
|
+
client = Boltz2Client(timeout=600)
|
|
128
|
+
request = PredictionRequest(
|
|
129
|
+
polymers=[Polymer(id="A", molecule_type="protein", sequence="MTEYKLVVVGACGVGKSALTIQLIQNHFVDEYDPT")],
|
|
130
|
+
ligands=[Ligand(id="L1", smiles="CC(=O)Oc1ccccc1C(=O)O",
|
|
131
|
+
predict_affinity=True, output_affinity_embedding=True)],
|
|
132
|
+
diffusion_samples=2,
|
|
133
|
+
max_parallel_samples=1, # NIM 1.9+: lower peak GPU memory
|
|
134
|
+
)
|
|
135
|
+
result = await client.predict(request, output_dir="results/complex")
|
|
136
|
+
print(result.affinities["L1"].affinity_pic50)
|
|
137
|
+
print(result.affinities["L1"].affinity_embedding)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The second example demonstrates request syntax using a short protein fragment
|
|
141
|
+
and aspirin; it is not a validated binding pair. Use full, appropriate target
|
|
142
|
+
sequences and assess predictions against experimental evidence.
|
|
143
|
+
|
|
144
|
+
## Endpoints
|
|
145
|
+
|
|
146
|
+
| Deployment | Configuration | Prediction path |
|
|
147
|
+
|---|---|---|
|
|
148
|
+
| Local/self-hosted | `Boltz2Client(base_url="http://localhost:8000")` | `/biology/mit/boltz2/predict` |
|
|
149
|
+
| NVIDIA hosted | `Boltz2Client(endpoint_type="nvidia_hosted")` | `/v1/biology/mit/boltz2/predict` |
|
|
150
|
+
| SageMaker | `Boltz2Client(endpoint_type="sagemaker", sagemaker_endpoint_name="my-endpoint")` | boto3 `invoke_endpoint` |
|
|
151
|
+
|
|
152
|
+
For hosted inference, supply the key through `NVIDIA_API_KEY` or `NGC_API_KEY`
|
|
153
|
+
in the process environment (or `api_key` in Python). The default hosted base
|
|
154
|
+
URL is `https://health.api.nvidia.com`. Local inference sends no authorization
|
|
155
|
+
header. Hosted deployments may lag the container release; enable version-specific
|
|
156
|
+
options only when that endpoint supports them.
|
|
157
|
+
|
|
158
|
+
SageMaker requires the `sagemaker` extra and configured AWS credentials/region.
|
|
159
|
+
See the [SageMaker connection example](docs/deployment.md#existing-sagemaker-endpoint).
|
|
160
|
+
Use asynchronous clients in Jupyter; the synchronous wrapper uses `asyncio.run()`.
|
|
161
|
+
|
|
162
|
+
## CLI
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
boltz2 health
|
|
166
|
+
boltz2 protein ACDEFGHIKLMNPQRSTVWY --output-dir results/protein
|
|
167
|
+
boltz2 protein ACDEFGHIKLMNPQRSTVWY --diffusion-samples 2 --max-parallel-samples 1
|
|
168
|
+
boltz2 ligand ACDEFGHIKLMNPQRSTVWY --smiles CC --predict-affinity --output-affinity-embedding
|
|
169
|
+
boltz2 advanced --config-file examples/data/nim_1_9_request.json --output-dir results/advanced
|
|
170
|
+
boltz2 --endpoint-type nvidia_hosted protein ACDEFGHIKLMNPQRSTVWY
|
|
171
|
+
boltz2 --multi-endpoint --base-url http://gpu1:8000,http://gpu2:8000 protein ACDEFGHIKLMNPQRSTVWY
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
These short sequences/ligands illustrate syntax. `boltz2 --help` lists all
|
|
175
|
+
commands, including covalent constraints, YAML, MSA conversion and screening.
|
|
176
|
+
|
|
177
|
+
## Results and matrices
|
|
178
|
+
|
|
179
|
+
`predict()` saves every structure as `structure_0.cif`, `structure_1.cif`, etc.,
|
|
180
|
+
plus `prediction_response.json` (complete response), `prediction_metadata.json`
|
|
181
|
+
(scores, affinities, embeddings and runtime metrics), and `affinities.json` when
|
|
182
|
+
present. Use `save_structures=False` or CLI `--no-save` to suppress client output.
|
|
183
|
+
Use separate output directories for separate predictions to avoid overwriting files.
|
|
184
|
+
|
|
185
|
+
**NIM 1.9 does not return full PAE/PDE matrices in JSON.** `write_full_pae=True`
|
|
186
|
+
and `write_full_pde=True` create NPZ files on the server under
|
|
187
|
+
`$NIM_OUTPUT_PATH/prediction_*/pae/` and `.../pde/`. `result.pae` and `result.pde`
|
|
188
|
+
remain `None`. Mount the server output directory to retrieve these artifacts.
|
|
189
|
+
Aggregate `complex_pde_scores` and `complex_ipde_scores` remain in the response.
|
|
190
|
+
See [outputs](docs/outputs.md) for loading matrices and retaining results.
|
|
191
|
+
|
|
192
|
+
## Deploy a local server
|
|
193
|
+
|
|
194
|
+
Follow [local deployment](docs/deployment.md), including GPU/driver prerequisites,
|
|
195
|
+
NGC login, cache and output mounts. The pinned image is
|
|
196
|
+
`nvcr.io/nim/mit/boltz2:1.9.0`. The deployment script checks GPU access before
|
|
197
|
+
starting a container:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
# Set NGC_API_KEY (or NVIDIA_API_KEY) in the environment first.
|
|
201
|
+
export LOCAL_NIM_CACHE="$HOME/.cache/nim"
|
|
202
|
+
export LOCAL_NIM_OUTPUT="$HOME/boltz2-output"
|
|
203
|
+
bash scripts/start_local_nim.sh
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Guides and examples
|
|
207
|
+
|
|
208
|
+
Start with the [protein prediction notebook](examples/notebooks/01_protein_prediction.ipynb)
|
|
209
|
+
and [example index](examples/README.md). Guides:
|
|
210
|
+
|
|
211
|
+
- [Parameters](docs/parameters.md), [migration](docs/migration-0.6.md), [outputs](docs/outputs.md)
|
|
212
|
+
- [Affinity](docs/affinity_prediction.md), [covalent complexes](docs/covalent_complex.md)
|
|
213
|
+
- [MSA search](docs/msa_search.md), [A3M multimer pairing](docs/a3m_to_multimer_msa.md)
|
|
214
|
+
- [YAML subset](docs/yaml.md), [async usage](docs/async.md)
|
|
215
|
+
- [Multiple endpoints](docs/multi_endpoint.md), [virtual screening](docs/virtual_screening.md)
|
|
216
|
+
- [Validation and release procedure](docs/development.md), [changelog](CHANGELOG.md)
|
|
217
|
+
|
|
218
|
+
## License
|
|
219
|
+
|
|
220
|
+
[MIT](LICENSE). Third-party assets retain their [licenses](licenses/README.md).
|
|
221
|
+
NVIDIA NIM container and model terms are separate from the Python client license.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Boltz-2 Python Client
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026, NVIDIA CORPORATION. All rights reserved.
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/boltz2-python-client/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
Python and command-line interfaces for NVIDIA Boltz-2 NIM: protein, DNA/RNA,
|
|
9
|
+
ligand and covalent complexes, binding affinity, MSA integration, templates,
|
|
10
|
+
and multi-endpoint screening.
|
|
11
|
+
|
|
12
|
+
Version **0.6.0** targets **NIM 1.9.0**. Releases are validated on
|
|
13
|
+
[TestPyPI](https://test.pypi.org/project/boltz2-python-client/0.6.0/)
|
|
14
|
+
before production publication. Select the matching index when installing.
|
|
15
|
+
See [migration and compatibility](docs/migration-0.6.md).
|
|
16
|
+
|
|
17
|
+
The source archive (`.tar.gz`) under the release page's **Download files** includes
|
|
18
|
+
the current guides, scripts and notebooks. Relative links in this README refer
|
|
19
|
+
to files in that extracted archive or a matching repository checkout.
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
Python 3.10 or newer:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# PyPI, after production publication
|
|
27
|
+
python -m pip install boltz2-python-client==0.6.0
|
|
28
|
+
|
|
29
|
+
# TestPyPI release and dependencies from PyPI
|
|
30
|
+
python -m pip install --index-url https://test.pypi.org/simple/ \
|
|
31
|
+
--extra-index-url https://pypi.org/simple/ boltz2-python-client==0.6.0
|
|
32
|
+
|
|
33
|
+
# From this checkout or the extracted source archive
|
|
34
|
+
python -m pip install -e '.[dev,notebooks]'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Optional extras: `notebooks` (Jupyter and visualization), `sagemaker` (boto3),
|
|
38
|
+
`analysis` (NumPy and structure conversion), and `screening` (pandas for CSV and
|
|
39
|
+
DataFrame helpers). The Python client itself needs no GPU;
|
|
40
|
+
a running NIM server performs inference.
|
|
41
|
+
|
|
42
|
+
## Quick start
|
|
43
|
+
|
|
44
|
+
Run against a ready local server. This sequence is an input-format example;
|
|
45
|
+
confidence scores do not establish a biological interaction.
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from pathlib import Path
|
|
49
|
+
from boltz2_client import Boltz2SyncClient
|
|
50
|
+
|
|
51
|
+
client = Boltz2SyncClient(base_url="http://localhost:8000", timeout=600)
|
|
52
|
+
result = client.predict_protein_structure(
|
|
53
|
+
sequence="MKTVRQERLKSIVRILERSKEPVSGAQLAEELSVSRQVIVQDIAYLRSLGYNIVATPRGYVLAGG",
|
|
54
|
+
output_dir=Path("results/protein"),
|
|
55
|
+
)
|
|
56
|
+
print(result.confidence_scores)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
For notebooks and asynchronous programs, use `Boltz2Client` and `await`:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from boltz2_client import Boltz2Client, Ligand, Polymer, PredictionRequest
|
|
63
|
+
|
|
64
|
+
client = Boltz2Client(timeout=600)
|
|
65
|
+
request = PredictionRequest(
|
|
66
|
+
polymers=[Polymer(id="A", molecule_type="protein", sequence="MTEYKLVVVGACGVGKSALTIQLIQNHFVDEYDPT")],
|
|
67
|
+
ligands=[Ligand(id="L1", smiles="CC(=O)Oc1ccccc1C(=O)O",
|
|
68
|
+
predict_affinity=True, output_affinity_embedding=True)],
|
|
69
|
+
diffusion_samples=2,
|
|
70
|
+
max_parallel_samples=1, # NIM 1.9+: lower peak GPU memory
|
|
71
|
+
)
|
|
72
|
+
result = await client.predict(request, output_dir="results/complex")
|
|
73
|
+
print(result.affinities["L1"].affinity_pic50)
|
|
74
|
+
print(result.affinities["L1"].affinity_embedding)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The second example demonstrates request syntax using a short protein fragment
|
|
78
|
+
and aspirin; it is not a validated binding pair. Use full, appropriate target
|
|
79
|
+
sequences and assess predictions against experimental evidence.
|
|
80
|
+
|
|
81
|
+
## Endpoints
|
|
82
|
+
|
|
83
|
+
| Deployment | Configuration | Prediction path |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| Local/self-hosted | `Boltz2Client(base_url="http://localhost:8000")` | `/biology/mit/boltz2/predict` |
|
|
86
|
+
| NVIDIA hosted | `Boltz2Client(endpoint_type="nvidia_hosted")` | `/v1/biology/mit/boltz2/predict` |
|
|
87
|
+
| SageMaker | `Boltz2Client(endpoint_type="sagemaker", sagemaker_endpoint_name="my-endpoint")` | boto3 `invoke_endpoint` |
|
|
88
|
+
|
|
89
|
+
For hosted inference, supply the key through `NVIDIA_API_KEY` or `NGC_API_KEY`
|
|
90
|
+
in the process environment (or `api_key` in Python). The default hosted base
|
|
91
|
+
URL is `https://health.api.nvidia.com`. Local inference sends no authorization
|
|
92
|
+
header. Hosted deployments may lag the container release; enable version-specific
|
|
93
|
+
options only when that endpoint supports them.
|
|
94
|
+
|
|
95
|
+
SageMaker requires the `sagemaker` extra and configured AWS credentials/region.
|
|
96
|
+
See the [SageMaker connection example](docs/deployment.md#existing-sagemaker-endpoint).
|
|
97
|
+
Use asynchronous clients in Jupyter; the synchronous wrapper uses `asyncio.run()`.
|
|
98
|
+
|
|
99
|
+
## CLI
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
boltz2 health
|
|
103
|
+
boltz2 protein ACDEFGHIKLMNPQRSTVWY --output-dir results/protein
|
|
104
|
+
boltz2 protein ACDEFGHIKLMNPQRSTVWY --diffusion-samples 2 --max-parallel-samples 1
|
|
105
|
+
boltz2 ligand ACDEFGHIKLMNPQRSTVWY --smiles CC --predict-affinity --output-affinity-embedding
|
|
106
|
+
boltz2 advanced --config-file examples/data/nim_1_9_request.json --output-dir results/advanced
|
|
107
|
+
boltz2 --endpoint-type nvidia_hosted protein ACDEFGHIKLMNPQRSTVWY
|
|
108
|
+
boltz2 --multi-endpoint --base-url http://gpu1:8000,http://gpu2:8000 protein ACDEFGHIKLMNPQRSTVWY
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
These short sequences/ligands illustrate syntax. `boltz2 --help` lists all
|
|
112
|
+
commands, including covalent constraints, YAML, MSA conversion and screening.
|
|
113
|
+
|
|
114
|
+
## Results and matrices
|
|
115
|
+
|
|
116
|
+
`predict()` saves every structure as `structure_0.cif`, `structure_1.cif`, etc.,
|
|
117
|
+
plus `prediction_response.json` (complete response), `prediction_metadata.json`
|
|
118
|
+
(scores, affinities, embeddings and runtime metrics), and `affinities.json` when
|
|
119
|
+
present. Use `save_structures=False` or CLI `--no-save` to suppress client output.
|
|
120
|
+
Use separate output directories for separate predictions to avoid overwriting files.
|
|
121
|
+
|
|
122
|
+
**NIM 1.9 does not return full PAE/PDE matrices in JSON.** `write_full_pae=True`
|
|
123
|
+
and `write_full_pde=True` create NPZ files on the server under
|
|
124
|
+
`$NIM_OUTPUT_PATH/prediction_*/pae/` and `.../pde/`. `result.pae` and `result.pde`
|
|
125
|
+
remain `None`. Mount the server output directory to retrieve these artifacts.
|
|
126
|
+
Aggregate `complex_pde_scores` and `complex_ipde_scores` remain in the response.
|
|
127
|
+
See [outputs](docs/outputs.md) for loading matrices and retaining results.
|
|
128
|
+
|
|
129
|
+
## Deploy a local server
|
|
130
|
+
|
|
131
|
+
Follow [local deployment](docs/deployment.md), including GPU/driver prerequisites,
|
|
132
|
+
NGC login, cache and output mounts. The pinned image is
|
|
133
|
+
`nvcr.io/nim/mit/boltz2:1.9.0`. The deployment script checks GPU access before
|
|
134
|
+
starting a container:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Set NGC_API_KEY (or NVIDIA_API_KEY) in the environment first.
|
|
138
|
+
export LOCAL_NIM_CACHE="$HOME/.cache/nim"
|
|
139
|
+
export LOCAL_NIM_OUTPUT="$HOME/boltz2-output"
|
|
140
|
+
bash scripts/start_local_nim.sh
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Guides and examples
|
|
144
|
+
|
|
145
|
+
Start with the [protein prediction notebook](examples/notebooks/01_protein_prediction.ipynb)
|
|
146
|
+
and [example index](examples/README.md). Guides:
|
|
147
|
+
|
|
148
|
+
- [Parameters](docs/parameters.md), [migration](docs/migration-0.6.md), [outputs](docs/outputs.md)
|
|
149
|
+
- [Affinity](docs/affinity_prediction.md), [covalent complexes](docs/covalent_complex.md)
|
|
150
|
+
- [MSA search](docs/msa_search.md), [A3M multimer pairing](docs/a3m_to_multimer_msa.md)
|
|
151
|
+
- [YAML subset](docs/yaml.md), [async usage](docs/async.md)
|
|
152
|
+
- [Multiple endpoints](docs/multi_endpoint.md), [virtual screening](docs/virtual_screening.md)
|
|
153
|
+
- [Validation and release procedure](docs/development.md), [changelog](CHANGELOG.md)
|
|
154
|
+
|
|
155
|
+
## License
|
|
156
|
+
|
|
157
|
+
[MIT](LICENSE). Third-party assets retain their [licenses](licenses/README.md).
|
|
158
|
+
NVIDIA NIM container and model terms are separate from the Python client license.
|
|
@@ -26,7 +26,7 @@ Example:
|
|
|
26
26
|
>>> print(f"Confidence: {result.confidence_scores[0]:.3f}")
|
|
27
27
|
"""
|
|
28
28
|
|
|
29
|
-
__version__ = "0.
|
|
29
|
+
__version__ = "0.6.0"
|
|
30
30
|
__author__ = "NVIDIA Corporation"
|
|
31
31
|
__email__ = "bionemo-support@nvidia.com"
|
|
32
32
|
|
|
@@ -103,28 +103,6 @@ from .utils import (
|
|
|
103
103
|
convert_pdb_to_cif,
|
|
104
104
|
)
|
|
105
105
|
|
|
106
|
-
# Optional imports for visualization
|
|
107
|
-
try:
|
|
108
|
-
from .visualization import (
|
|
109
|
-
StructureVisualizer,
|
|
110
|
-
visualize_structure,
|
|
111
|
-
create_multi_view,
|
|
112
|
-
)
|
|
113
|
-
_HAS_VISUALIZATION = True
|
|
114
|
-
except ImportError:
|
|
115
|
-
_HAS_VISUALIZATION = False
|
|
116
|
-
|
|
117
|
-
# Optional imports for analysis
|
|
118
|
-
try:
|
|
119
|
-
from .analysis import (
|
|
120
|
-
StructureAnalyzer,
|
|
121
|
-
calculate_rmsd,
|
|
122
|
-
analyze_contacts,
|
|
123
|
-
)
|
|
124
|
-
_HAS_ANALYSIS = True
|
|
125
|
-
except ImportError:
|
|
126
|
-
_HAS_ANALYSIS = False
|
|
127
|
-
|
|
128
106
|
__all__ = [
|
|
129
107
|
# Core client classes
|
|
130
108
|
"Boltz2Client",
|
|
@@ -201,21 +179,6 @@ __all__ = [
|
|
|
201
179
|
"SPECIES_TO_TAXID",
|
|
202
180
|
]
|
|
203
181
|
|
|
204
|
-
# Add visualization exports if available
|
|
205
|
-
if _HAS_VISUALIZATION:
|
|
206
|
-
__all__.extend([
|
|
207
|
-
"StructureVisualizer",
|
|
208
|
-
"visualize_structure",
|
|
209
|
-
"create_multi_view",
|
|
210
|
-
])
|
|
211
|
-
|
|
212
|
-
# Add analysis exports if available
|
|
213
|
-
if _HAS_ANALYSIS:
|
|
214
|
-
__all__.extend([
|
|
215
|
-
"StructureAnalyzer",
|
|
216
|
-
"calculate_rmsd",
|
|
217
|
-
"analyze_contacts",
|
|
218
|
-
])
|
|
219
182
|
|
|
220
183
|
def get_version() -> str:
|
|
221
184
|
"""Get the current version of the package."""
|