openprotein-python 0.6.0__tar.gz → 0.6.2__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.6.0 → openprotein_python-0.6.2}/PKG-INFO +1 -1
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/designer.py +5 -3
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/designer.py +2 -2
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/futures.py +4 -4
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/design.py +24 -7
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/predictor.py +1 -1
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/pyproject.toml +1 -1
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/.gitignore +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/LICENSE.txt +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/README.md +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/_version.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/align/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/align.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/assaydata.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/deprecated/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/deprecated/design.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/deprecated/poet.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/deprecated/predict.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/deprecated/train.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/embedding.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/fold.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/job.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/predictor.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/svd.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/api/umap.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/deprecated.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/align/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/align/base.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/align/msa.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/align/prompt.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/assaydata.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/deprecated/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/deprecated/design.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/deprecated/poet.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/deprecated/predict.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/deprecated/train.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/base.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/esm.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/future.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/openprotein.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/poet.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/test.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/fold/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/fold/alphafold2.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/fold/base.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/fold/esmfold.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/fold/future.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/predictor/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/predictor/predict.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/predictor/predictor.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/predictor/validate.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/svd.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/umap.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/align.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/assaydata.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/deprecated/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/deprecated/design.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/deprecated/predict.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/deprecated/train.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/designer.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/embeddings.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/fold.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/job.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/predictor.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/svd.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/umap.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/base.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/config.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/csv.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/design/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/embeddings/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/errors.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/fasta.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/fold/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/jobs/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/predictor/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/align.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/assaydata.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/deprecated/__init__.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/deprecated/design.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/deprecated/poet.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/deprecated/predict.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/deprecated/train.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/designer.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/embeddings.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/features.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/fold.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/job.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/svd.py +0 -0
- {openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/umap.py +0 -0
|
@@ -134,7 +134,7 @@ def design_delete(session: APISession, design_id: str):
|
|
|
134
134
|
def designer_get_design_results(
|
|
135
135
|
session: APISession,
|
|
136
136
|
design_id: str,
|
|
137
|
-
step: int | None =
|
|
137
|
+
step: int | None = None,
|
|
138
138
|
) -> Iterator[list[str]]:
|
|
139
139
|
"""
|
|
140
140
|
Get csv encoded results for a design ID.
|
|
@@ -154,6 +154,8 @@ def designer_get_design_results(
|
|
|
154
154
|
"""
|
|
155
155
|
params = {}
|
|
156
156
|
if step is not None:
|
|
157
|
+
if step != -1:
|
|
158
|
+
step -= 1
|
|
157
159
|
params["step"] = step
|
|
158
160
|
endpoint = PATH_PREFIX + f"/{design_id}/results"
|
|
159
161
|
response = session.get(endpoint, params=params, stream=True)
|
|
@@ -195,8 +197,8 @@ def decode_design_result(
|
|
|
195
197
|
)
|
|
196
198
|
preds = np.array([float(pred) for pred in row[pred_start_index:]])
|
|
197
199
|
result = DesignResult(
|
|
198
|
-
step=int(row[0]),
|
|
199
|
-
sample_index=int(row[1]),
|
|
200
|
+
step=int(row[0]) + 1,
|
|
201
|
+
sample_index=int(row[1]) + 1,
|
|
200
202
|
sequence=row[2],
|
|
201
203
|
scores=scores,
|
|
202
204
|
subscores=subscores,
|
|
@@ -120,9 +120,9 @@ class DesignFuture(StreamingFuture, Future):
|
|
|
120
120
|
"""
|
|
121
121
|
return designer.design_delete(session=self.session, design_id=self.id)
|
|
122
122
|
|
|
123
|
-
def stream(self) -> Generator:
|
|
123
|
+
def stream(self, step: int | None = None) -> Generator:
|
|
124
124
|
stream = designer.designer_get_design_results(
|
|
125
|
-
session=self.session, design_id=self.id
|
|
125
|
+
session=self.session, design_id=self.id, step=step
|
|
126
126
|
)
|
|
127
127
|
return designer.decode_design_results_stream(data=stream)
|
|
128
128
|
|
|
@@ -160,7 +160,7 @@ class Future(ABC):
|
|
|
160
160
|
self.job = self._refresh_job()
|
|
161
161
|
|
|
162
162
|
@abstractmethod
|
|
163
|
-
def get(self, verbose: bool = False):
|
|
163
|
+
def get(self, verbose: bool = False, **kwargs):
|
|
164
164
|
"""Return the results from this job."""
|
|
165
165
|
raise NotImplementedError()
|
|
166
166
|
|
|
@@ -267,13 +267,13 @@ class Future(ABC):
|
|
|
267
267
|
|
|
268
268
|
class StreamingFuture(ABC):
|
|
269
269
|
@abstractmethod
|
|
270
|
-
def stream(self) -> Generator:
|
|
270
|
+
def stream(self, **kwargs) -> Generator:
|
|
271
271
|
"""Return the results from this job as a generator."""
|
|
272
272
|
raise NotImplementedError()
|
|
273
273
|
|
|
274
|
-
def get(self, verbose: bool = False) -> list:
|
|
274
|
+
def get(self, verbose: bool = False, **kwargs) -> list:
|
|
275
275
|
"""Return the results from this job."""
|
|
276
|
-
generator = self.stream()
|
|
276
|
+
generator = self.stream(**kwargs)
|
|
277
277
|
if verbose:
|
|
278
278
|
total = None
|
|
279
279
|
if hasattr(self, "__len__"):
|
|
@@ -150,29 +150,46 @@ class DesignConstraint:
|
|
|
150
150
|
self.sequence = sequence
|
|
151
151
|
self.mutations = self.initialize(sequence)
|
|
152
152
|
|
|
153
|
-
def initialize(self, sequence: str) -> dict[int,
|
|
153
|
+
def initialize(self, sequence: str) -> dict[int, set[str]]:
|
|
154
154
|
"""Initialize with no changes allowed to the sequence."""
|
|
155
|
-
return {i:
|
|
155
|
+
return {i: {aa} for i, aa in enumerate(sequence, start=1)}
|
|
156
156
|
|
|
157
|
-
def allow(
|
|
157
|
+
def allow(
|
|
158
|
+
self,
|
|
159
|
+
amino_acids: list[str] | str | None = None,
|
|
160
|
+
positions: int | list[int] | None = None,
|
|
161
|
+
) -> None:
|
|
158
162
|
"""Allow specific amino acids at given positions."""
|
|
159
163
|
if isinstance(positions, int):
|
|
160
164
|
positions = [positions]
|
|
165
|
+
elif positions is None:
|
|
166
|
+
positions = [i + 1 for i in range(len(self.sequence))]
|
|
161
167
|
if isinstance(amino_acids, str):
|
|
162
168
|
amino_acids = list(amino_acids)
|
|
169
|
+
elif amino_acids is None:
|
|
170
|
+
amino_acids = list(self.sequence)
|
|
163
171
|
|
|
164
172
|
for position in positions:
|
|
165
173
|
if position in self.mutations:
|
|
166
|
-
|
|
174
|
+
for aa in amino_acids:
|
|
175
|
+
self.mutations[position].add(aa)
|
|
167
176
|
else:
|
|
168
|
-
self.mutations[position] = amino_acids
|
|
177
|
+
self.mutations[position] = set(amino_acids)
|
|
169
178
|
|
|
170
|
-
def remove(
|
|
179
|
+
def remove(
|
|
180
|
+
self,
|
|
181
|
+
amino_acids: list[str] | str | None = None,
|
|
182
|
+
positions: int | list[int] | None = None,
|
|
183
|
+
) -> None:
|
|
171
184
|
"""Remove specific amino acids from being allowed at given positions."""
|
|
172
185
|
if isinstance(positions, int):
|
|
173
186
|
positions = [positions]
|
|
187
|
+
elif positions is None:
|
|
188
|
+
positions = [i + 1 for i in range(len(self.sequence))]
|
|
174
189
|
if isinstance(amino_acids, str):
|
|
175
190
|
amino_acids = list(amino_acids)
|
|
191
|
+
elif amino_acids is None:
|
|
192
|
+
amino_acids = list(self.sequence)
|
|
176
193
|
|
|
177
194
|
for position in positions:
|
|
178
195
|
if position in self.mutations:
|
|
@@ -182,4 +199,4 @@ class DesignConstraint:
|
|
|
182
199
|
|
|
183
200
|
def as_dict(self) -> dict[int, list[str]]:
|
|
184
201
|
"""Convert the internal mutations representation into a dictionary."""
|
|
185
|
-
return self.mutations
|
|
202
|
+
return {i: list(aa) for i, aa in self.mutations.items()}
|
|
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.6.0 → openprotein_python-0.6.2}/openprotein/api/deprecated/__init__.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
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/align/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/align/prompt.py
RENAMED
|
File without changes
|
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/deprecated/__init__.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/deprecated/design.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/deprecated/poet.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/deprecated/predict.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/deprecated/train.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/__init__.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/base.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/esm.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/future.py
RENAMED
|
File without changes
|
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/poet.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/embeddings/test.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/fold/__init__.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/fold/alphafold2.py
RENAMED
|
File without changes
|
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/fold/esmfold.py
RENAMED
|
File without changes
|
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/predictor/__init__.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/predictor/predict.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/predictor/predictor.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/models/predictor/validate.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/deprecated/design.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/deprecated/predict.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/deprecated/train.py
RENAMED
|
File without changes
|
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/app/services/embeddings.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
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/deprecated/__init__.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/deprecated/design.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/deprecated/poet.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/deprecated/predict.py
RENAMED
|
File without changes
|
{openprotein_python-0.6.0 → openprotein_python-0.6.2}/openprotein/schemas/deprecated/train.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
|