Skip to content

Commit e8117a2

Browse files
authored
sync (#278)
1 parent 79c1208 commit e8117a2

3 files changed

Lines changed: 281 additions & 249 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ repos:
3131
language: system
3232
types: [python]
3333
pass_filenames: true # For speed, we only check the files that are changed
34+
- repo: https://github.com/gitleaks/gitleaks
35+
rev: v8.24.2
36+
hooks:
37+
- id: gitleaks

esm/sdk/forge.py

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@
2929
from esm.utils.constants.api import MIMETYPE_ES_PICKLE
3030
from esm.utils.misc import deserialize_tensors, maybe_list, maybe_tensor
3131
from esm.utils.msa import MSA
32-
from esm.utils.structure.input_builder import (
33-
StructurePredictionInput,
34-
serialize_structure_prediction_input,
35-
)
36-
from esm.utils.structure.molecular_complex import (
37-
MolecularComplex,
38-
MolecularComplexResult,
39-
)
4032
from esm.utils.types import FunctionAnnotation
4133

4234

@@ -217,70 +209,6 @@ def fold(
217209

218210
return self._process_fold_response(data, sequence)
219211

220-
@retry_decorator
221-
async def async_fold_all_atom(
222-
self, all_atom_input: StructurePredictionInput, model_name: str | None = None
223-
) -> MolecularComplexResult | list[MolecularComplexResult] | ESMProteinError:
224-
"""Fold a molecular complex containing proteins, nucleic acids, and/or ligands.
225-
226-
Args:
227-
all_atom_input: StructurePredictionInput containing sequences for different molecule types
228-
model_name: Override the client level model name if needed
229-
"""
230-
request = self._process_fold_all_atom_request(
231-
all_atom_input, model_name if model_name is not None else self.model
232-
)
233-
234-
try:
235-
data = await self._async_post("fold_all_atom", request)
236-
except ESMProteinError as e:
237-
return e
238-
239-
return self._process_fold_all_atom_response(data)
240-
241-
@retry_decorator
242-
def fold_all_atom(
243-
self, all_atom_input: StructurePredictionInput, model_name: str | None = None
244-
) -> MolecularComplexResult | list[MolecularComplexResult] | ESMProteinError:
245-
"""Predict coordinates for a molecular complex containing proteins, dna, rna, and/or ligands.
246-
247-
Args:
248-
all_atom_input: StructurePredictionInput containing sequences for different molecule types
249-
model_name: Override the client level model name if needed
250-
"""
251-
request = self._process_fold_all_atom_request(
252-
all_atom_input, model_name if model_name is not None else self.model
253-
)
254-
255-
try:
256-
data = self._post("fold_all_atom", request)
257-
except ESMProteinError as e:
258-
return e
259-
260-
return self._process_fold_all_atom_response(data)
261-
262-
@staticmethod
263-
def _process_fold_all_atom_request(
264-
all_atom_input: StructurePredictionInput, model_name: str | None = None
265-
) -> dict[str, Any]:
266-
request: dict[str, Any] = {
267-
"all_atom_input": serialize_structure_prediction_input(all_atom_input),
268-
"model": model_name,
269-
}
270-
271-
return request
272-
273-
@staticmethod
274-
def _process_fold_all_atom_response(data: dict[str, Any]) -> MolecularComplexResult:
275-
complex_data = data.get("complex")
276-
molecular_complex = MolecularComplex.from_state_dict(complex_data)
277-
return MolecularComplexResult(
278-
complex=molecular_complex,
279-
plddt=maybe_tensor(data.get("plddt"), convert_none_to_nan=True),
280-
ptm=data.get("ptm", None),
281-
distogram=maybe_tensor(data.get("distogram"), convert_none_to_nan=True),
282-
)
283-
284212
@retry_decorator
285213
async def async_inverse_fold(
286214
self,

0 commit comments

Comments
 (0)