openprotein-python 0.8.2__tar.gz → 0.8.3__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.2 → openprotein_python-0.8.3}/PKG-INFO +1 -1
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/predictor/predictor.py +7 -7
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/umap/api.py +3 -3
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/umap/umap.py +42 -15
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/.gitignore +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/LICENSE.txt +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/README.md +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/_version.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/align/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/align/align.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/align/api.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/align/future.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/align/msa.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/align/schemas.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/base.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/chains.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/common/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/common/features.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/common/model_metadata.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/common/reduction.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/config.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/csv.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/data/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/data/api.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/data/assaydataset.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/data/data.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/data/schemas.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/design/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/design/api.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/design/design.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/design/future.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/design/schemas.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/embeddings/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/embeddings/api.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/embeddings/embeddings.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/embeddings/esm.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/embeddings/future.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/embeddings/models.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/embeddings/openprotein.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/embeddings/poet.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/embeddings/poet2.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/embeddings/schemas.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/errors.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/fasta.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/fold/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/fold/alphafold2.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/fold/api.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/fold/boltz.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/fold/esmfold.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/fold/fold.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/fold/future.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/fold/models.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/fold/schemas.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/jobs/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/jobs/api.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/jobs/futures.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/jobs/jobs.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/jobs/schemas.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/models/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/models/base.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/models/foundation/rfdiffusion.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/models/models.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/predictor/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/predictor/api.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/predictor/models.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/predictor/prediction.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/predictor/schemas.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/predictor/validate.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/prompt/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/prompt/api.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/prompt/models.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/prompt/prompt.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/prompt/schemas.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/protein.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/svd/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/svd/api.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/svd/models.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/svd/schemas.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/svd/svd.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/umap/__init__.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/umap/models.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/umap/schemas.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/utils/uuid.py +0 -0
- {openprotein_python-0.8.2 → openprotein_python-0.8.3}/pyproject.toml +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.3
|
|
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
|
|
@@ -133,20 +133,20 @@ class PredictorAPI:
|
|
|
133
133
|
----------
|
|
134
134
|
assay : AssayMetadata or AssayDataset or str
|
|
135
135
|
Assay to fit GP on.
|
|
136
|
-
properties: list
|
|
136
|
+
properties : list of str
|
|
137
137
|
Properties in the assay to fit the gp on.
|
|
138
|
-
|
|
139
|
-
Type of features to use for encoding sequences. "SVD" or "PLM".
|
|
140
|
-
None would require model to be EmbeddingModel or SVDMode.
|
|
141
|
-
model : EmbeddingModel | SVDModel | str
|
|
138
|
+
model : EmbeddingModel or SVDModel or str
|
|
142
139
|
Instance of either EmbeddingModel or SVDModel to use depending
|
|
143
140
|
on feature type. Can also be a str specifying the model id,
|
|
144
141
|
but then feature_type would have to be specified.
|
|
145
|
-
|
|
142
|
+
feature_type : FeatureType or None
|
|
143
|
+
Type of features to use for encoding sequences. "SVD" or "PLM".
|
|
144
|
+
None would require model to be EmbeddingModel or SVDModel.
|
|
145
|
+
reduction : str or None, optional
|
|
146
146
|
Type of embedding reduction to use for computing features.
|
|
147
147
|
E.g. "MEAN" or "SUM". Used only if using EmbeddingModel, and
|
|
148
148
|
must be non-nil if using an EmbeddingModel. Defaults to None.
|
|
149
|
-
kwargs:
|
|
149
|
+
kwargs :
|
|
150
150
|
Additional keyword arguments to be passed to foundational models, e.g. prompt_id for PoET models.
|
|
151
151
|
|
|
152
152
|
Returns
|
|
@@ -156,7 +156,7 @@ def umap_delete(session: APISession, umap_id: str) -> bool:
|
|
|
156
156
|
def umap_fit_post(
|
|
157
157
|
session: APISession,
|
|
158
158
|
model_id: str,
|
|
159
|
-
feature_type:
|
|
159
|
+
feature_type: str,
|
|
160
160
|
sequences: list[bytes] | list[str] | None = None,
|
|
161
161
|
assay_id: str | None = None,
|
|
162
162
|
n_components: int = 2,
|
|
@@ -174,7 +174,7 @@ def umap_fit_post(
|
|
|
174
174
|
Session object for API communication.
|
|
175
175
|
model_id : str
|
|
176
176
|
Model to use. Can be either svd_id or id of a foundational model.
|
|
177
|
-
feature_type:
|
|
177
|
+
feature_type: str
|
|
178
178
|
Type of feature to use for fitting UMAP. Either PLM or SVD.
|
|
179
179
|
sequences : list[bytes] | None, optional
|
|
180
180
|
Optional sequences to fit UMAP with. Either use sequences or
|
|
@@ -203,7 +203,7 @@ def umap_fit_post(
|
|
|
203
203
|
|
|
204
204
|
body = {
|
|
205
205
|
"model_id": model_id,
|
|
206
|
-
"feature_type": feature_type
|
|
206
|
+
"feature_type": feature_type,
|
|
207
207
|
"n_components": n_components,
|
|
208
208
|
"n_neighbors": n_neighbors,
|
|
209
209
|
"min_dist": min_dist,
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
from openprotein.base import APISession
|
|
4
4
|
from openprotein.common import FeatureType, ReductionType
|
|
5
5
|
from openprotein.data import AssayDataset, AssayMetadata
|
|
6
|
-
from openprotein.embeddings import EmbeddingModel
|
|
6
|
+
from openprotein.embeddings import EmbeddingModel, EmbeddingsAPI
|
|
7
7
|
from openprotein.errors import InvalidParameterError
|
|
8
8
|
from openprotein.jobs import JobsAPI
|
|
9
|
-
from openprotein.svd import SVDModel
|
|
9
|
+
from openprotein.svd import SVDAPI, SVDModel
|
|
10
10
|
|
|
11
11
|
from . import api
|
|
12
12
|
from .models import UMAPModel
|
|
@@ -38,8 +38,6 @@ class UMAPAPI:
|
|
|
38
38
|
|
|
39
39
|
Parameters
|
|
40
40
|
----------
|
|
41
|
-
model_id : str
|
|
42
|
-
The ID of the model to fit the UMAP on.
|
|
43
41
|
sequences: list of bytes or None, optional
|
|
44
42
|
Optional sequences to fit UMAP with. Either use sequences or
|
|
45
43
|
assay_id. sequences is preferred.
|
|
@@ -47,17 +45,24 @@ class UMAPAPI:
|
|
|
47
45
|
Optional assay containing sequences to fit SVD with.
|
|
48
46
|
Or its assay_id. Either use sequences or assay.
|
|
49
47
|
Ignored if sequences are provided.
|
|
50
|
-
|
|
48
|
+
model : EmbeddingModel or SVDModel or str
|
|
49
|
+
Instance of either EmbeddingModel or SVDModel to use depending
|
|
50
|
+
on feature type. Can also be a str specifying the model id,
|
|
51
|
+
but then feature_type would have to be specified.
|
|
52
|
+
feature_type : FeatureType or None, optional
|
|
53
|
+
Type of features to use for encoding sequences. "SVD" or "PLM".
|
|
54
|
+
None would require model to be EmbeddingModel or SVDModel.
|
|
55
|
+
n_components : int, optional
|
|
51
56
|
Number of UMAP components to fit. Defaults to 2.
|
|
52
|
-
n_neighbors: int
|
|
57
|
+
n_neighbors : int, optional
|
|
53
58
|
Number of neighbors to use for fitting. Defaults to 15.
|
|
54
|
-
min_dist: float
|
|
59
|
+
min_dist : float, optional
|
|
55
60
|
Minimum distance in UMAP fitting. Defaults to 0.1.
|
|
56
|
-
reduction: str or None, optional
|
|
61
|
+
reduction : str or None, optional
|
|
57
62
|
Type of embedding reduction to use for computing features.
|
|
58
63
|
E.g. "MEAN" or "SUM". Useful when dealing with variable length
|
|
59
64
|
sequence. Defaults to None.
|
|
60
|
-
kwargs:
|
|
65
|
+
kwargs :
|
|
61
66
|
Additional keyword arguments to be passed to foundational models, e.g. prompt_id for PoET models.
|
|
62
67
|
|
|
63
68
|
Returns
|
|
@@ -65,14 +70,35 @@ class UMAPAPI:
|
|
|
65
70
|
UMAPModel
|
|
66
71
|
The UMAP model being fit.
|
|
67
72
|
"""
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
# extract feature type
|
|
74
|
+
feature_type = (
|
|
75
|
+
FeatureType.PLM
|
|
76
|
+
if isinstance(model, EmbeddingModel)
|
|
77
|
+
else FeatureType.SVD if isinstance(model, SVDModel) else feature_type
|
|
78
|
+
)
|
|
79
|
+
if feature_type is None:
|
|
80
|
+
raise InvalidParameterError(
|
|
81
|
+
"Expected feature_type to be provided if passing str model_id as model"
|
|
82
|
+
)
|
|
83
|
+
# get model if model_id
|
|
84
|
+
if feature_type == FeatureType.PLM:
|
|
85
|
+
if reduction is None:
|
|
70
86
|
raise InvalidParameterError(
|
|
71
|
-
"Expected
|
|
87
|
+
"Expected reduction if using EmbeddingModel"
|
|
72
88
|
)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
89
|
+
if isinstance(model, str):
|
|
90
|
+
embeddings_api = getattr(self.session, "embedding", None)
|
|
91
|
+
assert isinstance(embeddings_api, EmbeddingsAPI)
|
|
92
|
+
model = embeddings_api.get_model(model)
|
|
93
|
+
assert isinstance(model, EmbeddingModel), "Expected EmbeddingModel"
|
|
94
|
+
model_id = model.id
|
|
95
|
+
elif feature_type == FeatureType.SVD:
|
|
96
|
+
if isinstance(model, str):
|
|
97
|
+
svd_api = getattr(self.session, "svd", None)
|
|
98
|
+
assert isinstance(svd_api, SVDAPI)
|
|
99
|
+
model = svd_api.get_svd(model)
|
|
100
|
+
assert isinstance(model, SVDModel), "Expected SVDModel"
|
|
101
|
+
model_id = model.id
|
|
76
102
|
# get assay_id
|
|
77
103
|
assay_id = (
|
|
78
104
|
assay.assay_id
|
|
@@ -84,6 +110,7 @@ class UMAPAPI:
|
|
|
84
110
|
job=api.umap_fit_post(
|
|
85
111
|
session=self.session,
|
|
86
112
|
model_id=model_id,
|
|
113
|
+
feature_type=feature_type,
|
|
87
114
|
sequences=sequences,
|
|
88
115
|
assay_id=assay_id,
|
|
89
116
|
n_components=n_components,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openprotein_python-0.8.2 → openprotein_python-0.8.3}/openprotein/models/foundation/rfdiffusion.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|