openprotein-python 0.8.8__tar.gz → 0.8.10__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.
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/PKG-INFO +13 -16
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/README.md +12 -15
- openprotein_python-0.8.10/openprotein/api/__init__.py +9 -0
- openprotein_python-0.8.10/openprotein/api/align.py +400 -0
- openprotein_python-0.8.10/openprotein/api/assaydata.py +216 -0
- openprotein_python-0.8.10/openprotein/api/deprecated/__init__.py +5 -0
- openprotein_python-0.8.10/openprotein/api/deprecated/design.py +86 -0
- openprotein_python-0.8.10/openprotein/api/deprecated/poet.py +308 -0
- openprotein_python-0.8.10/openprotein/api/deprecated/predict.py +276 -0
- openprotein_python-0.8.10/openprotein/api/deprecated/train.py +224 -0
- openprotein_python-0.8.10/openprotein/api/design.py +86 -0
- openprotein_python-0.8.10/openprotein/api/designer.py +267 -0
- openprotein_python-0.8.10/openprotein/api/embedding.py +446 -0
- openprotein_python-0.8.10/openprotein/api/error.py +5 -0
- openprotein_python-0.8.10/openprotein/api/fold.py +157 -0
- openprotein_python-0.8.10/openprotein/api/job.py +94 -0
- openprotein_python-0.8.10/openprotein/api/predict.py +273 -0
- openprotein_python-0.8.10/openprotein/api/predictor.py +326 -0
- openprotein_python-0.8.10/openprotein/api/prompt.py +464 -0
- openprotein_python-0.8.10/openprotein/api/svd.py +203 -0
- openprotein_python-0.8.10/openprotein/api/train.py +222 -0
- openprotein_python-0.8.10/openprotein/api/umap.py +257 -0
- openprotein_python-0.8.10/openprotein/app/__init__.py +19 -0
- openprotein_python-0.8.10/openprotein/app/deprecated.py +8 -0
- openprotein_python-0.8.10/openprotein/app/models/__init__.py +33 -0
- openprotein_python-0.8.10/openprotein/app/models/align/__init__.py +4 -0
- openprotein_python-0.8.10/openprotein/app/models/align/base.py +20 -0
- openprotein_python-0.8.10/openprotein/app/models/align/msa.py +134 -0
- openprotein_python-0.8.10/openprotein/app/models/align/prompt.py +78 -0
- openprotein_python-0.8.10/openprotein/app/models/assaydata.py +176 -0
- openprotein_python-0.8.10/openprotein/app/models/deprecated/__init__.py +10 -0
- openprotein_python-0.8.10/openprotein/app/models/deprecated/design.py +109 -0
- openprotein_python-0.8.10/openprotein/app/models/deprecated/poet.py +204 -0
- openprotein_python-0.8.10/openprotein/app/models/deprecated/predict.py +232 -0
- openprotein_python-0.8.10/openprotein/app/models/deprecated/train.py +307 -0
- openprotein_python-0.8.10/openprotein/app/models/design.py +105 -0
- openprotein_python-0.8.10/openprotein/app/models/designer.py +143 -0
- openprotein_python-0.8.10/openprotein/app/models/embeddings/__init__.py +12 -0
- openprotein_python-0.8.10/openprotein/app/models/embeddings/base.py +337 -0
- openprotein_python-0.8.10/openprotein/app/models/embeddings/esm.py +32 -0
- openprotein_python-0.8.10/openprotein/app/models/embeddings/future.py +135 -0
- openprotein_python-0.8.10/openprotein/app/models/embeddings/openprotein.py +21 -0
- openprotein_python-0.8.10/openprotein/app/models/embeddings/poet.py +366 -0
- openprotein_python-0.8.10/openprotein/app/models/embeddings/poet2.py +385 -0
- openprotein_python-0.8.10/openprotein/app/models/embeddings/test.py +38 -0
- openprotein_python-0.8.10/openprotein/app/models/fold/__init__.py +6 -0
- openprotein_python-0.8.10/openprotein/app/models/fold/alphafold2.py +54 -0
- openprotein_python-0.8.10/openprotein/app/models/fold/base.py +81 -0
- openprotein_python-0.8.10/openprotein/app/models/fold/boltz.py +57 -0
- openprotein_python-0.8.10/openprotein/app/models/fold/esmfold.py +38 -0
- openprotein_python-0.8.10/openprotein/app/models/fold/future.py +56 -0
- openprotein_python-0.8.10/openprotein/app/models/futures.py +473 -0
- openprotein_python-0.8.10/openprotein/app/models/predict.py +246 -0
- openprotein_python-0.8.10/openprotein/app/models/predictor/__init__.py +4 -0
- openprotein_python-0.8.10/openprotein/app/models/predictor/predict.py +78 -0
- openprotein_python-0.8.10/openprotein/app/models/predictor/predictor.py +362 -0
- openprotein_python-0.8.10/openprotein/app/models/predictor/validate.py +37 -0
- openprotein_python-0.8.10/openprotein/app/models/prompt.py +141 -0
- openprotein_python-0.8.10/openprotein/app/models/svd.py +260 -0
- openprotein_python-0.8.10/openprotein/app/models/train.py +303 -0
- openprotein_python-0.8.10/openprotein/app/models/umap.py +156 -0
- openprotein_python-0.8.10/openprotein/app/services/__init__.py +16 -0
- openprotein_python-0.8.10/openprotein/app/services/align.py +356 -0
- openprotein_python-0.8.10/openprotein/app/services/assaydata.py +119 -0
- openprotein_python-0.8.10/openprotein/app/services/deprecated/__init__.py +9 -0
- openprotein_python-0.8.10/openprotein/app/services/deprecated/design.py +79 -0
- openprotein_python-0.8.10/openprotein/app/services/deprecated/predict.py +152 -0
- openprotein_python-0.8.10/openprotein/app/services/deprecated/train.py +140 -0
- openprotein_python-0.8.10/openprotein/app/services/design.py +79 -0
- openprotein_python-0.8.10/openprotein/app/services/designer.py +107 -0
- openprotein_python-0.8.10/openprotein/app/services/embeddings.py +137 -0
- openprotein_python-0.8.10/openprotein/app/services/fold.py +89 -0
- openprotein_python-0.8.10/openprotein/app/services/job.py +61 -0
- openprotein_python-0.8.10/openprotein/app/services/predict.py +145 -0
- openprotein_python-0.8.10/openprotein/app/services/predictor.py +192 -0
- openprotein_python-0.8.10/openprotein/app/services/prompt.py +133 -0
- openprotein_python-0.8.10/openprotein/app/services/svd.py +102 -0
- openprotein_python-0.8.10/openprotein/app/services/train.py +135 -0
- openprotein_python-0.8.10/openprotein/app/services/umap.py +97 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/embeddings/future.py +4 -1
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/embeddings/models.py +3 -9
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/embeddings/poet.py +1 -1
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/embeddings/schemas.py +5 -3
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fold/api.py +16 -32
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fold/future.py +53 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/jobs/schemas.py +1 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/models/__init__.py +2 -0
- openprotein_python-0.8.10/openprotein/models/foundation/boltzgen.py +192 -0
- openprotein_python-0.8.10/openprotein/models/foundation/proteinmpnn.py +187 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/models/models.py +4 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/protein.py +38 -4
- openprotein_python-0.8.10/openprotein/schemas/__init__.py +74 -0
- openprotein_python-0.8.10/openprotein/schemas/align.py +61 -0
- openprotein_python-0.8.10/openprotein/schemas/assaydata.py +27 -0
- openprotein_python-0.8.10/openprotein/schemas/deprecated/__init__.py +21 -0
- openprotein_python-0.8.10/openprotein/schemas/deprecated/design.py +173 -0
- openprotein_python-0.8.10/openprotein/schemas/deprecated/poet.py +70 -0
- openprotein_python-0.8.10/openprotein/schemas/deprecated/predict.py +82 -0
- openprotein_python-0.8.10/openprotein/schemas/deprecated/train.py +34 -0
- openprotein_python-0.8.10/openprotein/schemas/design.py +202 -0
- openprotein_python-0.8.10/openprotein/schemas/designer.py +38 -0
- openprotein_python-0.8.10/openprotein/schemas/embeddings.py +102 -0
- openprotein_python-0.8.10/openprotein/schemas/features.py +7 -0
- openprotein_python-0.8.10/openprotein/schemas/fold.py +10 -0
- openprotein_python-0.8.10/openprotein/schemas/job.py +134 -0
- openprotein_python-0.8.10/openprotein/schemas/predict.py +82 -0
- openprotein_python-0.8.10/openprotein/schemas/predictor.py +96 -0
- openprotein_python-0.8.10/openprotein/schemas/prompt.py +28 -0
- openprotein_python-0.8.10/openprotein/schemas/svd.py +31 -0
- openprotein_python-0.8.10/openprotein/schemas/train.py +34 -0
- openprotein_python-0.8.10/openprotein/schemas/umap.py +35 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/svd/svd.py +4 -4
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/umap/umap.py +1 -1
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/pyproject.toml +1 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/.gitignore +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/LICENSE.txt +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/__init__.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/_version.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/align/__init__.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/align/align.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/align/api.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/align/future.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/align/msa.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/align/schemas.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/base.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/chains.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/common/__init__.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/common/features.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/common/model_metadata.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/common/reduction.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/config.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/csv.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/data/__init__.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/data/api.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/data/assaydataset.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/data/data.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/data/schemas.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/design/__init__.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/design/api.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/design/design.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/design/future.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/design/schemas.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/embeddings/__init__.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/embeddings/api.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/embeddings/embeddings.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/embeddings/esm.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/embeddings/openprotein.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/embeddings/poet2.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/errors.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fasta.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fold/__init__.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fold/alphafold2.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fold/boltz.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fold/complex.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fold/esmfold.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fold/fold.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fold/minifold.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fold/models.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fold/rosettafold3.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/fold/schemas.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/jobs/__init__.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/jobs/api.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/jobs/futures.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/jobs/jobs.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/models/base.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/models/foundation/rfdiffusion.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/predictor/__init__.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/predictor/api.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/predictor/models.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/predictor/prediction.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/predictor/predictor.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/predictor/schemas.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/predictor/validate.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/prompt/__init__.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/prompt/api.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/prompt/models.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/prompt/prompt.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/prompt/schemas.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/svd/__init__.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/svd/api.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/svd/models.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/svd/schemas.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/umap/__init__.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/umap/api.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/umap/models.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/umap/schemas.py +0 -0
- {openprotein_python-0.8.8 → openprotein_python-0.8.10}/openprotein/utils/uuid.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openprotein-python
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.10
|
|
4
4
|
Summary: OpenProtein Python interface.
|
|
5
5
|
Author-email: Mark Gee <markgee@ne47.bio>, "Timothy Truong Jr." <ttruong@ne47.bio>, Tristan Bepler <tbepler@ne47.bio>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,7 +17,7 @@ Requires-Dist: tqdm<5,>=4.66.5
|
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
|
|
19
19
|
[](https://pypi.org/project/openprotein-python/)
|
|
20
|
-
[](https://pypi.org/project/openprotein-python/)
|
|
21
21
|
[](https://anaconda.org/openprotein/openprotein-python)
|
|
22
22
|
|
|
23
23
|
|
|
@@ -31,16 +31,16 @@ The OpenProtein.AI Python Interface provides a user-friendly library to interact
|
|
|
31
31
|
| | Workflow | Description |
|
|
32
32
|
|---|--------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|
|
|
33
33
|
| 0 | [`Quick start`](#Quick-start) | Quick start guide |
|
|
34
|
-
| 1 | [`Installation`](https://docs.openprotein.ai/api
|
|
35
|
-
| 2 | [`Session management`](https://docs.openprotein.ai/api
|
|
36
|
-
| 3 | [`
|
|
37
|
-
| 4 | [`De Novo prediction & generative models (PoET)`](https://docs.openprotein.ai/api
|
|
38
|
-
| 5 | [`
|
|
34
|
+
| 1 | [`Installation`](https://docs.openprotein.ai/python-api/installation.html) | Install guide for pip and conda. |
|
|
35
|
+
| 2 | [`Session management`](https://docs.openprotein.ai/python-api/index.html) | An overview of the OpenProtein Python Client & the asynchronous jobs system. |
|
|
36
|
+
| 3 | [`Property-Regression-Models`](https://docs.openprotein.ai/python-api/property-regression-models/index.html) | Covers core tasks such as data upload, model training & prediction, and sequence design. |
|
|
37
|
+
| 4 | [`De Novo prediction & generative models (PoET)`](https://docs.openprotein.ai/python-api/poet/index.html) | Covers PoET, a protein LLM for *de novo* scoring, as well as sequence generation. |
|
|
38
|
+
| 5 | [`Foundational models`](https://docs.openprotein.ai/python-api/foundation-models/index.html) | Covers methods for creating sequence embeddings with proprietary & open-source models. |
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
# Quick-start
|
|
42
42
|
|
|
43
|
-
Get started with our quickstart README! You can peruse the [official documentation](https://docs.openprotein.ai/api
|
|
43
|
+
Get started with our quickstart README! You can peruse the [official documentation](https://docs.openprotein.ai/python-api/) for more details!
|
|
44
44
|
## Installation
|
|
45
45
|
|
|
46
46
|
To install the python interface using pip, run the following command:
|
|
@@ -55,16 +55,13 @@ conda install -c openprotein openprotein-python
|
|
|
55
55
|
|
|
56
56
|
### Requirements
|
|
57
57
|
|
|
58
|
-
- Python 3.
|
|
59
|
-
-
|
|
60
|
-
- requests version 2.0 or newer.
|
|
61
|
-
- tqdm version 4.0 or newer.
|
|
62
|
-
- pandas version 1.0 or newer.
|
|
58
|
+
- Python 3.10 or higher.
|
|
59
|
+
- Other dependencies as in `pyproject.toml`
|
|
63
60
|
|
|
64
61
|
# Getting started
|
|
65
62
|
|
|
66
63
|
|
|
67
|
-
Read on below for the quick-start guide, or see the [docs](https://docs.openprotein.ai/api
|
|
64
|
+
Read on below for the quick-start guide, or see the [docs](https://docs.openprotein.ai/python-api/) for more information!
|
|
68
65
|
|
|
69
66
|
To begin, create a session using your login credentials.
|
|
70
67
|
```
|
|
@@ -75,10 +72,10 @@ session = openprotein.connect(USERNAME, PASSWORD)
|
|
|
75
72
|
```
|
|
76
73
|
## Job Status
|
|
77
74
|
|
|
78
|
-
The interface offers `
|
|
75
|
+
The interface offers `Future` objects for asynchronous calls, allowing tracking of job status and result retrieval when ready. Given a future, you can check its status and retrieve results.
|
|
79
76
|
|
|
80
77
|
### Checking Job Status
|
|
81
|
-
Check the status of an `
|
|
78
|
+
Check the status of an `Future` using the following methods:
|
|
82
79
|
```
|
|
83
80
|
future.refresh() # call the backend to update the job status
|
|
84
81
|
future.done() # returns True if the job is done, meaning the status could be SUCCESS, FAILED, or CANCELLED
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[](https://pypi.org/project/openprotein-python/)
|
|
2
|
-
[](https://pypi.org/project/openprotein-python/)
|
|
3
3
|
[](https://anaconda.org/openprotein/openprotein-python)
|
|
4
4
|
|
|
5
5
|
|
|
@@ -13,16 +13,16 @@ The OpenProtein.AI Python Interface provides a user-friendly library to interact
|
|
|
13
13
|
| | Workflow | Description |
|
|
14
14
|
|---|--------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|
|
|
15
15
|
| 0 | [`Quick start`](#Quick-start) | Quick start guide |
|
|
16
|
-
| 1 | [`Installation`](https://docs.openprotein.ai/api
|
|
17
|
-
| 2 | [`Session management`](https://docs.openprotein.ai/api
|
|
18
|
-
| 3 | [`
|
|
19
|
-
| 4 | [`De Novo prediction & generative models (PoET)`](https://docs.openprotein.ai/api
|
|
20
|
-
| 5 | [`
|
|
16
|
+
| 1 | [`Installation`](https://docs.openprotein.ai/python-api/installation.html) | Install guide for pip and conda. |
|
|
17
|
+
| 2 | [`Session management`](https://docs.openprotein.ai/python-api/index.html) | An overview of the OpenProtein Python Client & the asynchronous jobs system. |
|
|
18
|
+
| 3 | [`Property-Regression-Models`](https://docs.openprotein.ai/python-api/property-regression-models/index.html) | Covers core tasks such as data upload, model training & prediction, and sequence design. |
|
|
19
|
+
| 4 | [`De Novo prediction & generative models (PoET)`](https://docs.openprotein.ai/python-api/poet/index.html) | Covers PoET, a protein LLM for *de novo* scoring, as well as sequence generation. |
|
|
20
|
+
| 5 | [`Foundational models`](https://docs.openprotein.ai/python-api/foundation-models/index.html) | Covers methods for creating sequence embeddings with proprietary & open-source models. |
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
# Quick-start
|
|
24
24
|
|
|
25
|
-
Get started with our quickstart README! You can peruse the [official documentation](https://docs.openprotein.ai/api
|
|
25
|
+
Get started with our quickstart README! You can peruse the [official documentation](https://docs.openprotein.ai/python-api/) for more details!
|
|
26
26
|
## Installation
|
|
27
27
|
|
|
28
28
|
To install the python interface using pip, run the following command:
|
|
@@ -37,16 +37,13 @@ conda install -c openprotein openprotein-python
|
|
|
37
37
|
|
|
38
38
|
### Requirements
|
|
39
39
|
|
|
40
|
-
- Python 3.
|
|
41
|
-
-
|
|
42
|
-
- requests version 2.0 or newer.
|
|
43
|
-
- tqdm version 4.0 or newer.
|
|
44
|
-
- pandas version 1.0 or newer.
|
|
40
|
+
- Python 3.10 or higher.
|
|
41
|
+
- Other dependencies as in `pyproject.toml`
|
|
45
42
|
|
|
46
43
|
# Getting started
|
|
47
44
|
|
|
48
45
|
|
|
49
|
-
Read on below for the quick-start guide, or see the [docs](https://docs.openprotein.ai/api
|
|
46
|
+
Read on below for the quick-start guide, or see the [docs](https://docs.openprotein.ai/python-api/) for more information!
|
|
50
47
|
|
|
51
48
|
To begin, create a session using your login credentials.
|
|
52
49
|
```
|
|
@@ -57,10 +54,10 @@ session = openprotein.connect(USERNAME, PASSWORD)
|
|
|
57
54
|
```
|
|
58
55
|
## Job Status
|
|
59
56
|
|
|
60
|
-
The interface offers `
|
|
57
|
+
The interface offers `Future` objects for asynchronous calls, allowing tracking of job status and result retrieval when ready. Given a future, you can check its status and retrieve results.
|
|
61
58
|
|
|
62
59
|
### Checking Job Status
|
|
63
|
-
Check the status of an `
|
|
60
|
+
Check the status of an `Future` using the following methods:
|
|
64
61
|
```
|
|
65
62
|
future.refresh() # call the backend to update the job status
|
|
66
63
|
future.done() # returns True if the job is done, meaning the status could be SUCCESS, FAILED, or CANCELLED
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import io
|
|
2
|
+
import random
|
|
3
|
+
from typing import BinaryIO, Iterator
|
|
4
|
+
|
|
5
|
+
import requests
|
|
6
|
+
|
|
7
|
+
import openprotein.config as config
|
|
8
|
+
from openprotein.base import APISession
|
|
9
|
+
from openprotein.csv import csv_stream
|
|
10
|
+
from openprotein.errors import APIError, InvalidParameterError, MissingParameterError
|
|
11
|
+
from openprotein.schemas import AlignType, Job, MSASamplingMethod
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def get_align_job_inputs(
|
|
15
|
+
session: APISession,
|
|
16
|
+
job_id: str,
|
|
17
|
+
input_type: AlignType,
|
|
18
|
+
prompt_index: int | None = None,
|
|
19
|
+
) -> requests.Response:
|
|
20
|
+
"""
|
|
21
|
+
Get MSA and related data for an align job.
|
|
22
|
+
|
|
23
|
+
Returns either the original user seed (RAW), the generated MSA or the prompt.
|
|
24
|
+
|
|
25
|
+
Specify prompt_index to retreive the specific prompt for each replicate when input_type is PROMPT.
|
|
26
|
+
|
|
27
|
+
Parameters
|
|
28
|
+
----------
|
|
29
|
+
session : APISession
|
|
30
|
+
The API session.
|
|
31
|
+
job_id : int or str
|
|
32
|
+
The job identifier.
|
|
33
|
+
input_type : PoetInputType
|
|
34
|
+
The type of MSA data.
|
|
35
|
+
prompt_index : Optional[int]
|
|
36
|
+
The replicate number for the prompt (input_type=-PROMPT only)
|
|
37
|
+
|
|
38
|
+
Returns
|
|
39
|
+
-------
|
|
40
|
+
requests.Response
|
|
41
|
+
The response from the server.
|
|
42
|
+
"""
|
|
43
|
+
endpoint = "v1/align/inputs"
|
|
44
|
+
|
|
45
|
+
params = {"job_id": job_id, "msa_type": input_type}
|
|
46
|
+
if prompt_index is not None:
|
|
47
|
+
params["replicate"] = prompt_index
|
|
48
|
+
|
|
49
|
+
response = session.get(endpoint, params=params, stream=True)
|
|
50
|
+
return response
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def get_input(
|
|
54
|
+
session: APISession,
|
|
55
|
+
job: Job,
|
|
56
|
+
input_type: AlignType,
|
|
57
|
+
prompt_index: int | None = None,
|
|
58
|
+
) -> Iterator[list[str]]:
|
|
59
|
+
"""
|
|
60
|
+
Get input data for a given job.
|
|
61
|
+
|
|
62
|
+
Parameters
|
|
63
|
+
----------
|
|
64
|
+
session : APISession
|
|
65
|
+
The API session.
|
|
66
|
+
job : Job
|
|
67
|
+
The job for which to retrieve data.
|
|
68
|
+
input_type : PoetInputType
|
|
69
|
+
The type of MSA data.
|
|
70
|
+
prompt_index : Optional[int]
|
|
71
|
+
The replicate number for the prompt (input_type=-PROMPT only)
|
|
72
|
+
|
|
73
|
+
Returns
|
|
74
|
+
-------
|
|
75
|
+
csv.reader
|
|
76
|
+
A CSV reader for the response data.
|
|
77
|
+
"""
|
|
78
|
+
job_id = job.job_id
|
|
79
|
+
response = get_align_job_inputs(
|
|
80
|
+
session=session, job_id=job_id, input_type=input_type, prompt_index=prompt_index
|
|
81
|
+
)
|
|
82
|
+
return csv_stream(response)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def get_seed(session: APISession, job: Job) -> Iterator[list[str]]:
|
|
86
|
+
"""
|
|
87
|
+
Get the seed for a given MSA job.
|
|
88
|
+
|
|
89
|
+
Parameters
|
|
90
|
+
----------
|
|
91
|
+
session : APISession
|
|
92
|
+
The API session.
|
|
93
|
+
job : Job
|
|
94
|
+
The job for which to retrieve the seed.
|
|
95
|
+
|
|
96
|
+
Returns
|
|
97
|
+
-------
|
|
98
|
+
Iterator[list[str]]
|
|
99
|
+
A CSV reader for the seed sequence.
|
|
100
|
+
"""
|
|
101
|
+
return get_input(session=session, job=job, input_type=AlignType.INPUT)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def get_msa(session: APISession, job: Job) -> Iterator[list[str]]:
|
|
105
|
+
"""
|
|
106
|
+
Get the generated MSA (Multiple Sequence Alignment) for a given job.
|
|
107
|
+
|
|
108
|
+
Parameters
|
|
109
|
+
----------
|
|
110
|
+
session : APISession
|
|
111
|
+
The API session.
|
|
112
|
+
job : Job
|
|
113
|
+
The job for which to retrieve the MSA.
|
|
114
|
+
|
|
115
|
+
Returns
|
|
116
|
+
-------
|
|
117
|
+
Iterator[list[str]]
|
|
118
|
+
A CSV reader for the MSA data.
|
|
119
|
+
"""
|
|
120
|
+
return get_input(session=session, job=job, input_type=AlignType.MSA)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def msa_post(
|
|
124
|
+
session: APISession,
|
|
125
|
+
msa_file: BinaryIO | None = None,
|
|
126
|
+
seed: str | bytes | None = None,
|
|
127
|
+
) -> Job:
|
|
128
|
+
"""
|
|
129
|
+
Create an MSA.
|
|
130
|
+
|
|
131
|
+
Either via a seed sequence (which will trigger MSA creation) or a ready-to-use MSA (via msa_file).
|
|
132
|
+
|
|
133
|
+
Note that seed and msa_file are mutually exclusive, and one or the other must be set.
|
|
134
|
+
|
|
135
|
+
Parameters
|
|
136
|
+
----------
|
|
137
|
+
session : APISession
|
|
138
|
+
|
|
139
|
+
msa_file : BinaryIO, Optional
|
|
140
|
+
Ready-made MSA file. Defaults to None.
|
|
141
|
+
seed : str | bytes, optional
|
|
142
|
+
Seed sequence to trigger MSA job. Defaults to None.
|
|
143
|
+
|
|
144
|
+
Raises
|
|
145
|
+
------
|
|
146
|
+
Exception
|
|
147
|
+
If msa_file and seed are both None.
|
|
148
|
+
|
|
149
|
+
Returns
|
|
150
|
+
-------
|
|
151
|
+
Job
|
|
152
|
+
Job details.
|
|
153
|
+
"""
|
|
154
|
+
if (msa_file is None and seed is None) or (
|
|
155
|
+
msa_file is not None and seed is not None
|
|
156
|
+
):
|
|
157
|
+
raise MissingParameterError("seed OR msa_file must be provided.")
|
|
158
|
+
endpoint = "v1/align/msa"
|
|
159
|
+
|
|
160
|
+
is_seed = False
|
|
161
|
+
if seed is not None:
|
|
162
|
+
seed = seed.encode() if isinstance(seed, str) else seed
|
|
163
|
+
msa_file = io.BytesIO(b"\n".join([b">seed", seed]))
|
|
164
|
+
is_seed = True
|
|
165
|
+
|
|
166
|
+
params = {"is_seed": is_seed}
|
|
167
|
+
files = {"msa_file": msa_file}
|
|
168
|
+
|
|
169
|
+
response = session.post(endpoint, files=files, params=params)
|
|
170
|
+
return Job.model_validate(response.json())
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
# TODO - document the `ep` and `op` parameters
|
|
174
|
+
def mafft_post(
|
|
175
|
+
session: APISession,
|
|
176
|
+
sequence_file: BinaryIO,
|
|
177
|
+
auto: bool = True,
|
|
178
|
+
ep: float | None = None,
|
|
179
|
+
op: float | None = None,
|
|
180
|
+
) -> Job:
|
|
181
|
+
"""
|
|
182
|
+
Align sequences using the `mafft` algorithm. Sequences can be provided as `fasta` or `csv` formats. If `csv`, the file must be headerless with either a single sequence column or name, sequence columns.
|
|
183
|
+
|
|
184
|
+
Set auto to True to automatically attempt the best params. Leave a parameter as None to use system defaults.
|
|
185
|
+
|
|
186
|
+
Parameters
|
|
187
|
+
----------
|
|
188
|
+
session : APISession
|
|
189
|
+
sequence_file : BinaryIO
|
|
190
|
+
Sequences to align in fasta or csv format.
|
|
191
|
+
auto : bool = True, optional
|
|
192
|
+
Set to true to automatically set algorithm parameters.
|
|
193
|
+
ep : float, optional
|
|
194
|
+
mafft parameter
|
|
195
|
+
op : float, optional
|
|
196
|
+
mafft parameter
|
|
197
|
+
|
|
198
|
+
Returns
|
|
199
|
+
-------
|
|
200
|
+
Job
|
|
201
|
+
Job details.
|
|
202
|
+
"""
|
|
203
|
+
endpoint = "v1/align/mafft"
|
|
204
|
+
|
|
205
|
+
files = {"file": sequence_file}
|
|
206
|
+
params: dict = {"auto": auto}
|
|
207
|
+
if ep is not None:
|
|
208
|
+
params["ep"] = ep
|
|
209
|
+
if op is not None:
|
|
210
|
+
params["op"] = op
|
|
211
|
+
|
|
212
|
+
response = session.post(endpoint, files=files, params=params)
|
|
213
|
+
return Job.model_validate(response.json())
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
# TODO - document the `clustersize` and `iterations` parameters
|
|
217
|
+
def clustalo_post(
|
|
218
|
+
session: APISession,
|
|
219
|
+
sequence_file: BinaryIO,
|
|
220
|
+
clustersize: int | None = None,
|
|
221
|
+
iterations: int | None = None,
|
|
222
|
+
) -> Job:
|
|
223
|
+
"""
|
|
224
|
+
Align sequences using the `clustal omega` algorithm. Sequences can be provided as `fasta` or `csv` formats. If `csv`, the file must be headerless with either a single sequence column or name, sequence columns.
|
|
225
|
+
|
|
226
|
+
Leave a parameter as None to use system defaults.
|
|
227
|
+
|
|
228
|
+
Parameters
|
|
229
|
+
----------
|
|
230
|
+
session : APISession
|
|
231
|
+
sequence_file : BinaryIO
|
|
232
|
+
Sequences to align in fasta or csv format.
|
|
233
|
+
clustersize : int, optional
|
|
234
|
+
clustal omega parameter
|
|
235
|
+
iterations : int, optional
|
|
236
|
+
clustal omega parameter
|
|
237
|
+
|
|
238
|
+
Returns
|
|
239
|
+
-------
|
|
240
|
+
Job
|
|
241
|
+
Job details.
|
|
242
|
+
"""
|
|
243
|
+
endpoint = "v1/align/clustalo"
|
|
244
|
+
|
|
245
|
+
files = {"file": sequence_file}
|
|
246
|
+
params = {}
|
|
247
|
+
if clustersize is not None:
|
|
248
|
+
params["clustersize"] = clustersize
|
|
249
|
+
if iterations is not None:
|
|
250
|
+
params["iterations"] = iterations
|
|
251
|
+
|
|
252
|
+
response = session.post(endpoint, files=files, params=params)
|
|
253
|
+
return Job.model_validate(response.json())
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def abnumber_post(
|
|
257
|
+
session: APISession,
|
|
258
|
+
sequence_file: BinaryIO,
|
|
259
|
+
scheme: str = "imgt",
|
|
260
|
+
) -> Job:
|
|
261
|
+
"""
|
|
262
|
+
Align antibody using `AbNumber`. Sequences can be provided as `fasta` or `csv` formats. If `csv`, the file must be headerless with either a single sequence column or name, sequence columns.
|
|
263
|
+
|
|
264
|
+
The antibody numbering scheme can be specified from `imgt` (default), `chothia`, `kabat`, or `aho`.
|
|
265
|
+
|
|
266
|
+
Parameters
|
|
267
|
+
----------
|
|
268
|
+
session : APISession
|
|
269
|
+
sequence_file : BinaryIO
|
|
270
|
+
Sequences to align in fasta or csv format.
|
|
271
|
+
scheme : str = 'imgt'
|
|
272
|
+
Antibody numbering scheme. Can be one of 'imgt', 'chothia', 'kabat', or 'aho'
|
|
273
|
+
|
|
274
|
+
Returns
|
|
275
|
+
-------
|
|
276
|
+
Job
|
|
277
|
+
Job details.
|
|
278
|
+
"""
|
|
279
|
+
endpoint = "v1/align/abnumber"
|
|
280
|
+
|
|
281
|
+
valid_schemes = ["imgt", "chothia", "kabat", "aho"]
|
|
282
|
+
if scheme not in valid_schemes:
|
|
283
|
+
raise Exception(
|
|
284
|
+
f"Antibody numbering {scheme} not recognized. Must be one of {valid_schemes}."
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
files = {"file": sequence_file}
|
|
288
|
+
params = {"scheme": scheme}
|
|
289
|
+
|
|
290
|
+
response = session.post(endpoint, files=files, params=params)
|
|
291
|
+
return Job.model_validate(response.json())
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
# TODO - implement support for getting the antibody numbering from an `AbNumber` job
|
|
295
|
+
def antibody_schema_get(session: APISession, job_id: str):
|
|
296
|
+
"""
|
|
297
|
+
Return the antibody numbering for an `AbNumber` job.
|
|
298
|
+
"""
|
|
299
|
+
raise NotImplementedError()
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
def prompt_post(
|
|
303
|
+
session: APISession,
|
|
304
|
+
msa_id: str,
|
|
305
|
+
num_sequences: int | None = None,
|
|
306
|
+
num_residues: int | None = None,
|
|
307
|
+
method: MSASamplingMethod = MSASamplingMethod.NEIGHBORS_NONGAP_NORM_NO_LIMIT,
|
|
308
|
+
homology_level: float = 0.8,
|
|
309
|
+
max_similarity: float = 1.0,
|
|
310
|
+
min_similarity: float = 0.0,
|
|
311
|
+
always_include_seed_sequence: bool = False,
|
|
312
|
+
num_ensemble_prompts: int = 1,
|
|
313
|
+
random_seed: int | None = None,
|
|
314
|
+
) -> Job:
|
|
315
|
+
"""
|
|
316
|
+
Create a protein sequence prompt from a linked MSA (Multiple Sequence Alignment) for PoET Jobs.
|
|
317
|
+
|
|
318
|
+
The MSA is specified by msa_id and created in msa_post.
|
|
319
|
+
|
|
320
|
+
Parameters
|
|
321
|
+
----------
|
|
322
|
+
session : APISession
|
|
323
|
+
An instance of APISession to manage interactions with the API.
|
|
324
|
+
msa_id : str
|
|
325
|
+
The ID of the Multiple Sequence Alignment to use for the prompt.
|
|
326
|
+
num_sequences : int, optional
|
|
327
|
+
Maximum number of sequences in the prompt. Must be <100.
|
|
328
|
+
num_residues : int, optional
|
|
329
|
+
Maximum number of residues (tokens) in the prompt. Must be less than 24577.
|
|
330
|
+
method : MSASamplingMethod, optional
|
|
331
|
+
Method to use for MSA sampling. Defaults to NEIGHBORS_NONGAP_NORM_NO_LIMIT.
|
|
332
|
+
homology_level : float, optional
|
|
333
|
+
Level of homology for sequences in the MSA (neighbors methods only). Must be between 0 and 1. Defaults to 0.8.
|
|
334
|
+
max_similarity : float, optional
|
|
335
|
+
Maximum similarity between sequences in the MSA and the seed. Must be between 0 and 1. Defaults to 1.0.
|
|
336
|
+
min_similarity : float, optional
|
|
337
|
+
Minimum similarity between sequences in the MSA and the seed. Must be between 0 and 1. Defaults to 0.0.
|
|
338
|
+
always_include_seed_sequence : bool, optional
|
|
339
|
+
Whether to always include the seed sequence in the MSA. Defaults to False.
|
|
340
|
+
num_ensemble_prompts : int, optional
|
|
341
|
+
Number of ensemble jobs to run. Defaults to 1.
|
|
342
|
+
random_seed : int, optional
|
|
343
|
+
Seed for random number generation. Defaults to a random number between 0 and 2**32-1.
|
|
344
|
+
|
|
345
|
+
Raises
|
|
346
|
+
------
|
|
347
|
+
InvalidParameterError
|
|
348
|
+
If provided parameter values are not in the allowed range.
|
|
349
|
+
MissingParameterError
|
|
350
|
+
If both or none of 'num_sequences', 'num_residues' is specified.
|
|
351
|
+
|
|
352
|
+
Returns
|
|
353
|
+
-------
|
|
354
|
+
Job
|
|
355
|
+
"""
|
|
356
|
+
endpoint = "v1/align/prompt"
|
|
357
|
+
|
|
358
|
+
if not (0 <= homology_level <= 1):
|
|
359
|
+
raise InvalidParameterError("The 'homology_level' must be between 0 and 1.")
|
|
360
|
+
if not (0 <= max_similarity <= 1):
|
|
361
|
+
raise InvalidParameterError("The 'max_similarity' must be between 0 and 1.")
|
|
362
|
+
if not (0 <= min_similarity <= 1):
|
|
363
|
+
raise InvalidParameterError("The 'min_similarity' must be between 0 and 1.")
|
|
364
|
+
|
|
365
|
+
if num_residues is None and num_sequences is None:
|
|
366
|
+
num_residues = 12288
|
|
367
|
+
|
|
368
|
+
if (num_sequences is None and num_residues is None) or (
|
|
369
|
+
num_sequences is not None and num_residues is not None
|
|
370
|
+
):
|
|
371
|
+
raise MissingParameterError(
|
|
372
|
+
"Either 'num_sequences' or 'num_residues' must be set, but not both."
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
if num_sequences is not None and not (0 <= num_sequences < 100):
|
|
376
|
+
raise InvalidParameterError("The 'num_sequences' must be between 0 and 100.")
|
|
377
|
+
|
|
378
|
+
if num_residues is not None and not (0 <= num_residues < 24577):
|
|
379
|
+
raise InvalidParameterError("The 'num_residues' must be between 0 and 24577.")
|
|
380
|
+
|
|
381
|
+
if random_seed is None:
|
|
382
|
+
random_seed = random.randrange(2**32)
|
|
383
|
+
|
|
384
|
+
params = {
|
|
385
|
+
"msa_id": msa_id,
|
|
386
|
+
"msa_method": method,
|
|
387
|
+
"homology_level": homology_level,
|
|
388
|
+
"max_similarity": max_similarity,
|
|
389
|
+
"min_similarity": min_similarity,
|
|
390
|
+
"force_include_first": always_include_seed_sequence,
|
|
391
|
+
"replicates": num_ensemble_prompts,
|
|
392
|
+
"seed": random_seed,
|
|
393
|
+
}
|
|
394
|
+
if num_sequences is not None:
|
|
395
|
+
params["max_msa_sequences"] = num_sequences
|
|
396
|
+
if num_residues is not None:
|
|
397
|
+
params["max_msa_tokens"] = num_residues
|
|
398
|
+
|
|
399
|
+
response = session.post(endpoint, params=params)
|
|
400
|
+
return Job.model_validate(response.json())
|